From 2ebbfdf40c1741e9733182c9997b0d4dc003076e Mon Sep 17 00:00:00 2001 From: mourner Date: Mon, 13 Feb 2012 13:12:36 +0200 Subject: [PATCH] Fixed attributions disappearing, closed #405 --- src/control/Control.Attribution.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/control/Control.Attribution.js b/src/control/Control.Attribution.js index d0f66e94..c56e5ed2 100644 --- a/src/control/Control.Attribution.js +++ b/src/control/Control.Attribution.js @@ -3,7 +3,7 @@ L.Control.Attribution = L.Class.extend({ this._prefix = prefix || 'Powered by Leaflet'; this._attributions = {}; }, - + onAdd: function (map) { this._container = L.DomUtil.create('div', 'leaflet-control-attribution'); L.DomEvent.disableClickPropagation(this._container); @@ -28,7 +28,10 @@ L.Control.Attribution = L.Class.extend({ if (!text) { return; } - this._attributions[text] = true; + if (!this._attributions[text]) { + this._attributions[text] = 0; + } + this._attributions[text]++; this._update(); }, @@ -36,7 +39,7 @@ L.Control.Attribution = L.Class.extend({ if (!text) { return; } - delete this._attributions[text]; + this._attributions[text]--; this._update(); },