Dear list,
Every time a user choose a location from drop down list, a marker will be 
constructed on the WMS map by a function 
(see snippet below). 
To avoid being crowded, how to erase markers created  by previous users, before 
a new user choose a new location?
Any hints would be appreciated. 
 
thank you  
 
kind regards,
surya
---------------------------------------
function go(){
......
var lonlat = document.getElementById('lonlat').options[document.getElementById('lonlat').selectedIndex].value;
var longitude = lonlat.substring(0,lonlat.indexOf(','));
var latitude = lonlat.substring(lonlat.indexOf(',')+1,lonlat.length);
map.setCenter(new OpenLayers.LonLat(longitude,latitude),6); 
var markers = new OpenLayers.Layer.Markers ("Markers", {'calculateInRange': 
function() { return true; }});
var size = new OpenLayers.Size (21, 25); 
var offset = new OpenLayers.Pixel (-(size.w/2), -size.h); 
var icon1 = new OpenLayers.Icon 
('http://localhost:8080/geoserver/openlayers/img/marker-gold.png', size, 
offset); 
m1 = new OpenLayers.Marker (new OpenLayers.LonLat (longitude,latitude), icon1); 
m1.setOpacity (1); 
markers.addMarker (m1); 
}
--------------------------------------


      
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to