From 862cde1056da70439773a0a102071870520b25ce Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 14 Aug 2012 17:16:04 +0100 Subject: [PATCH] fix for maps without attribution control --- WebContent/base/leaflet/L.BingLayer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WebContent/base/leaflet/L.BingLayer.js b/WebContent/base/leaflet/L.BingLayer.js index de596edee..aea4b3442 100644 --- a/WebContent/base/leaflet/L.BingLayer.js +++ b/WebContent/base/leaflet/L.BingLayer.js @@ -117,6 +117,7 @@ L.BingLayer = L.TileLayer.extend({ _update_attribution: function() { var bounds = this._map.getBounds(); var zoom = this._map.getZoom(); + if(this._map.attributionControl) // check if attributionControl is active for (var i = 0; i < this._providers.length; i++) { var p = this._providers[i]; if ((zoom <= p.zoomMax && zoom >= p.zoomMin) && @@ -133,6 +134,7 @@ L.BingLayer = L.TileLayer.extend({ }, onRemove: function(map) { + if(this._map.attributionControl) // check if attributionControl is activ for (var i = 0; i < this._providers.length; i++) { var p = this._providers[i]; if (p.active) { @@ -140,6 +142,6 @@ L.BingLayer = L.TileLayer.extend({ p.active = false; } } - L.TileLayer.prototype.onRemove.apply(this, [map]); + L.TileLayer.prototype.onRemove.apply(this, [map]); } });