Commit 50df420d authored by Jean-Michel Vien VA2XJM's avatar Jean-Michel Vien VA2XJM
Browse files

Quick Spiderify fix

Fixing Spiderify bug that generate errors if map is generated at zoom levels where Spiderify is not activated.
parent 8e7bfa58
......@@ -1155,12 +1155,8 @@ function create_MapImage()
});\n\n
}
//SPIDERFY
var oms = new Spiderfy(map);
oms.disable();
map.on('zoomend', function(e) {
currZoom = e.target._zoom;
if(currZoom >= 12) {
if(currZoom >= 0) {
oms.enable();
document.getElementById('spiderfyActive').style.visibility = 'visible';
oms.addListener('activate', function(markers) {
......@@ -1168,7 +1164,7 @@ function create_MapImage()
markers[i].closePopup();
}
});
}else {
}if(currZoom <= 11) {
oms.disable();
document.getElementById('spiderfyActive').style.visibility = 'hidden';
oms.removeListener('activate', function(markers) {
......@@ -1178,6 +1174,7 @@ function create_MapImage()
});
}
});
";
return $Content;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment