@targomo/leaflet
Advanced tools
Comparing version 0.0.7 to 0.0.9
@@ -1,1 +0,1 @@ | ||
{"name":"@targomo/leaflet","description":"Leaflet maps extensions for Targomo's time-based access mapping services.","author":"Targomo","version":"0.0.7","license":"MIT","repository":"github:targomo/targomo-js-extensions","homepage":"https://targomo.com/developers","bugs":{"url":"https://github.com/targomo/targomo-js-extensions/issues"},"keywords":["map","mapping","leaflet","leaflet-js","googlemaps","cartography","routing","visualization","gis","api","rest","isochrone","reachability","travel","travel-time","commute","commute-time"],"main":"targomo-leaflet.js","module":"targomo-leaflet.js","browser":"targomo-leaflet.umd.min.js","typings":"./typings/index.d.ts","scripts":{"dev":"npm run clean && webpack --watch","build":"npm run clean && node build.js","lint":"tslint -p tsconfig.json","clean":"shx rm -rf dist","test":"npm run test:browser && npm run test:browser","test:browser":"jest --config=jest.config.json --env=jsdom","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --config=jest.config.json","test:coverage":"npm run test:browser --coverage"},"devDependencies":{"@types/fs-extra":"^5.0.4","@types/jest":"^21.1.5","@types/node":"^6.0.60","fs-extra":"^7.0.0","jest":"^21.2.1","rollup":"^0.51.8","rollup-plugin-commonjs":"^8.2.6","rollup-plugin-copy":"^0.2.3","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-resolve":"0.0.1-predev.1","rollup-plugin-typescript2":"^0.8.2","rollup-plugin-uglify":"^2.0.1","shx":"^0.2.2","ts-jest":"^21.1.4","ts-loader":"^3.1.1","tslint":"^5.8.0","typescript":"^2.5.0"},"dependencies":{"@targomo/core":"^0.2.3","@types/leaflet":"^1.2.8","leaflet":"^1.3.1"}} | ||
{"name":"@targomo/leaflet","description":"Leaflet maps extensions for Targomo's time-based access mapping services.","author":"Targomo","version":"0.0.9","license":"MIT","repository":"github:targomo/targomo-js-extensions","homepage":"https://targomo.com/developers","bugs":{"url":"https://github.com/targomo/targomo-js-extensions/issues"},"keywords":["map","mapping","leaflet","leaflet-js","googlemaps","cartography","routing","visualization","gis","api","rest","isochrone","reachability","travel","travel-time","commute","commute-time"],"main":"targomo-leaflet.umd.min.js","module":"targomo-leaflet.umd.min.js","browser":"targomo-leaflet.umd.min.js","typings":"./typings/index.leaflet.d.ts","scripts":{"dev":"npm run clean && webpack --watch","build":"npm run clean && node build.js","lint":"tslint -p tsconfig.json","clean":"shx rm -rf dist","test":"npm run test:browser && npm run test:browser","test:browser":"jest --config=jest.config.json --env=jsdom","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --config=jest.config.json","test:coverage":"npm run test:browser --coverage"},"devDependencies":{"@types/fs-extra":"^5.0.4","@types/jest":"^21.1.5","@types/node":"^6.0.60","fs-extra":"^7.0.0","jest":"^21.2.1","rollup":"^0.51.8","rollup-plugin-commonjs":"^8.2.6","rollup-plugin-copy":"^0.2.3","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-resolve":"0.0.1-predev.1","rollup-plugin-typescript2":"^0.8.2","rollup-plugin-uglify":"^2.0.1","shx":"^0.2.2","ts-jest":"^21.1.4","ts-loader":"^3.1.1","tslint":"^5.8.0","typescript":"^2.5.0"},"dependencies":{"@targomo/core":"^0.2.3","@types/leaflet":"^1.2.8","leaflet":"^1.3.1"}} |
@@ -17,3 +17,3 @@ # targomo-js-leaflet | ||
The Targomo API is available in many regions. For all available endpoints, see our [availability map](http://targomo.com/developers/availability) | ||
The Targomo API is available in many regions. For all available endpoints, see our [availability map](https://targomo.com/developers/resources/coverage/) | ||
@@ -44,4 +44,4 @@ # Getting started | ||
More detailed overviews of Targomo's services, along with code examples and demos is available at [https://targomo.com/developers/languages/javascript/](https://targomo.com/developers/languages/javascript/). | ||
More detailed overviews of Targomo's services, along with code examples and demos is available at [https://targomo.com/developers/libraries/javascript/](https://targomo.com/developers/libraries/javascript/). | ||
Reference docs available [here](https://app.targomo.com/tsdocs/). |
/** | ||
* @targomo/js-extensions "0.0.7" http://targomo.com | ||
* @targomo/js-extensions "0.0.9" http://targomo.com | ||
* Google and Leaflet JavaScript (& TypeScript) extensions for Targomo's time-based access mapping services. | ||
* (c) 2019 Targomo | ||
* (c) 2020 Targomo | ||
*/ | ||
@@ -6,0 +6,0 @@ (function (global, factory) { |
/** | ||
* @targomo/js-extensions "0.0.7" http://targomo.com | ||
* @targomo/js-extensions "0.0.9" http://targomo.com | ||
* Google and Leaflet JavaScript (& TypeScript) extensions for Targomo's time-based access mapping services. | ||
* (c) 2019 Targomo | ||
* (c) 2020 Targomo | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("leaflet"),require("@targomo/core"),require("leaflet.vectorgrid/dist/Leaflet.VectorGrid.bundled.js")):"function"==typeof define&&define.amd?define(["exports","leaflet","@targomo/core","leaflet.vectorgrid/dist/Leaflet.VectorGrid.bundled.js"],e):e((t.tgm=t.tgm||{},t.tgm.leaflet={}),t.L,t.tgm)}(this,function(t,y,d){"use strict";var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var E=function(){return(E=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};function s(i,r,h,a){return new(h||(h=Promise))(function(t,e){function n(t){try{s(a.next(t))}catch(t){e(t)}}function o(t){try{s(a.throw(t))}catch(t){e(t)}}function s(e){e.done?t(e.value):new h(function(t){t(e.value)}).then(n,o)}s((a=a.apply(i,r||[])).next())})}function r(n,o){var s,i,r,t,h={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(s)throw new TypeError("Generator is already executing.");for(;h;)try{if(s=1,i&&(r=2&e[0]?i.return:e[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,e[1])).done)return r;switch(i=0,r&&(e=[2&e[0],r.value]),e[0]){case 0:case 1:r=e;break;case 4:return h.label++,{value:e[1],done:!1};case 5:h.label++,i=e[1],e=[0];continue;case 7:e=h.ops.pop(),h.trys.pop();continue;default:if(!(r=0<(r=h.trys).length&&r[r.length-1])&&(6===e[0]||2===e[0])){h=0;continue}if(3===e[0]&&(!r||e[1]>r[0]&&e[1]<r[3])){h.label=e[1];break}if(6===e[0]&&h.label<r[1]){h.label=r[1],r=e;break}if(r&&h.label<r[2]){h.label=r[2],h.ops.push(e);break}r[2]&&h.ops.pop(),h.trys.pop();continue}e=o.call(n,h)}catch(t){e=[6,t],i=0}finally{s=r=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var h,a,u=(h=.5/Math.PI,a=-.5/Math.PI,function(t,e,n){return void 0===n&&(n=1),{x:t=n*(h*t+.5),y:e=n*(a*e+.5)}});function b(t,e,n){return void 0===n&&(n=1),u(t/6378137,e/6378137,n)}var W=function(){function e(t){this.southWest=new T(1/0,1/0),this.northEast=new T(-1/0,-1/0),t&&(this.southWest=new T(t.southWest.x,t.southWest.y),this.northEast=new T(t.northEast.x,t.northEast.y))}return e.prototype.expandPoint=function(t,e){this.southWest.x=Math.min(this.southWest.x,t),this.northEast.x=Math.max(this.northEast.x,t),this.southWest.y=Math.min(this.southWest.y,e),this.northEast.y=Math.max(this.northEast.y,e)},e.prototype.expand=function(t){this.expandPoint(t.northEast.x,t.northEast.y),this.expandPoint(t.southWest.x,t.southWest.y)},e.prototype.modifyIntersect=function(t){return this.southWest.x=Math.max(this.southWest.x,t.southWest.x),this.northEast.x=Math.min(this.northEast.x,t.northEast.x),this.southWest.y=Math.max(this.southWest.y,t.southWest.y),this.northEast.y=Math.min(this.northEast.y,t.northEast.y),this},e.prototype.contains=function(t){return this.northEast.x>=t.northEast.x&&this.northEast.y>=t.northEast.y&&this.southWest.x<=t.southWest.x&&this.southWest.y<=t.southWest.y},e.prototype.intersects=function(t){return!(this.northEast.x<t.southWest.x||this.northEast.y<t.southWest.y||this.southWest.x>t.northEast.x||this.southWest.y>t.northEast.y)},e.prototype.growOutwardsFactor=function(t){void 0===t&&(t=1);var e=(this.northEast.x-this.southWest.x)*t,n=(this.northEast.y-this.southWest.y)*t;return this.northEast.x+=e,this.northEast.y+=n,this.southWest.x-=e,this.southWest.y-=n,this},e.prototype.growOutwardsAmount=function(t){return this.northEast.x+=t,this.northEast.y+=t,this.southWest.x-=t,this.southWest.y-=t,this},e.prototype.toLineString=function(){return[new T(this.southWest.x,this.northEast.y),new T(this.northEast.x,this.northEast.y),new T(this.northEast.x,this.southWest.y),new T(this.southWest.x,this.southWest.y)]},e.prototype.reproject=function(t){return new e({northEast:t(this.northEast.x,this.northEast.y),southWest:t(this.southWest.x,this.southWest.y)})},e.prototype.width=function(){return this.northEast.x-this.southWest.x},e.prototype.height=function(){return this.southWest.y-this.northEast.y},e.prototype.left=function(){return this.southWest.x},e.prototype.top=function(){return this.northEast.y},e}(),T=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.isCollinear=function(t,e,n){if(t.x==e.x&&t.y==e.y)return!1;if(t.x==this.x&&this.x==e.x)return!0;if(t.y==this.y&&this.y==e.y)return!0;var o=t.x*(this.y-e.y)+this.x*(e.y-t.y)+e.x*(t.y-this.y);return o<n&&-n<o&&t.x!=e.x&&t.y!=e.y},t.prototype.euclideanDistance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},t}(),l=function(t){var n=this;this.bounds3857=new W,this.points=t.map(function(t){n.bounds3857.expandPoint(t[0],t[1]);var e=b(t[0],t[1],1);return new T(e.x,e.y)})},c=function(){function t(t){var n=this;this.bounds3857=new W,this.travelTime=t.travelTime,this.area=t.area,this.lineStrings=[new l(t.outerBoundary)],this.bounds3857.expand(this.lineStrings[0].bounds3857),t.innerBoundary&&t.innerBoundary.forEach(function(t){var e=new l(t);n.lineStrings.push(e),n.bounds3857.expand(e.bounds3857)})}return t.prototype.getOuterBoundary=function(){return this.lineStrings[0]},t.prototype.getInnerBoundary=function(){return this.lineStrings.slice(1)},t}(),e=function(){function t(t){var n=this;this.polygons={},this.bounds3857=new W,t.forEach(function(t){t.polygons.forEach(function(t){var e=new c(t);n.polygons[e.travelTime]=n.polygons[e.travelTime]||[],n.polygons[e.travelTime].push(e),n.bounds3857.expand(e.bounds3857)})})}return t.prototype.forEach=function(n){var o=this;Object.keys(this.polygons).map(function(t){return+t}).sort(function(t,e){return e-t}).forEach(function(t,e){return n(+t,o.polygons[t],e)})},t}();var n={};["#006837","#39B54A","#8CC63F","#F7931E","#F15A24","#C1272D"].forEach(function(t,e){n[300*(e+1)]=t});var p=function(){this.inverse=!1,this.colors=n,this.opacity=.5,this.strokeWidth=5},f=function(n){function t(t){var e=n.call(this)||this;return Object.assign(e,t),e}return i(t,n),t.prototype.getColorOpacity=function(t,e){var n,o=null;return o=this.colors instanceof Array?this.colors[e]:this.colors[t],(n=o)&&null!=n.color?{color:o.color||"#ccc",opacity:o.opacity||1}:{color:o||"#ccc",opacity:1}},t}(p),L=0;function m(h,t,s,e,a){var n,o=b(t.southWest.x,t.southWest.y,s),i=b(t.northEast.x,t.northEast.y,s);i.y<o.y&&(n=[o.y,i.y],i.y=n[0],o.y=n[1]);var r=Math.floor(o.x),u=Math.floor(o.y),l=Math.ceil(i.x),c=Math.ceil(i.y),p=new W(h).reproject(b).toLineString();function y(o,t){return(t=function(t,e){var i,r,h,a,n=function(t){return(r.x-i.x)*(t.y-i.y)>(r.y-i.y)*(t.x-i.x)},o=function(){var t=new T(i.x-r.x,i.y-r.y),e=new T(h.x-a.x,h.y-a.y),n=i.x*r.y-i.y*r.x,o=h.x*a.y-h.y*a.x,s=1/(t.x*e.y-t.y*e.x);return new T((n*e.x-o*t.x)*s,(n*e.y-o*t.y)*s)},s=t;for(var u in i=e[e.length-1],e){r=e[u];var l=s;for(var c in s=[],h=l[l.length-1],l)n(a=l[c])?(n(h)||s.push(o()),s.push(a)):n(h)&&s.push(o()),h=a;i=r}return s}(t,p)).forEach(function(t,e){var n=(0<e?"L":"M")+" "+(Math.round(t.x*s)-r)+" "+(Math.round(t.y*s)-u);o.push(n)}),0<o.length&&o.push("z"),o}var d=[];e.forEach(function(t,e,n){var o,s,i=e.map(function(t){return(e=t,n=[],h.intersects(e.bounds3857)&&(y(n,e.getOuterBoundary().points),e.getInnerBoundary().forEach(function(t){h.intersects(t.bounds3857)&&y(n,t.points)})),n).join(" ");var e,n}).join(" ");if(0!=i.length){var r=a.getColorOpacity(t,n);d.push((o=i,"\n <g style='opacity: "+(s=E({},r,{strokeWidth:a.strokeWidth,color:a.inverse?"black":r.color})).opacity+"'>\n <path style='stroke: "+s.color+";\n fill: "+s.color+";\n stroke-opacity: "+s.opacity+";\n stroke-width: "+s.strokeWidth+";\n fill-opacity: "+s.opacity+"'\n\n d='"+o+"'/>\n </g>\n "))}});var f,m,g,v,x=Math.ceil(Math.abs(l-r)),w=Math.ceil(Math.abs(c-u));return{content:a.inverse?(g="tgm:inverse:"+L++,'\n <svg height="100%" width="100%" viewbox="0 0 '+(f=x)+" "+(m=w)+"\"\n style='opacity: 1; stroke-linejoin:round; stroke-linecap:round; fill-rule: evenodd'\n xmlns='http://www.w3.org/2000/svg'>\n <path style='mask: url(#mask_"+g+")' d='"+(v="M 0 0 L "+f+" 0 L "+f+" "+m+" L 0 "+m+" z")+"'/>\n \n <defs>\n <mask id='mask_"+g+"'>\n <path style='fill-opacity:1; stroke: white; fill:white;' d='"+v+"'/>\"\n "+d.join("\n")+"\n </mask>\n </defs>\n \n </svg>"):'\n <svg height="100%" width="100%" viewbox="0 0 '+x+" "+w+"\"\n style='opacity: 1; stroke-linejoin:round; stroke-linecap:round; fill-rule: evenodd'\n xmlns='http://www.w3.org/2000/svg'>\n "+d.join("\n")+"\n </svg>",width:x,height:w}}var g=function(){function t(t,e){void 0===t&&(t=200),void 0===e&&(e=700),this.min=t,this.max=e}return t.prototype.schedule=function(t){var e=this,n=function(){clearTimeout(e.longTimeout),clearTimeout(e.shortTimeout),e.longTimeout=null,e.shortTimeout=null,t()};this.longTimeout||(this.longTimeout=setTimeout(n,this.max)),clearTimeout(this.shortTimeout),this.shortTimeout=setTimeout(n,this.min)},t.prototype.scheduleMaximum=function(t){var e=this;this.longTimeout||(this.longTimeout=setTimeout(function(){clearTimeout(e.longTimeout),e.longTimeout=null,t()},this.max)),clearTimeout(this.shortTimeout)},t}(),v=function(){function t(t,e){this.plugin=t,this.options=e,this.renderTimeout=new g(300,3e3)}return t.prototype.getElement=function(){return this.divElement},t.prototype.draw=function(t){var e=this;if(void 0===t&&(t=!1),t)this.resize(),this.render(),this.divElement.style.transform=null;else{if(this.divElement&&this.bounds){var n=new W(this.plugin.getElementPixels(this.bounds)),o=this.divElement,s=Math.round(n.left()-this.currentPixelBounds.left()),i=Math.round(n.top()-this.currentPixelBounds.top()),r=n.width()/this.currentPixelBounds.width(),h=n.height()/this.currentPixelBounds.height();1!==h||1!==r?o.style.transform="translate3d("+s+"px, "+i+"px, 0) scale3d("+r+", "+h+", 1)":0===s&&0===i||(o.style.transform="translate3d("+s+"px, "+i+"px, 0)")}this.renderTimeout.scheduleMaximum(function(){e.render(),e.divElement.style.transform=null})}},t.prototype.resize=function(){if(this.divElement&&this.bounds){var t=this.currentPixelBounds=new W(this.plugin.getElementPixels(this.bounds)),e=this.divElement;e.style.left=t.left()+"px",e.style.top=t.top()+"px",e.style.width=t.width()+"px",e.style.height=t.height()+"px",e.style.transform=null}},t.prototype.initElement=function(){var t=document.createElement("div");return t.style.borderStyle="none",t.style.borderWidth="0px",t.style.position="absolute",t.style.opacity=""+this.options.opacity||"0.5",t.style["backface-visibility"]="hidden",t.style.perspective=1e3,t.style["transform-origin"]="0 0 0",t.style["will-change"]="transform",this.divElement=t,this.divElement},t.prototype.onRemove=function(){this.divElement.parentNode.removeChild(this.divElement),this.divElement=null},t.prototype.setData=function(t){this.model=t?new e(t):null,this.render()},t.prototype.setInverse=function(t){this.options.inverse=t,this.render()},t.prototype.setColors=function(t){this.options.colors=t,this.render()},t.prototype.setOpacity=function(t){this.options.opacity=t,this.divElement&&(this.divElement.style.opacity=""+this.options.opacity||"0.5")},t.prototype.setStrokeWidth=function(t){this.options.strokeWidth=t,this.render()},t.prototype.boundsCalculation=function(t){var e=this.model,n=this.options.inverse,o=new W(this.plugin.getViewPort()),s=new W(o),i=new W(s).growOutwardsFactor(t).modifyIntersect(e.bounds3857);n&&(i.expand(o),i.growOutwardsFactor(t)),s.growOutwardsFactor(t);var r=d.geometry.webMercatorToLatLng(o.southWest,void 0),h=d.geometry.webMercatorToLatLng(o.northEast,void 0),a=this.plugin.getElementPixels({southWest:r,northEast:h}),u=Math.abs((o.northEast.x-o.southWest.x)/a.northEast.x-a.southWest.x);return i.growOutwardsAmount(this.options&&u*this.options.strokeWidth||0),{bounds:s,newBounds:i}},t.prototype.render=function(t){if(void 0===t&&(t=!0),this.divElement)if(this.model){var e=this.plugin.getZoom(),n=256*Math.pow(2,e);n=Math.min(1e7,n);var o=this.boundsCalculation(.1),s=o.bounds,i=o.newBounds,r=m(s,i,n,this.model,new f(this.options)).content;this.divElement.innerHTML=r;var h=d.geometry.webMercatorToLatLng(i.southWest,void 0),a=d.geometry.webMercatorToLatLng(i.northEast,void 0);this.bounds={southWest:h,northEast:a},t&&this.resize()}else this.divElement.innerHTML=""},t}(),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(p),w=function(n){function t(t){var e=n.call(this)||this;return e.readyPromise=new Promise(function(t){return e.readyResolve=t}),e.options=Object.assign(new x,t||{}),e}return i(t,n),t.prototype.setData=function(e){return s(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.readyPromise];case 1:return t.sent(),this.element&&this.element.setData(e),[2]}})})},t.prototype.draw=function(){this.element&&(y.DomUtil.setTransform(this.element.getElement(),new y.Point(0,0),null),this.element.draw(!0))},t.prototype.onAdd=function(l){var c=this;this.element=new v({getZoom:function(){return l.getZoom()},getViewPort:function(){var t=l.getBounds();return new W({northEast:d.geometry.latLngToWebMercator({lng:t.getNorthEast().lng,lat:t.getNorthEast().lat}),southWest:d.geometry.latLngToWebMercator({lng:t.getSouthWest().lng,lat:t.getSouthWest().lat})})},getElementPixels:function(t){return{northEast:l.latLngToLayerPoint(t.northEast),southWest:l.latLngToLayerPoint(t.southWest)}}},this.options);var p=this.element.initElement();return p.style.transformOrigin="center",y.DomUtil.addClass(p,"leaflet-zoom-animated"),l.getPanes().overlayPane.appendChild(p),l.on("moveend",this.draw,this),l.on("resize",this.draw,this),l.on("zoomend",this.draw,this),this._map.options.zoomAnimation&&y.Browser.any3d&&l.on("zoomanim",function(t){if(c.element.bounds){var e=l.getZoomScale(t.zoom,l.getZoom()),n=l._latLngToNewLayerPoint(c.element.bounds.southWest,t.zoom,t.center).round(),o=l._latLngToNewLayerPoint(c.element.bounds.northEast,t.zoom,t.center).round(),s=l._latLngToNewLayerPoint(c.element.bounds.southWest,l.getZoom(),l.getCenter()).round(),i=l._latLngToNewLayerPoint(c.element.bounds.northEast,l.getZoom(),l.getCenter()).round(),r=(n.x+o.x)/2,h=(n.y+o.y)/2,a=(s.x+i.x)/2,u=(s.y+i.y)/2;y.DomUtil.setTransform(p,new y.Point(r-a,h-u),e)}}),this.readyResolve(),this.draw(),this},t.prototype.onRemove=function(){return this.element&&(this.element.onRemove(),this.element=null),this},t.prototype.setInverse=function(t){this.options.inverse=t,this.draw()},t.prototype.setColors=function(t){this.options.colors=t,this.draw()},t.prototype.setOpacity=function(t){(this.options.opacity=t,this.element)&&(this.element.getElement().style.opacity=null!=this.options.opacity?""+this.options.opacity:"0.5")},t.prototype.setStrokeWidth=function(t){this.options.strokeWidth=t,this.draw()},t}(y.Layer),M=function(s){function o(t,e,n){if(!e&&!t.basemaps.basemapsLookup[e])throw new Error("valid style name required to access Targomo basemap");var o="https://maps.targomo.com/styles/"+t.basemaps.basemapsLookup[e]+"/rendered/{z}/{x}/{y}.png?key="+t.serviceKey;return s.call(this,o,n)||this}return i(o,s),o.getTileLayerList=function(e){var n={};return e.basemaps.basemapNames.forEach(function(t){n[t]=new o(e,t,{})}),n},o}(y.TileLayer),P=function(){function t(t,e,n,o){this.tgmClient=t,this.update(n,o,e)}return t.prototype.addTo=function(e){return s(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return this.layer?[3,2]:[4,this.createLayer()];case 1:t.sent(),t.label=2;case 2:return this.map=e,this.layer.addTo(e),[2]}})})},t.prototype.update=function(t,e,n){return t&&(this.multigraphOptions=t),e&&(this.vectorTileoptions=e),n&&(this.sources=n),this.createLayer()},t.prototype.createLayer=function(){return s(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return this.map&&this.layer&&this.map.removeLayer(this.layer),[4,this.tgmClient.multigraph.getTiledMultigraphUrl(this.sources,this.multigraphOptions,"mvt")];case 1:return e=t.sent(),this.layer=y.vectorGrid.protobuf(e,this.vectorTileoptions),this.map&&this.layer&&this.layer.addTo(this.map),[2]}})})},t}();t.LeafletPolygonOverlayOptions=x,t.TgmLeafletPolygonOverlay=w,t.TgmLeafletTileLayer=M,t.TgmLeafletMultigraphTileLayer=P,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=targomo-leaflet.umd.min.js.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
643585