From 98ef10bf15c3e696250d63d0119340d47bdbba30 Mon Sep 17 00:00:00 2001 From: fl Date: Tue, 24 Sep 2024 16:02:35 +0200 Subject: [PATCH 1/2] Add token to url template --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index bab7003..9aac393 100644 --- a/index.js +++ b/index.js @@ -154,7 +154,8 @@ L.TileLayer.Bing = L.TileLayer.extend({ var url = L.Util.template(this._url, { quadkey: quadkey, subdomain: this._getSubdomain(coords), - culture: this.options.culture + culture: this.options.culture, + token: this.options.bingMapsKey }) if (typeof this.options.style === 'string') { url += '&st=' + this.options.style From 429326073cd387d574495a1d93a8c2fd6d6ea814 Mon Sep 17 00:00:00 2001 From: fl Date: Tue, 24 Sep 2024 16:04:33 +0200 Subject: [PATCH 2/2] Update distribution files --- leaflet-bing-layer.js | 69 +++++++++++++++++++++++++++------------ leaflet-bing-layer.min.js | 2 +- 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/leaflet-bing-layer.js b/leaflet-bing-layer.js index 4448278..5b89acb 100644 --- a/leaflet-bing-layer.js +++ b/leaflet-bing-layer.js @@ -1,5 +1,5 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0;o--){var r=0,a=1<-1||t.attributionControl.addAttribution(e)}),o.filter(function(e){i.indexOf(e)>-1||t.attributionControl.removeAttribution(e)}),this._attributions=i}.bind(this))}},_getAttributions:function(t,e){return this._imageryProviders.reduce(function(n,i){for(var o=0;o=i.coverageAreas[o].zoomMin&&e<=i.coverageAreas[o].zoomMax)return n.push(i.attribution),n;return n},[])}}),r.tileLayer.bing=function(t){return new r.TileLayer.Bing(t)},e.exports=r.TileLayer.Bing}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bbox-intersect":2,"fetch-jsonp":3}],2:[function(t,e,n){e.exports=function(t,e){return t[0]>e[2]||t[2]e[3]?!1:!0}},{}],3:[function(t,e,n){!function(t,i){if("function"==typeof define&&define.amd)define(["exports","module"],i);else if("undefined"!=typeof n&&"undefined"!=typeof e)i(n,e);else{var o={exports:{}};i(o.exports,o),t.fetchJsonp=o.exports}}(this,function(t,e){"use strict";function n(){return"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random())}function i(t){try{delete window[t]}catch(e){window[t]=void 0}}function o(t){var e=document.getElementById(t);document.getElementsByTagName("head")[0].removeChild(e)}var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null},a=function(t){var e=void 0===arguments[1]?{}:arguments[1],a=null!=e.timeout?e.timeout:r.timeout,s=null!=e.jsonpCallback?e.jsonpCallback:r.jsonpCallback,u=void 0;return new Promise(function(r,l){var c=e.jsonpCallbackFunction||n();window[c]=function(t){r({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),o(s+"_"+c),i(c)},t+=-1===t.indexOf("?")?"?":"&";var d=document.createElement("script");d.setAttribute("src",t+s+"="+c),d.id=s+"_"+c,document.getElementsByTagName("head")[0].appendChild(d),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),i(c),o(s+"_"+c)},a)})};e.exports=a})},{}]},{},[1]); \ No newline at end of file +!function n(o,r,a){function s(e,t){if(!r[e]){if(!o[e]){var i="function"==typeof require&&require;if(!t&&i)return i(e,!0);if(u)return u(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}i=r[e]={exports:{}},o[e][0].call(i.exports,function(t){return s(o[e][1][t]||t)},i,i.exports,n,o,r,a)}return r[e].exports}for(var u="function"==typeof require&&require,t=0;t{for(var n="",o=i;0=e.coverageAreas[i].zoomMin&&o<=e.coverageAreas[i].zoomMax)return t.push(e.attribution),t;return t},[])}}),n.tileLayer.bing=function(t){return new n.TileLayer.Bing(t)},s.exports=n.TileLayer.Bing}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bbox-intersect":2,"fetch-jsonp":3}],2:[function(t,e,i){e.exports=function(t,e){return!(t[0]>e[2]||t[2]e[3])}},{}],3:[function(t,e,i){var n,o;n=this,o=function(t,e){var i=5e3,n="callback";function d(e){try{delete window[e]}catch(t){window[e]=void 0}}function h(t){t=document.getElementById(t);t&&document.getElementsByTagName("head")[0].removeChild(t)}e.exports=function(r){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=r,u=a.timeout||i,l=a.jsonpCallback||n,c=void 0;return new Promise(function(e,t){var i=a.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),n=l+"_"+i,o=(window[i]=function(t){e({ok:!0,json:function(){return Promise.resolve(t)}}),c&&clearTimeout(c),h(n),d(i)},s+=-1===s.indexOf("?")?"?":"&",document.createElement("script"));o.setAttribute("src",""+s+l+"="+i),a.charset&&o.setAttribute("charset",a.charset),a.nonce&&o.setAttribute("nonce",a.nonce),a.referrerPolicy&&o.setAttribute("referrerPolicy",a.referrerPolicy),a.crossorigin&&o.setAttribute("crossorigin","true"),o.id=n,document.getElementsByTagName("head")[0].appendChild(o),c=setTimeout(function(){t(new Error("JSONP request to "+r+" timed out")),d(i),h(n),window[i]=function(){d(i)}},u),o.onerror=function(){t(new Error("JSONP request to "+r+" failed")),d(i),h(n),c&&clearTimeout(c)}})}},"function"==typeof define&&define.amd?define(["exports","module"],o):void 0!==i&&void 0!==e?o(0,e):(o(o={exports:{}},o),n.fetchJsonp=o.exports)},{}]},{},[1]); \ No newline at end of file