From 6b13183b29e620c6d0e0e55febc6a660176ae3ec Mon Sep 17 00:00:00 2001 From: James Diacono Date: Wed, 25 Jul 2018 22:20:38 +1000 Subject: [PATCH] Use tile zoom rather than map zoom to get attributions --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index bab7003..6ed3faf 100644 --- a/index.js +++ b/index.js @@ -228,7 +228,11 @@ L.TileLayer.Bing = L.TileLayer.extend({ _updateAttribution: function () { var map = this._map if (!map || !map.attributionControl) return - var zoom = map.getZoom() + + // map zoom can be out of bounds of native zoom levels, use the + // zoom level of the request tile instead + var zoom = this._tileZoom + var bbox = toBingBBox(map.getBounds().toBBoxString()) this._fetch.then(function () { var newAttributions = this._getAttributions(bbox, zoom)