leaflet-tilelayer-swiss
Advanced tools
Comparing version 2.2.0 to 2.2.1
/*! | ||
* Leaflet.TileLayer.Swiss v2.2.0 | ||
* Leaflet.TileLayer.Swiss v2.2.1 | ||
* Plugin for displaying Swiss map tiles | ||
@@ -7,3 +7,3 @@ * © Roman Karavia | MIT License | ||
*/ | ||
"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var L$1=_interopDefault(require("leaflet")),lv03="EPSG:21781",lv95="EPSG:2056";void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)});var t=1e-12;function n(t){if(!Array.isArray(t))throw new Error("Expected input to be an array.");if(t.length<2)throw new Error("Expected input to be an array with length >= 2, got "+t.length+".");if(t.some((function(t){return!Number.isFinite(t)})))throw new Error("Expected all coordinates to be finite numbers.")}function r(t,n,a){return(a/60+n)/60+t}function o(t){return 180*t/Math.PI}function M(t){return t*Math.PI/180}function s(t,n){return{apply:function(a){var o=a[0],r=a[1],e=a.slice(2);return[o+t,r+n].concat(e)},unapply:function(a){var o=a[0],r=a[1],e=a.slice(2);return[o-t,r-n].concat(e)}}}var u=s(6e5,2e5),c=u.apply,p=u.unapply,l=s(26e5,12e5),v=l.apply,w=l.unapply,b=674.374,I=15.056,P=405.346;function m(n,a){var r=1/a,e=2*r-Math.pow(r,2);return{fromCartesian:function(a){for(var r,i,s,h=a[0],u=a[1],c=a[2],l=Math.atan(u/h),M=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),p=Math.atan(c/((1-e)*M));!(Math.abs(i-r)<t);)r=i,i=n/Math.sqrt(1-e*Math.pow(Math.sin(p),2)),s=M/Math.cos(p)-i,p=Math.atan(c/((1-e*i/(i+s))*M));var f=o(p);return[o(l),f,s]},toCartesian:function(t){var a=t[0],o=t[2];void 0===o&&(o=0);var r=M(t[1]),i=M(a),s=n/Math.sqrt(1-e*Math.pow(Math.sin(r),2));return[(s+o)*Math.cos(r)*Math.cos(i),(s+o)*Math.cos(r)*Math.sin(i),(s*(1-e)+o)*Math.sin(r)]}}}var d=m(6377397.155,299.15281285),x=d.fromCartesian,q=d.toCartesian,C=m(6378137,298.257223563),E=C.fromCartesian,F=C.toCartesian,N=1/299.15281285,A=M(r(46,57,8.66)),k=M(r(7,26,22.5)),z=2*N-Math.pow(N,2),B=6377397.155*Math.sqrt(1-z)/(1-z*Math.pow(Math.sin(A),2)),D=Math.sqrt(1+z/(1-z)*Math.pow(Math.cos(A),4)),G=Math.asin(Math.sin(A)/D),H=Math.sqrt(z),J=Math.log(Math.tan(Math.PI/4+G/2))-D*Math.log(Math.tan(Math.PI/4+A/2))+D*H/2*Math.log((1+H*Math.sin(A))/(1-H*Math.sin(A)));function K(t){var n,a,o,r,e,i,s,h,u,c=[(n=F(t))[0]-b,n[1]-I,n[2]-P],l=x(c),p=(a=l[0],o=M(l[1]),r=M(a),e=D*Math.log(Math.tan(Math.PI/4+o/2))-D*H/2*Math.log((1+H*Math.sin(o))/(1-H*Math.sin(o)))+J,i=2*(Math.atan(Math.exp(e))-Math.PI/4),s=D*(r-k),h=Math.asin(Math.cos(G)*Math.sin(i)-Math.sin(G)*Math.cos(i)*Math.cos(s)),u=Math.atan(Math.sin(s)/(Math.sin(G)*Math.tan(i)+Math.cos(G)*Math.cos(s))),[B*u,B/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))]);return t.length>2?p.concat([l[2]]):p}function L(n){var a=function(a){for(var r,e,i=n[0],s=2*(Math.atan(Math.exp(n[1]/B))-Math.PI/4),h=i/B,u=Math.asin(Math.cos(G)*Math.sin(s)+Math.sin(G)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.cos(G)*Math.cos(h)-Math.sin(G)*Math.tan(s))),l=k+c/D,M=u;!(Math.abs(e-r)<t);)r=e,e=(Math.log(Math.tan(Math.PI/4+u/2))-J)/D+H*Math.log(Math.tan(Math.PI/4+Math.asin(H*Math.sin(M))/2)),M=2*Math.atan(Math.exp(e))-Math.PI/2;var p=o(M);return[o(l),p]}();a.push(n[2]);var r,e=[(r=q(a))[0]+b,r[1]+I,r[2]+P],i=E(e);return n.length>2?i:i.slice(0,2)}var O={project:function(t){return n(t),c(K(t))},unproject:function(t){return n(t),L(p(t))}};function Q(t){return n(t),v(K(t))}function R(t){return n(t),L(w(t))}var S={project:Q,unproject:R},LV03_BOUNDS=L$1.bounds([42e4,3e4],[9e5,35e4]),LV95_BOUNDS=L$1.bounds([242e4,103e4],[29e5,135e4]);function leafletProjection(t,n){return{bounds:n,project:function(n){var a=n.lng,o=n.lat,r=t.project([a,o]),e=r[0],i=r[1];return L$1.point(e,i)},unproject:function(n){var a=n.x,o=n.y,r=t.unproject([a,o]),e=r[0],i=r[1];return L$1.latLng(i,e)}}}var lv03$1=leafletProjection(O,LV03_BOUNDS),lv95$1=leafletProjection(S,LV95_BOUNDS),RESOLUTIONS=[4e3,3750,3500,3250,3e3,2750,2500,2250,2e3,1750,1500,1250,1e3,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,.5,.25,.1];function fromZoom(t){if(t<0)return RESOLUTIONS[0];if(t>RESOLUTIONS.length-1)return RESOLUTIONS[RESOLUTIONS.length-1];var n=Math.floor(t);if(n===t)return RESOLUTIONS[t];var a=RESOLUTIONS[n],o=RESOLUTIONS[n+1]/a;return a*Math.pow(o,t-n)}function toZoom(t){for(var n=-1,a=0;a<RESOLUTIONS.length;a+=1)if(t>=RESOLUTIONS[a]){n=a;break}if(0===n)return 0;if(-1===n)return RESOLUTIONS.length-1;if(RESOLUTIONS[n]===t)return n;var o=RESOLUTIONS[n-1],r=RESOLUTIONS[n];return n+Math.log(r/t)/Math.log(o/r)}var CRS=L$1.Class.extend({includes:L$1.CRS,initialize:function(t){this.code=t.code,this.projection=t.projection;var n=this.projection.bounds.getBottomLeft();this.transformation=new L$1.Transformation(1,-n.x,-1,n.y),this.infinite=!1},scale:function(t){return 1/fromZoom(t)},zoom:function(t){return toZoom(1/t)},distance:function(t,n){var a=this.project(t),o=this.project(n);return a.distanceTo(o)}}),lv03$2=new CRS({code:lv03,projection:lv03$1}),lv95$2=new CRS({code:lv95,projection:lv95$1}),tileBounds=L$1.latLngBounds(lv95$2.unproject(lv95$2.projection.bounds.min),lv95$2.unproject(lv95$2.projection.bounds.max)),switzerlandBounds=L$1.latLngBounds(lv95$2.unproject(L$1.point(2485e3,1075e3)),lv95$2.unproject(L$1.point(2835e3,1295e3))),urlsByCrs={};urlsByCrs[lv03]="https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/21781/{z}/{y}/{x}.{format}",urlsByCrs[lv95]="https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/2056/{z}/{x}/{y}.{format}";var SwissLayer=L$1.TileLayer.extend({options:{attribution:'© <a href="https://www.swisstopo.ch/" target="_blank">Swisstopo</a>',bounds:tileBounds,crs:lv95$2,format:"jpeg",layer:"ch.swisstopo.pixelkarte-farbe",minZoom:14,maxNativeZoom:27,maxZoom:28,subdomains:"0123456789",timestamp:"current"},initialize:function(t){L$1.setOptions(this,t);var n=this.options.url||urlsByCrs[this.options.crs.code];L$1.TileLayer.prototype.initialize.call(this,n,this.options)}});L$1.CRS.EPSG21781=lv03$2,L$1.CRS.EPSG2056=lv95$2,L$1.TileLayer.Swiss=SwissLayer,L$1.tileLayer.swiss=function(t){return new SwissLayer(t)},L$1.Map.addInitHook((function(){this.options.maxBounds||this.options.crs!==lv03$2&&this.options.crs!==lv95$2||this.setMaxBounds(tileBounds)})),L$1.Map.include({fitSwitzerland:function(){this.fitBounds(switzerlandBounds)}}),module.exports=SwissLayer; | ||
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=t(require("leaflet"));function n(t){if(!Array.isArray(t))throw new Error("Expected input to be an array.");if(t.length<2)throw new Error("Expected input to be an array with length >= 2, got "+t.length+".");if(t.some((function(t){return!Number.isFinite(t)})))throw new Error("Expected all coordinates to be finite numbers.")}function e(t,a,n){return(n/60+a)/60+t}function o(t){return 180*t/Math.PI}function r(t){return t*Math.PI/180}function i(t,a){return{apply:function(n){var e=n[0],o=n[1],r=n.slice(2);return[e+t,o+a].concat(r)},unapply:function(n){var e=n[0],o=n[1],r=n.slice(2);return[e-t,o-a].concat(r)}}}void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)});var s=i(6e5,2e5),h=s.apply,u=s.unapply,c=i(26e5,12e5),M=c.apply,l=c.unapply;function f(t,a){var n=1/a,e=2*n-Math.pow(n,2);return{fromCartesian:function(a){var n,r,i,s,h,u=a[0],c=a[1],M=a[2],l=Math.atan(c/u),f=Math.sqrt(Math.pow(u,2)+Math.pow(c,2)),p=Math.atan(M/((1-e)*f));do{n=r,i=s,s=t/Math.sqrt(1-e*Math.pow(Math.sin(p),2)),h=f/Math.cos(p)-s,p=Math.atan(M/((1-e*s/(s+h))*f)),r=Math.abs(s-i)}while(isNaN(n)||r<n);var d=o(p);return[o(l),d,h]},toCartesian:function(a){var n=a[0],o=a[2],i=void 0===o?0:o,s=r(a[1]),h=r(n),u=t/Math.sqrt(1-e*Math.pow(Math.sin(s),2));return[(u+i)*Math.cos(s)*Math.cos(h),(u+i)*Math.cos(s)*Math.sin(h),(u*(1-e)+i)*Math.sin(s)]}}}var p=f(6377397.155,299.15281285),d=p.fromCartesian,m=p.toCartesian,w=f(6378137,298.257223563),v=w.fromCartesian,g=w.toCartesian,y=1/299.15281285,b=r(e(46,57,8.66)),j=r(e(7,26,22.5)),x=2*y-Math.pow(y,2),P=6377397.155*Math.sqrt(1-x)/(1-x*Math.pow(Math.sin(b),2)),E=Math.sqrt(1+x/(1-x)*Math.pow(Math.cos(b),4)),S=Math.asin(Math.sin(b)/E),I=Math.sqrt(x),C=Math.log(Math.tan(Math.PI/4+S/2))-E*Math.log(Math.tan(Math.PI/4+b/2))+E*I/2*Math.log((1+I*Math.sin(b))/(1-I*Math.sin(b)));function _(t){var a,n=[(a=g(t))[0]-674.374,a[1]-15.056,a[2]-405.346],e=d(n),o=function(t){var a=t[0],n=r(t[1]),e=r(a),o=E*Math.log(Math.tan(Math.PI/4+n/2))-E*I/2*Math.log((1+I*Math.sin(n))/(1-I*Math.sin(n)))+C,i=2*(Math.atan(Math.exp(o))-Math.PI/4),s=E*(e-j),h=Math.asin(Math.cos(S)*Math.sin(i)-Math.sin(S)*Math.cos(i)*Math.cos(s)),u=Math.atan(Math.sin(s)/(Math.sin(S)*Math.tan(i)+Math.cos(S)*Math.cos(s)));return[P*u,P/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))]}(e);return t.length>2?[].concat(o,[e[2]]):o}function L(t){var a=function(t){var a,n,e,r,i=t[0],s=2*(Math.atan(Math.exp(t[1]/P))-Math.PI/4),h=i/P,u=Math.asin(Math.cos(S)*Math.sin(s)+Math.sin(S)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.cos(S)*Math.cos(h)-Math.sin(S)*Math.tan(s))),M=j+c/E,l=u;do{a=n,e=r,r=(Math.log(Math.tan(Math.PI/4+u/2))-C)/E+I*Math.log(Math.tan(Math.PI/4+Math.asin(I*Math.sin(l))/2)),l=2*Math.atan(Math.exp(r))-Math.PI/2,n=Math.abs(r-e)}while(isNaN(a)||n<a);var f=o(l);return[o(M),f]}(t);a.push(t[2]);var n,e=[(n=m(a))[0]+674.374,n[1]+15.056,n[2]+405.346],r=v(e);return t.length>2?r:r.slice(0,2)}var N={__proto__:null,project:function(t){return n(t),h(_(t))},unproject:function(t){return n(t),L(u(t))}};var q={__proto__:null,project:function(t){return n(t),M(_(t))},unproject:function(t){return n(t),L(l(t))}},z=a.default.bounds([42e4,3e4],[9e5,35e4]),B=a.default.bounds([242e4,103e4],[29e5,135e4]);function G(t,n){return{bounds:n,project:function(n){var e=n.lng,o=n.lat,r=t.project([e,o]),i=r[0],s=r[1];return a.default.point(i,s)},unproject:function(n){var e=n.x,o=n.y,r=t.unproject([e,o]),i=r[0],s=r[1];return a.default.latLng(s,i)}}}var T=G(N,z),k=G(q,B),F=[4e3,3750,3500,3250,3e3,2750,2500,2250,2e3,1750,1500,1250,1e3,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,.5,.25,.1];var R=a.default.Class.extend({includes:a.default.CRS,initialize:function(t){this.code=t.code,this.projection=t.projection;var n=this.projection.bounds.getBottomLeft();this.transformation=new a.default.Transformation(1,-n.x,-1,n.y),this.infinite=!1},scale:function(t){return 1/function(t){if(t<0)return F[0];if(t>F.length-1)return F[F.length-1];var a=Math.floor(t);if(a===t)return F[t];var n=F[a],e=F[a+1]/n;return n*Math.pow(e,t-a)}(t)},zoom:function(t){return function(t){for(var a=-1,n=0;n<F.length;n+=1)if(t>=F[n]){a=n;break}if(0===a)return 0;if(-1===a)return F.length-1;if(F[a]===t)return a;var e=F[a-1],o=F[a];return a+Math.log(o/t)/Math.log(e/o)}(1/t)},distance:function(t,a){var n=this.project(t),e=this.project(a);return n.distanceTo(e)}}),Z=new R({code:"EPSG:21781",projection:T}),A=new R({code:"EPSG:2056",projection:k}),H=a.default.latLngBounds(A.unproject(A.projection.bounds.min),A.unproject(A.projection.bounds.max)),O=a.default.latLngBounds(A.unproject(a.default.point(2485e3,1075e3)),A.unproject(a.default.point(2835e3,1295e3))),D={"EPSG:21781":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/21781/{z}/{y}/{x}.{format}","EPSG:2056":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/2056/{z}/{x}/{y}.{format}"},J=a.default.TileLayer.extend({options:{attribution:'© <a href="https://www.swisstopo.ch/" target="_blank">Swisstopo</a>',bounds:H,crs:A,format:"jpeg",layer:"ch.swisstopo.pixelkarte-farbe",minZoom:14,maxNativeZoom:27,maxZoom:28,subdomains:"0123456789",timestamp:"current"},initialize:function(t){a.default.setOptions(this,t);var n=this.options.url||D[this.options.crs.code];a.default.TileLayer.prototype.initialize.call(this,n,this.options)}});a.default.CRS.EPSG21781=Z,a.default.CRS.EPSG2056=A,a.default.TileLayer.Swiss=J,a.default.tileLayer.swiss=function(t){return new J(t)},a.default.Map.addInitHook((function(){this.options.maxBounds||this.options.crs!==Z&&this.options.crs!==A||this.setMaxBounds(H)})),a.default.Map.include({fitSwitzerland:function(){this.fitBounds(O)}}),module.exports=J; | ||
//# sourceMappingURL=Leaflet.TileLayer.Swiss.cjs.js.map |
/*! | ||
* Leaflet.TileLayer.Swiss v2.2.0 | ||
* Leaflet.TileLayer.Swiss v2.2.1 | ||
* Plugin for displaying Swiss map tiles | ||
@@ -7,3 +7,3 @@ * © Roman Karavia | MIT License | ||
*/ | ||
import t from"leaflet";void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)});var n=1e-12;function a(t){if(!Array.isArray(t))throw new Error("Expected input to be an array.");if(t.length<2)throw new Error("Expected input to be an array with length >= 2, got "+t.length+".");if(t.some((function(t){return!Number.isFinite(t)})))throw new Error("Expected all coordinates to be finite numbers.")}function o(t,n,a){return(a/60+n)/60+t}function r(t){return 180*t/Math.PI}function e(t){return t*Math.PI/180}function i(t,n){return{apply:function(a){var o=a[0],r=a[1],e=a.slice(2);return[o+t,r+n].concat(e)},unapply:function(a){var o=a[0],r=a[1],e=a.slice(2);return[o-t,r-n].concat(e)}}}var s=i(6e5,2e5),h=s.apply,u=s.unapply,c=i(26e5,12e5),M=c.apply,p=c.unapply,f=674.374,l=15.056,d=405.346;function m(t,a){var o=1/a,i=2*o-Math.pow(o,2);return{fromCartesian:function(a){for(var o,e,s,h=a[0],u=a[1],c=a[2],M=Math.atan(u/h),p=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),f=Math.atan(c/((1-i)*p));!(Math.abs(e-o)<n);)o=e,e=t/Math.sqrt(1-i*Math.pow(Math.sin(f),2)),s=p/Math.cos(f)-e,f=Math.atan(c/((1-i*e/(e+s))*p));var l=r(f);return[r(M),l,s]},toCartesian:function(n){var a=n[0],o=n[2];void 0===o&&(o=0);var r=e(n[1]),s=e(a),h=t/Math.sqrt(1-i*Math.pow(Math.sin(r),2));return[(h+o)*Math.cos(r)*Math.cos(s),(h+o)*Math.cos(r)*Math.sin(s),(h*(1-i)+o)*Math.sin(r)]}}}var v=m(6377397.155,299.15281285),w=v.fromCartesian,g=v.toCartesian,y=m(6378137,298.257223563),b=y.fromCartesian,j=y.toCartesian,x=1/299.15281285,P=e(o(46,57,8.66)),E=e(o(7,26,22.5)),S=2*x-Math.pow(x,2),I=6377397.155*Math.sqrt(1-S)/(1-S*Math.pow(Math.sin(P),2)),C=Math.sqrt(1+S/(1-S)*Math.pow(Math.cos(P),4)),L=Math.asin(Math.sin(P)/C),z=Math.sqrt(S),q=Math.log(Math.tan(Math.PI/4+L/2))-C*Math.log(Math.tan(Math.PI/4+P/2))+C*z/2*Math.log((1+z*Math.sin(P))/(1-z*Math.sin(P)));function B(t){var n,a,o,r,i,s,h,u,c,M=[(n=j(t))[0]-f,n[1]-l,n[2]-d],p=w(M),m=(a=p[0],o=e(p[1]),r=e(a),i=C*Math.log(Math.tan(Math.PI/4+o/2))-C*z/2*Math.log((1+z*Math.sin(o))/(1-z*Math.sin(o)))+q,s=2*(Math.atan(Math.exp(i))-Math.PI/4),h=C*(r-E),u=Math.asin(Math.cos(L)*Math.sin(s)-Math.sin(L)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.sin(L)*Math.tan(s)+Math.cos(L)*Math.cos(h))),[I*c,I/2*Math.log((1+Math.sin(u))/(1-Math.sin(u)))]);return t.length>2?m.concat([p[2]]):m}function G(t){var a=function(a){for(var o,e,i=t[0],s=2*(Math.atan(Math.exp(t[1]/I))-Math.PI/4),h=i/I,u=Math.asin(Math.cos(L)*Math.sin(s)+Math.sin(L)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.cos(L)*Math.cos(h)-Math.sin(L)*Math.tan(s))),M=E+c/C,p=u;!(Math.abs(e-o)<n);)o=e,e=(Math.log(Math.tan(Math.PI/4+u/2))-q)/C+z*Math.log(Math.tan(Math.PI/4+Math.asin(z*Math.sin(p))/2)),p=2*Math.atan(Math.exp(e))-Math.PI/2;var f=r(p);return[r(M),f]}();a.push(t[2]);var o,e=[(o=g(a))[0]+f,o[1]+l,o[2]+d],i=b(e);return t.length>2?i:i.slice(0,2)}var T={project:function(t){return a(t),h(B(t))},unproject:function(t){return a(t),G(u(t))}};var k={project:function(t){return a(t),M(B(t))},unproject:function(t){return a(t),G(p(t))}},F=t.bounds([42e4,3e4],[9e5,35e4]),N=t.bounds([242e4,103e4],[29e5,135e4]);function R(n,a){return{bounds:a,project:function(a){var o=a.lng,r=a.lat,e=n.project([o,r]),i=e[0],s=e[1];return t.point(i,s)},unproject:function(a){var o=a.x,r=a.y,e=n.unproject([o,r]),i=e[0],s=e[1];return t.latLng(s,i)}}}var Z=R(T,F),A=R(k,N),H=[4e3,3750,3500,3250,3e3,2750,2500,2250,2e3,1750,1500,1250,1e3,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,.5,.25,.1];var O=t.Class.extend({includes:t.CRS,initialize:function(n){this.code=n.code,this.projection=n.projection;var a=this.projection.bounds.getBottomLeft();this.transformation=new t.Transformation(1,-a.x,-1,a.y),this.infinite=!1},scale:function(t){return 1/function(t){if(t<0)return H[0];if(t>H.length-1)return H[H.length-1];var n=Math.floor(t);if(n===t)return H[t];var a=H[n],o=H[n+1]/a;return a*Math.pow(o,t-n)}(t)},zoom:function(t){return function(t){for(var n=-1,a=0;a<H.length;a+=1)if(t>=H[a]){n=a;break}if(0===n)return 0;if(-1===n)return H.length-1;if(H[n]===t)return n;var o=H[n-1],r=H[n];return n+Math.log(r/t)/Math.log(o/r)}(1/t)},distance:function(t,n){var a=this.project(t),o=this.project(n);return a.distanceTo(o)}}),_=new O({code:"EPSG:21781",projection:Z}),D=new O({code:"EPSG:2056",projection:A}),J=t.latLngBounds(D.unproject(D.projection.bounds.min),D.unproject(D.projection.bounds.max)),K=t.latLngBounds(D.unproject(t.point(2485e3,1075e3)),D.unproject(t.point(2835e3,1295e3))),Q={"EPSG:21781":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/21781/{z}/{y}/{x}.{format}","EPSG:2056":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/2056/{z}/{x}/{y}.{format}"},U=t.TileLayer.extend({options:{attribution:'© <a href="https://www.swisstopo.ch/" target="_blank">Swisstopo</a>',bounds:J,crs:D,format:"jpeg",layer:"ch.swisstopo.pixelkarte-farbe",minZoom:14,maxNativeZoom:27,maxZoom:28,subdomains:"0123456789",timestamp:"current"},initialize:function(n){t.setOptions(this,n);var a=this.options.url||Q[this.options.crs.code];t.TileLayer.prototype.initialize.call(this,a,this.options)}});t.CRS.EPSG21781=_,t.CRS.EPSG2056=D,t.TileLayer.Swiss=U,t.tileLayer.swiss=function(t){return new U(t)},t.Map.addInitHook((function(){this.options.maxBounds||this.options.crs!==_&&this.options.crs!==D||this.setMaxBounds(J)})),t.Map.include({fitSwitzerland:function(){this.fitBounds(K)}});export default U; | ||
import t from"leaflet";function n(t){if(!Array.isArray(t))throw new Error("Expected input to be an array.");if(t.length<2)throw new Error("Expected input to be an array with length >= 2, got "+t.length+".");if(t.some((function(t){return!Number.isFinite(t)})))throw new Error("Expected all coordinates to be finite numbers.")}function a(t,n,a){return(a/60+n)/60+t}function o(t){return 180*t/Math.PI}function r(t){return t*Math.PI/180}function i(t,n){return{apply:function(a){var o=a[0],r=a[1],i=a.slice(2);return[o+t,r+n].concat(i)},unapply:function(a){var o=a[0],r=a[1],i=a.slice(2);return[o-t,r-n].concat(i)}}}void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)});var e=i(6e5,2e5),s=e.apply,h=e.unapply,u=i(26e5,12e5),c=u.apply,M=u.unapply;function p(t,n){var a=1/n,i=2*a-Math.pow(a,2);return{fromCartesian:function(n){var a,r,e,s,h,u=n[0],c=n[1],M=n[2],p=Math.atan(c/u),l=Math.sqrt(Math.pow(u,2)+Math.pow(c,2)),f=Math.atan(M/((1-i)*l));do{a=r,e=s,s=t/Math.sqrt(1-i*Math.pow(Math.sin(f),2)),h=l/Math.cos(f)-s,f=Math.atan(M/((1-i*s/(s+h))*l)),r=Math.abs(s-e)}while(isNaN(a)||r<a);var d=o(f);return[o(p),d,h]},toCartesian:function(n){var a=n[0],o=n[2],e=void 0===o?0:o,s=r(n[1]),h=r(a),u=t/Math.sqrt(1-i*Math.pow(Math.sin(s),2));return[(u+e)*Math.cos(s)*Math.cos(h),(u+e)*Math.cos(s)*Math.sin(h),(u*(1-i)+e)*Math.sin(s)]}}}var l=p(6377397.155,299.15281285),f=l.fromCartesian,d=l.toCartesian,m=p(6378137,298.257223563),w=m.fromCartesian,v=m.toCartesian,g=1/299.15281285,y=r(a(46,57,8.66)),b=r(a(7,26,22.5)),j=2*g-Math.pow(g,2),x=6377397.155*Math.sqrt(1-j)/(1-j*Math.pow(Math.sin(y),2)),P=Math.sqrt(1+j/(1-j)*Math.pow(Math.cos(y),4)),E=Math.asin(Math.sin(y)/P),S=Math.sqrt(j),I=Math.log(Math.tan(Math.PI/4+E/2))-P*Math.log(Math.tan(Math.PI/4+y/2))+P*S/2*Math.log((1+S*Math.sin(y))/(1-S*Math.sin(y)));function C(t){var n,a=[(n=v(t))[0]-674.374,n[1]-15.056,n[2]-405.346],o=f(a),i=function(t){var n=t[0],a=r(t[1]),o=r(n),i=P*Math.log(Math.tan(Math.PI/4+a/2))-P*S/2*Math.log((1+S*Math.sin(a))/(1-S*Math.sin(a)))+I,e=2*(Math.atan(Math.exp(i))-Math.PI/4),s=P*(o-b),h=Math.asin(Math.cos(E)*Math.sin(e)-Math.sin(E)*Math.cos(e)*Math.cos(s)),u=Math.atan(Math.sin(s)/(Math.sin(E)*Math.tan(e)+Math.cos(E)*Math.cos(s)));return[x*u,x/2*Math.log((1+Math.sin(h))/(1-Math.sin(h)))]}(o);return t.length>2?[].concat(i,[o[2]]):i}function _(t){var n=function(t){var n,a,r,i,e=t[0],s=2*(Math.atan(Math.exp(t[1]/x))-Math.PI/4),h=e/x,u=Math.asin(Math.cos(E)*Math.sin(s)+Math.sin(E)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.cos(E)*Math.cos(h)-Math.sin(E)*Math.tan(s))),M=b+c/P,p=u;do{n=a,r=i,i=(Math.log(Math.tan(Math.PI/4+u/2))-I)/P+S*Math.log(Math.tan(Math.PI/4+Math.asin(S*Math.sin(p))/2)),p=2*Math.atan(Math.exp(i))-Math.PI/2,a=Math.abs(i-r)}while(isNaN(n)||a<n);var l=o(p);return[o(M),l]}(t);n.push(t[2]);var a,r=[(a=d(n))[0]+674.374,a[1]+15.056,a[2]+405.346],i=w(r);return t.length>2?i:i.slice(0,2)}var L={__proto__:null,project:function(t){return n(t),s(C(t))},unproject:function(t){return n(t),_(h(t))}};var N={__proto__:null,project:function(t){return n(t),c(C(t))},unproject:function(t){return n(t),_(M(t))}},z=t.bounds([42e4,3e4],[9e5,35e4]),q=t.bounds([242e4,103e4],[29e5,135e4]);function B(n,a){return{bounds:a,project:function(a){var o=a.lng,r=a.lat,i=n.project([o,r]),e=i[0],s=i[1];return t.point(e,s)},unproject:function(a){var o=a.x,r=a.y,i=n.unproject([o,r]),e=i[0],s=i[1];return t.latLng(s,e)}}}var G=B(L,z),T=B(N,q),k=[4e3,3750,3500,3250,3e3,2750,2500,2250,2e3,1750,1500,1250,1e3,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,.5,.25,.1];var F=t.Class.extend({includes:t.CRS,initialize:function(n){this.code=n.code,this.projection=n.projection;var a=this.projection.bounds.getBottomLeft();this.transformation=new t.Transformation(1,-a.x,-1,a.y),this.infinite=!1},scale:function(t){return 1/function(t){if(t<0)return k[0];if(t>k.length-1)return k[k.length-1];var n=Math.floor(t);if(n===t)return k[t];var a=k[n],o=k[n+1]/a;return a*Math.pow(o,t-n)}(t)},zoom:function(t){return function(t){for(var n=-1,a=0;a<k.length;a+=1)if(t>=k[a]){n=a;break}if(0===n)return 0;if(-1===n)return k.length-1;if(k[n]===t)return n;var o=k[n-1],r=k[n];return n+Math.log(r/t)/Math.log(o/r)}(1/t)},distance:function(t,n){var a=this.project(t),o=this.project(n);return a.distanceTo(o)}}),R=new F({code:"EPSG:21781",projection:G}),Z=new F({code:"EPSG:2056",projection:T}),A=t.latLngBounds(Z.unproject(Z.projection.bounds.min),Z.unproject(Z.projection.bounds.max)),H=t.latLngBounds(Z.unproject(t.point(2485e3,1075e3)),Z.unproject(t.point(2835e3,1295e3))),O={"EPSG:21781":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/21781/{z}/{y}/{x}.{format}","EPSG:2056":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/2056/{z}/{x}/{y}.{format}"},D=t.TileLayer.extend({options:{attribution:'© <a href="https://www.swisstopo.ch/" target="_blank">Swisstopo</a>',bounds:A,crs:Z,format:"jpeg",layer:"ch.swisstopo.pixelkarte-farbe",minZoom:14,maxNativeZoom:27,maxZoom:28,subdomains:"0123456789",timestamp:"current"},initialize:function(n){t.setOptions(this,n);var a=this.options.url||O[this.options.crs.code];t.TileLayer.prototype.initialize.call(this,a,this.options)}});t.CRS.EPSG21781=R,t.CRS.EPSG2056=Z,t.TileLayer.Swiss=D,t.tileLayer.swiss=function(t){return new D(t)},t.Map.addInitHook((function(){this.options.maxBounds||this.options.crs!==R&&this.options.crs!==Z||this.setMaxBounds(A)})),t.Map.include({fitSwitzerland:function(){this.fitBounds(H)}});export default D; | ||
//# sourceMappingURL=Leaflet.TileLayer.Swiss.esm.js.map |
/*! | ||
* Leaflet.TileLayer.Swiss v2.2.0 | ||
* Leaflet.TileLayer.Swiss v2.2.1 | ||
* Plugin for displaying Swiss map tiles | ||
@@ -7,3 +7,3 @@ * © Roman Karavia | MIT License | ||
*/ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],n):((t=t||self).L=t.L||{},t.L.TileLayer=t.L.TileLayer||{},t.L.TileLayer.Swiss=n(t.L))}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)});var n=1e-12;function a(t){if(!Array.isArray(t))throw new Error("Expected input to be an array.");if(t.length<2)throw new Error("Expected input to be an array with length >= 2, got "+t.length+".");if(t.some((function(t){return!Number.isFinite(t)})))throw new Error("Expected all coordinates to be finite numbers.")}function e(t,n,a){return(a/60+n)/60+t}function o(t){return 180*t/Math.PI}function r(t){return t*Math.PI/180}function i(t,n){return{apply:function(a){var e=a[0],o=a[1],r=a.slice(2);return[e+t,o+n].concat(r)},unapply:function(a){var e=a[0],o=a[1],r=a.slice(2);return[e-t,o-n].concat(r)}}}var s=i(6e5,2e5),h=s.apply,u=s.unapply,c=i(26e5,12e5),M=c.apply,p=c.unapply,f=674.374,l=15.056,d=405.346;function m(t,a){var e=1/a,i=2*e-Math.pow(e,2);return{fromCartesian:function(a){for(var e,r,s,h=a[0],u=a[1],c=a[2],M=Math.atan(u/h),p=Math.sqrt(Math.pow(h,2)+Math.pow(u,2)),f=Math.atan(c/((1-i)*p));!(Math.abs(r-e)<n);)e=r,r=t/Math.sqrt(1-i*Math.pow(Math.sin(f),2)),s=p/Math.cos(f)-r,f=Math.atan(c/((1-i*r/(r+s))*p));var l=o(f);return[o(M),l,s]},toCartesian:function(n){var a=n[0],e=n[2];void 0===e&&(e=0);var o=r(n[1]),s=r(a),h=t/Math.sqrt(1-i*Math.pow(Math.sin(o),2));return[(h+e)*Math.cos(o)*Math.cos(s),(h+e)*Math.cos(o)*Math.sin(s),(h*(1-i)+e)*Math.sin(o)]}}}var w=m(6377397.155,299.15281285),v=w.fromCartesian,y=w.toCartesian,g=m(6378137,298.257223563),b=g.fromCartesian,j=g.toCartesian,x=1/299.15281285,L=r(e(46,57,8.66)),P=r(e(7,26,22.5)),S=2*x-Math.pow(x,2),E=6377397.155*Math.sqrt(1-S)/(1-S*Math.pow(Math.sin(L),2)),I=Math.sqrt(1+S/(1-S)*Math.pow(Math.cos(L),4)),C=Math.asin(Math.sin(L)/I),T=Math.sqrt(S),q=Math.log(Math.tan(Math.PI/4+C/2))-I*Math.log(Math.tan(Math.PI/4+L/2))+I*T/2*Math.log((1+T*Math.sin(L))/(1-T*Math.sin(L)));function z(t){var n,a,e,o,i,s,h,u,c,M=[(n=j(t))[0]-f,n[1]-l,n[2]-d],p=v(M),m=(a=p[0],e=r(p[1]),o=r(a),i=I*Math.log(Math.tan(Math.PI/4+e/2))-I*T/2*Math.log((1+T*Math.sin(e))/(1-T*Math.sin(e)))+q,s=2*(Math.atan(Math.exp(i))-Math.PI/4),h=I*(o-P),u=Math.asin(Math.cos(C)*Math.sin(s)-Math.sin(C)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.sin(C)*Math.tan(s)+Math.cos(C)*Math.cos(h))),[E*c,E/2*Math.log((1+Math.sin(u))/(1-Math.sin(u)))]);return t.length>2?m.concat([p[2]]):m}function B(t){var a=function(a){for(var e,r,i=t[0],s=2*(Math.atan(Math.exp(t[1]/E))-Math.PI/4),h=i/E,u=Math.asin(Math.cos(C)*Math.sin(s)+Math.sin(C)*Math.cos(s)*Math.cos(h)),c=Math.atan(Math.sin(h)/(Math.cos(C)*Math.cos(h)-Math.sin(C)*Math.tan(s))),M=P+c/I,p=u;!(Math.abs(r-e)<n);)e=r,r=(Math.log(Math.tan(Math.PI/4+u/2))-q)/I+T*Math.log(Math.tan(Math.PI/4+Math.asin(T*Math.sin(p))/2)),p=2*Math.atan(Math.exp(r))-Math.PI/2;var f=o(p);return[o(M),f]}();a.push(t[2]);var e,r=[(e=y(a))[0]+f,e[1]+l,e[2]+d],i=b(r);return t.length>2?i:i.slice(0,2)}var G={project:function(t){return a(t),h(z(t))},unproject:function(t){return a(t),B(u(t))}};var k={project:function(t){return a(t),M(z(t))},unproject:function(t){return a(t),B(p(t))}},F=t.bounds([42e4,3e4],[9e5,35e4]),N=t.bounds([242e4,103e4],[29e5,135e4]);function R(n,a){return{bounds:a,project:function(a){var e=a.lng,o=a.lat,r=n.project([e,o]),i=r[0],s=r[1];return t.point(i,s)},unproject:function(a){var e=a.x,o=a.y,r=n.unproject([e,o]),i=r[0],s=r[1];return t.latLng(s,i)}}}var Z=R(G,F),A=R(k,N),O=[4e3,3750,3500,3250,3e3,2750,2500,2250,2e3,1750,1500,1250,1e3,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,.5,.25,.1];var H=t.Class.extend({includes:t.CRS,initialize:function(n){this.code=n.code,this.projection=n.projection;var a=this.projection.bounds.getBottomLeft();this.transformation=new t.Transformation(1,-a.x,-1,a.y),this.infinite=!1},scale:function(t){return 1/function(t){if(t<0)return O[0];if(t>O.length-1)return O[O.length-1];var n=Math.floor(t);if(n===t)return O[t];var a=O[n],e=O[n+1]/a;return a*Math.pow(e,t-n)}(t)},zoom:function(t){return function(t){for(var n=-1,a=0;a<O.length;a+=1)if(t>=O[a]){n=a;break}if(0===n)return 0;if(-1===n)return O.length-1;if(O[n]===t)return n;var e=O[n-1],o=O[n];return n+Math.log(o/t)/Math.log(e/o)}(1/t)},distance:function(t,n){var a=this.project(t),e=this.project(n);return a.distanceTo(e)}}),_=new H({code:"EPSG:21781",projection:Z}),D=new H({code:"EPSG:2056",projection:A}),J=t.latLngBounds(D.unproject(D.projection.bounds.min),D.unproject(D.projection.bounds.max)),K=t.latLngBounds(D.unproject(t.point(2485e3,1075e3)),D.unproject(t.point(2835e3,1295e3))),Q={"EPSG:21781":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/21781/{z}/{y}/{x}.{format}","EPSG:2056":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/2056/{z}/{x}/{y}.{format}"},U=t.TileLayer.extend({options:{attribution:'© <a href="https://www.swisstopo.ch/" target="_blank">Swisstopo</a>',bounds:J,crs:D,format:"jpeg",layer:"ch.swisstopo.pixelkarte-farbe",minZoom:14,maxNativeZoom:27,maxZoom:28,subdomains:"0123456789",timestamp:"current"},initialize:function(n){t.setOptions(this,n);var a=this.options.url||Q[this.options.crs.code];t.TileLayer.prototype.initialize.call(this,a,this.options)}});return t.CRS.EPSG21781=_,t.CRS.EPSG2056=D,t.TileLayer.Swiss=U,t.tileLayer.swiss=function(t){return new U(t)},t.Map.addInitHook((function(){this.options.maxBounds||this.options.crs!==_&&this.options.crs!==D||this.setMaxBounds(J)})),t.Map.include({fitSwitzerland:function(){this.fitBounds(K)}}),U})); | ||
!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("leaflet")):"function"==typeof define&&define.amd?define(["leaflet"],a):((t="undefined"!=typeof globalThis?globalThis:t||self).L=t.L||{},t.L.TileLayer=t.L.TileLayer||{},t.L.TileLayer.Swiss=a(t.L))}(this,(function(t){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=a(t),e="EPSG:21781",o="EPSG:2056";function r(t){if(!Array.isArray(t))throw new Error("Expected input to be an array.");if(t.length<2)throw new Error("Expected input to be an array with length >= 2, got "+t.length+".");if(t.some((function(t){return!Number.isFinite(t)})))throw new Error("Expected all coordinates to be finite numbers.")}function i(t,a,n){return(n/60+a)/60+t}function s(t){return 180*t/Math.PI}function u(t){return t*Math.PI/180}function h(t,a){return{apply:function(n){var e=n[0],o=n[1],r=n.slice(2);return[e+t,o+a].concat(r)},unapply:function(n){var e=n[0],o=n[1],r=n.slice(2);return[e-t,o-a].concat(r)}}}void 0===Number.isFinite&&(Number.isFinite=function(t){return"number"==typeof t&&isFinite(t)});var c=h(6e5,2e5),f=c.apply,l=c.unapply,M=h(26e5,12e5),p=M.apply,d=M.unapply;function m(t,a){var n=1/a,e=2*n-Math.pow(n,2);return{fromCartesian:function(a){var n,o,r,i,u,h=a[0],c=a[1],f=a[2],l=Math.atan(c/h),M=Math.sqrt(Math.pow(h,2)+Math.pow(c,2)),p=Math.atan(f/((1-e)*M));do{n=o,r=i,i=t/Math.sqrt(1-e*Math.pow(Math.sin(p),2)),u=M/Math.cos(p)-i,p=Math.atan(f/((1-e*i/(i+u))*M)),o=Math.abs(i-r)}while(isNaN(n)||o<n);var d=s(p);return[s(l),d,u]},toCartesian:function(a){var n=a[0],o=a[2],r=void 0===o?0:o,i=u(a[1]),s=u(n),h=t/Math.sqrt(1-e*Math.pow(Math.sin(i),2));return[(h+r)*Math.cos(i)*Math.cos(s),(h+r)*Math.cos(i)*Math.sin(s),(h*(1-e)+r)*Math.sin(i)]}}}var w=m(6377397.155,299.15281285),g=w.fromCartesian,v=w.toCartesian,y=m(6378137,298.257223563),b=y.fromCartesian,j=y.toCartesian,x=1/299.15281285,L=u(i(46,57,8.66)),P=u(i(7,26,22.5)),S=2*x-Math.pow(x,2),E=6377397.155*Math.sqrt(1-S)/(1-S*Math.pow(Math.sin(L),2)),I=Math.sqrt(1+S/(1-S)*Math.pow(Math.cos(L),4)),C=Math.asin(Math.sin(L)/I),T=Math.sqrt(S),_=Math.log(Math.tan(Math.PI/4+C/2))-I*Math.log(Math.tan(Math.PI/4+L/2))+I*T/2*Math.log((1+T*Math.sin(L))/(1-T*Math.sin(L)));function N(t){var a,n=[(a=j(t))[0]-674.374,a[1]-15.056,a[2]-405.346],e=g(n),o=function(t){var a=t[0],n=u(t[1]),e=u(a),o=I*Math.log(Math.tan(Math.PI/4+n/2))-I*T/2*Math.log((1+T*Math.sin(n))/(1-T*Math.sin(n)))+_,r=2*(Math.atan(Math.exp(o))-Math.PI/4),i=I*(e-P),s=Math.asin(Math.cos(C)*Math.sin(r)-Math.sin(C)*Math.cos(r)*Math.cos(i)),h=Math.atan(Math.sin(i)/(Math.sin(C)*Math.tan(r)+Math.cos(C)*Math.cos(i)));return[E*h,E/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))]}(e);return t.length>2?[].concat(o,[e[2]]):o}function q(t){var a=function(t){var a,n,e,o,r=t[0],i=2*(Math.atan(Math.exp(t[1]/E))-Math.PI/4),u=r/E,h=Math.asin(Math.cos(C)*Math.sin(i)+Math.sin(C)*Math.cos(i)*Math.cos(u)),c=Math.atan(Math.sin(u)/(Math.cos(C)*Math.cos(u)-Math.sin(C)*Math.tan(i))),f=P+c/I,l=h;do{a=n,e=o,o=(Math.log(Math.tan(Math.PI/4+h/2))-_)/I+T*Math.log(Math.tan(Math.PI/4+Math.asin(T*Math.sin(l))/2)),l=2*Math.atan(Math.exp(o))-Math.PI/2,n=Math.abs(o-e)}while(isNaN(a)||n<a);var M=s(l);return[s(f),M]}(t);a.push(t[2]);var n,e=[(n=v(a))[0]+674.374,n[1]+15.056,n[2]+405.346],o=b(e);return t.length>2?o:o.slice(0,2)}var z={__proto__:null,project:function(t){return r(t),f(N(t))},unproject:function(t){return r(t),q(l(t))}};var B={__proto__:null,project:function(t){return r(t),p(N(t))},unproject:function(t){return r(t),q(d(t))}},G=n.default.bounds([42e4,3e4],[9e5,35e4]),k=n.default.bounds([242e4,103e4],[29e5,135e4]);function F(t,a){return{bounds:a,project:function(a){var e=a.lng,o=a.lat,r=t.project([e,o]),i=r[0],s=r[1];return n.default.point(i,s)},unproject:function(a){var e=a.x,o=a.y,r=t.unproject([e,o]),i=r[0],s=r[1];return n.default.latLng(s,i)}}}var R=F(z,G),Z=F(B,k),A=[4e3,3750,3500,3250,3e3,2750,2500,2250,2e3,1750,1500,1250,1e3,750,650,500,250,100,50,20,10,5,2.5,2,1.5,1,.5,.25,.1];var H=n.default.Class.extend({includes:n.default.CRS,initialize:function(t){this.code=t.code,this.projection=t.projection;var a=this.projection.bounds.getBottomLeft();this.transformation=new n.default.Transformation(1,-a.x,-1,a.y),this.infinite=!1},scale:function(t){return 1/function(t){if(t<0)return A[0];if(t>A.length-1)return A[A.length-1];var a=Math.floor(t);if(a===t)return A[t];var n=A[a],e=A[a+1]/n;return n*Math.pow(e,t-a)}(t)},zoom:function(t){return function(t){for(var a=-1,n=0;n<A.length;n+=1)if(t>=A[n]){a=n;break}if(0===a)return 0;if(-1===a)return A.length-1;if(A[a]===t)return a;var e=A[a-1],o=A[a];return a+Math.log(o/t)/Math.log(e/o)}(1/t)},distance:function(t,a){var n=this.project(t),e=this.project(a);return n.distanceTo(e)}}),O=new H({code:e,projection:R}),D=new H({code:o,projection:Z}),J=n.default.latLngBounds(D.unproject(D.projection.bounds.min),D.unproject(D.projection.bounds.max)),K=n.default.latLngBounds(D.unproject(n.default.point(2485e3,1075e3)),D.unproject(n.default.point(2835e3,1295e3))),Q={"EPSG:21781":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/21781/{z}/{y}/{x}.{format}","EPSG:2056":"https://wmts{s}.geo.admin.ch/1.0.0/{layer}/default/{timestamp}/2056/{z}/{x}/{y}.{format}"},U=n.default.TileLayer.extend({options:{attribution:'© <a href="https://www.swisstopo.ch/" target="_blank">Swisstopo</a>',bounds:J,crs:D,format:"jpeg",layer:"ch.swisstopo.pixelkarte-farbe",minZoom:14,maxNativeZoom:27,maxZoom:28,subdomains:"0123456789",timestamp:"current"},initialize:function(t){n.default.setOptions(this,t);var a=this.options.url||Q[this.options.crs.code];n.default.TileLayer.prototype.initialize.call(this,a,this.options)}});return n.default.CRS.EPSG21781=O,n.default.CRS.EPSG2056=D,n.default.TileLayer.Swiss=U,n.default.tileLayer.swiss=function(t){return new U(t)},n.default.Map.addInitHook((function(){this.options.maxBounds||this.options.crs!==O&&this.options.crs!==D||this.setMaxBounds(J)})),n.default.Map.include({fitSwitzerland:function(){this.fitBounds(K)}}),U})); | ||
//# sourceMappingURL=Leaflet.TileLayer.Swiss.umd.js.map |
{ | ||
"name": "leaflet-tilelayer-swiss", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Leaflet.TileLayer.Swiss is a Leaflet plugin for displaying national maps of Switzerland using map tiles from Swisstopo.", | ||
@@ -28,23 +28,23 @@ "source": "src/index.js", | ||
"peerDependencies": { | ||
"leaflet": "^1.6.0" | ||
"leaflet": "^1.7.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.7.5", | ||
"@babel/preset-env": "^7.7.6", | ||
"babel-jest": "^24.9.0", | ||
"eslint": "^6.7.2", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-plugin-jest": "^23.1.1", | ||
"jest": "^24.9.0", | ||
"leaflet": "^1.6.0", | ||
"rollup": "^1.27.12", | ||
"@babel/core": "^7.13.8", | ||
"@babel/preset-env": "^7.13.8", | ||
"babel-jest": "^26.6.3", | ||
"eslint": "^7.21.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.1.5", | ||
"jest": "^26.6.3", | ||
"leaflet": "^1.7.1", | ||
"rollup": "^2.40.0", | ||
"rollup-plugin-buble": "^0.19.8", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-livereload": "^1.0.4", | ||
"rollup-plugin-livereload": "^2.0.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-serve": "^1.0.1", | ||
"rollup-plugin-terser": "^5.1.3", | ||
"swissgrid": "^1.0.3" | ||
"rollup-plugin-serve": "^1.1.0", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"swissgrid": "^1.0.5" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
116796
422