diff --git a/plugins/max-links.user.js b/plugins/max-links.user.js index 880584ee..85b39e74 100644 --- a/plugins/max-links.user.js +++ b/plugins/max-links.user.js @@ -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('