Add a marker to the map when clicking on a search result.
This commit is contained in:
parent
bac37f29d2
commit
2408dd333f
1 changed files with 7 additions and 1 deletions
|
@ -46,6 +46,7 @@
|
|||
<script type="text/javascript">
|
||||
<!--
|
||||
var brokenContentSize = $("content").offsetWidth == 0;
|
||||
var marker;
|
||||
var map;
|
||||
|
||||
function init(){
|
||||
|
@ -69,7 +70,7 @@
|
|||
<% end %>
|
||||
|
||||
<% if marker %>
|
||||
addMarkerToMap(lonLatToMercator(new OpenLayers.LonLat(<%= mlon %>, <%= mlat %>)));
|
||||
marker = addMarkerToMap(lonLatToMercator(new OpenLayers.LonLat(<%= mlon %>, <%= mlat %>)));
|
||||
<% end %>
|
||||
|
||||
<% if layers %>
|
||||
|
@ -86,6 +87,11 @@
|
|||
var centre = lonLatToMercator(new OpenLayers.LonLat(lon, lat));
|
||||
|
||||
map.setCenter(centre, zoom);
|
||||
|
||||
if (marker)
|
||||
removeMarkerFromMap(marker);
|
||||
|
||||
marker = addMarkerToMap(centre);
|
||||
}
|
||||
|
||||
function updateLocation() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue