In my code, markers from GeoJSON are displayed, when I managed to zoom in 10, it loads a GeoJSON file, but how can I avoid repeating the same markers? Is there a way to check if a marker exists in a specific place? The code
map.events.register("zoomend", null, function(){ if(map.zoom == 10) { var bounds = map.getExtent(); console.log(bounds); var ne = new OpenLayers.LonLat(bounds.right,bounds.top).transform(map.getProjectionObject(),wgs84); var sw = new OpenLayers.LonLat(bounds.left,bounds.bottom).transform(map.getProjectionObject(),wgs84); var vectorLayer = new OpenLayers.Layer.Vector(); map.addLayer(vectorLayer); $.getJSON('ajax.php?a=markers&type=json&sw=('+sw.lon+','+sw.lat+')&ne=('+ne.lon+','+ne.lat+')',function(data){
source share