From 4f68673b69d2742063d39e1c4492594bff637ab7 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 28 Aug 2013 17:54:48 +0100 Subject: [PATCH] max links: remove the error message when the layer is turned off --- plugins/max-links.user.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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('