max links: remove the error message when the layer is turned off

This commit is contained in:
Jon Atkins 2013-08-28 17:54:48 +01:00
parent ae88e8276f
commit 4f68673b69

View File

@ -149,7 +149,11 @@ window.plugin.maxLinks.setup = function() {
if (e.layer === window.plugin.maxLinks.layer)
window.plugin.maxLinks.updateLayer();
});
window.map.on('zoomend moveend', window.plugin.maxLinks.updateLayer);
window.map.on('layerremove', function(e) {
if (e.layer === window.plugin.maxLinks.layer)
window.plugin.maxLinks.clearErrorMarker();
});
window.addLayerGroup('Maximum Links', window.plugin.maxLinks.layer, false);
$('head').append('<style>'+