leaflet-bing-layer
Advanced tools
Comparing version 2.0.0 to 2.0.2
/* https://github.com/camsong/fetch-jsonp */ | ||
/*eslint-disable */ | ||
!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.fetchJsonp=n.exports}}(this,function(e,t){"use strict";function n(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function o(e){try{delete window[e]}catch(t){window[e]=void 0}}function i(e){var t=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(t)}var u={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null},a=function(e){var t=void 0===arguments[1]?{}:arguments[1],a=null!=t.timeout?t.timeout:u.timeout,r=null!=t.jsonpCallback?t.jsonpCallback:u.jsonpCallback,l=void 0;return new Promise(function(u,c){var s=t.jsonpCallbackFunction||n();window[s]=function(e){u({ok:!0,json:function(){return Promise.resolve(e)}}),l&&clearTimeout(l),i(r+"_"+s),o(s)},e+=-1===e.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",e+r+"="+s),d.id=r+"_"+s,document.getElementsByTagName("head")[0].appendChild(d),l=setTimeout(function(){c(new Error("JSONP request to "+e+" timed out")),o(s),i(r+"_"+s)},a)})};t.exports=a}); | ||
var fetchJsonp=function(){"use strict";function e(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function n(e){try{delete window[e]}catch(n){window[e]=void 0}}function t(e){var n=document.getElementById(e);document.getElementsByTagName("head")[0].removeChild(n)}var o={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null},a=function(a){var i=void 0===arguments[1]?{}:arguments[1],u=null!=i.timeout?i.timeout:o.timeout,r=null!=i.jsonpCallback?i.jsonpCallback:o.jsonpCallback,c=void 0;return new Promise(function(o,l){var m=i.jsonpCallbackFunction||e();window[m]=function(e){o({ok:!0,json:function(){return Promise.resolve(e)}}),c&&clearTimeout(c),t(r+"_"+m),n(m)},a+=-1===a.indexOf("?")?"?":"&";var s=document.createElement("script");s.setAttribute("src",a+r+"="+m),s.id=r+"_"+m,document.getElementsByTagName("head")[0].appendChild(s),c=setTimeout(function(){l(new Error("JSONP request to "+a+" timed out")),n(m),t(r+"_"+m)},u)})};return a}(); | ||
/*eslint-enable */ | ||
@@ -104,3 +104,3 @@ | ||
// Keep a reference to the promise so we can use it later | ||
this._fetch = window.fetchJsonp(metaDataUrl, {jsonpCallback: 'jsonp'}) | ||
this._fetch = fetchJsonp(metaDataUrl, {jsonpCallback: 'jsonp'}) | ||
.then(function (response) { | ||
@@ -161,7 +161,13 @@ return response.json() | ||
L.TileLayer.prototype.onAdd.call(this, map) | ||
this._attributions.forEach(function (attribution) { | ||
map.attributionControl.addAttribution(attribution) | ||
}) | ||
}, | ||
// Clean up events | ||
// Clean up events and remove attributions from attribution control | ||
onRemove: function (map) { | ||
map.off('moveend', this._updateAttribution, this) | ||
this._attributions.forEach(function (attribution) { | ||
map.attributionControl.removeAttribution(attribution) | ||
}) | ||
L.TileLayer.prototype.onRemove.call(this, map) | ||
@@ -168,0 +174,0 @@ }, |
{ | ||
"name": "leaflet-bing-layer", | ||
"version": "2.0.0", | ||
"version": "2.0.2", | ||
"description": "Bing Maps Layer for Leaflet v1.0.0", | ||
@@ -5,0 +5,0 @@ "main": "leaflet-bing-layer.js", |
@@ -18,3 +18,3 @@ # leaflet-bing-layer | ||
| ----------------------------- | -------------- | ----------------------------------------------------------------------------------------------------- | | ||
| `options` | string\|object | A valid [Bing Maps Key](https://msdn.microsoft.com/en-us/library/ff428642.aspx) or an options object | | ||
| `options` | string\|object | A valid [Bing Maps Key](https://msdn.microsoft.com/en-us/library/ff428642.aspx) or an `options` object. `options` inherits from [L.TileLayer options](http://mourner.github.io/Leaflet/reference.html#tilelayer-options) (e.g. you can use `minZoom` and `opacity` and etc) | | ||
| `options.BingMapsKey` | string | A valid Bing Maps Key [_required_] | | ||
@@ -21,0 +21,0 @@ | `[options.imagerySet]` | string | _optional:_ [Imagery Type](https://msdn.microsoft.com/en-us/library/ff701716.aspx) [_default=Aerial_] | |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11306
217