xy-cesium3 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-cesium3",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "雄越cesium3",
5
5
  "main": "xy-cesium3.umd.js",
6
6
  "scripts": {
package/xy-cesium3.es.js CHANGED
@@ -2697,6 +2697,7 @@ const addPrimitivePoint = (viewer2, option) => {
2697
2697
  let labelStyle = opt.text || {};
2698
2698
  let data = opt.data || [];
2699
2699
  let props = opt.props || {};
2700
+ const show2 = opt.show === void 0 ? true : opt.show;
2700
2701
  const billboards = viewer2.scene.primitives.add(new Cesium.BillboardCollection({ scene: viewer2.scene }));
2701
2702
  const labels = viewer2.scene.primitives.add(new Cesium.LabelCollection({ scene: viewer2.scene }));
2702
2703
  data.forEach((item) => {
@@ -2705,6 +2706,7 @@ const addPrimitivePoint = (viewer2, option) => {
2705
2706
  Object.assign(
2706
2707
  {
2707
2708
  id: Object.assign({ layerId: opt.id }, item),
2709
+ show: show2,
2708
2710
  position: Cesium.Cartesian3.fromDegrees(item[props.lgtd], item[props.lttd], item[props.height] || 0),
2709
2711
  image: item.image || billboardStyle.image,
2710
2712
  horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
@@ -2720,6 +2722,7 @@ const addPrimitivePoint = (viewer2, option) => {
2720
2722
  Object.assign(
2721
2723
  {
2722
2724
  id: Object.assign({ layerId: opt.id + "_text" }, item),
2725
+ show: show2,
2723
2726
  position: Cesium.Cartesian3.fromDegrees(item[props.lgtd], item[props.lttd], item[props.height] || 0),
2724
2727
  text: item[props.name],
2725
2728
  font: "12px Helvetica",
@@ -2744,6 +2747,7 @@ const addFlashPoint = (viewer2, option) => {
2744
2747
  let pointStyle = Object.assign({}, defaultOptions$8.point, option.point);
2745
2748
  let data = opt.data || [];
2746
2749
  let props = opt.props || {};
2750
+ const show2 = opt.show === void 0 ? true : opt.show;
2747
2751
  let dataSource = new Cesium.CustomDataSource(opt.id);
2748
2752
  viewer2.dataSources.add(dataSource);
2749
2753
  data.forEach((item) => {
@@ -2751,12 +2755,12 @@ const addFlashPoint = (viewer2, option) => {
2751
2755
  item.size = pointStyle.size;
2752
2756
  var entity = new Cesium.Entity({
2753
2757
  name: item.id,
2754
- show: true,
2758
+ show: show2,
2755
2759
  position: Cesium.Cartesian3.fromDegrees(item[props.lgtd], item[props.lttd], item[props.height] || 0),
2756
2760
  point: Object.assign(
2757
2761
  {
2758
2762
  show: true,
2759
- color: Cesium.Color.RED.withAlpha(0.7),
2763
+ color: item.color || Cesium.Color.RED.withAlpha(0.7),
2760
2764
  pixelSize: new Cesium.CallbackProperty(() => {
2761
2765
  item.size = item.size + pointStyle.speed;
2762
2766
  if (item.size >= pointStyle.maxSize) {
@@ -6240,11 +6244,13 @@ const addPrimitiveLine = (viewer2, option) => {
6240
6244
  opt.text || {};
6241
6245
  let data = opt.data || [];
6242
6246
  let props = opt.props || {};
6247
+ const show2 = opt.show === void 0 ? true : opt.show;
6243
6248
  let instanceList = [];
6244
6249
  data.forEach((item) => {
6245
6250
  let lglt = item[props.lglt].flat();
6246
6251
  instanceList.push(new Cesium.GeometryInstance({
6247
6252
  id: Object.assign({ layerId: opt.id }, item),
6253
+ show: show2,
6248
6254
  geometry: new Cesium.GroundPolylineGeometry({
6249
6255
  positions: Cesium.Cartesian3.fromDegreesArray(lglt),
6250
6256
  width: lineStyle.width || 5
package/xy-cesium3.umd.js CHANGED
@@ -2,4 +2,4 @@
2
2
  /* @preserve
3
3
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
4
4
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
5
- */!function(t,e){!function(t){var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return"_leaflet_id"in t||(t._leaflet_id=++r),t._leaflet_id}function a(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function l(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function h(){return!1}function u(t,e){if(!1===e)return t;var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return c(t).split(/\s+/)}function m(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function p(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var f=/\{ *([\w_ -]+) *\}/g;function _(t,e){return t.replace(f,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function C(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var x=0;function w(t){var e=+new Date,i=Math.max(0,16-(e-x));return x=e+i,window.setTimeout(t,i)}var b=window.requestAnimationFrame||C("RequestAnimationFrame")||w,S=window.cancelAnimationFrame||C("CancelAnimationFrame")||C("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function T(t,e,i){if(!i||b!==w)return b.call(window,o(t,e));t.call(e)}function P(t){t&&S.call(window,t)}var M={__proto__:null,extend:i,create:n,bind:o,get lastId(){return r},stamp:s,throttle:a,wrapNum:l,falseFn:h,formatNum:u,trim:c,splitWords:d,setOptions:m,getParamString:p,template:_,isArray:g,indexOf:v,emptyImageUrl:y,requestFn:b,cancelFn:S,requestAnimFrame:T,cancelAnimFrame:P};function E(){}function A(t){if("undefined"!=typeof L&&L&&L.Mixin){t=g(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}E.extend=function(t){var e=function(){m(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=n(o);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&i(e,t.statics),t.includes&&(A(t.includes),i.apply(null,[r].concat(t.includes))),i(r,t),delete r.statics,delete r.includes,r.options&&(r.options=o.options?n(o.options):{},i(r.options,t.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},E.include=function(t){var e=this.prototype.options;return i(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},E.mergeOptions=function(t){return i(this.prototype.options,t),this},E.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=d(t);for(var o=1===arguments.length,r=0,s=t.length;r<s;r++)o?this._off(t[r]):this._off(t[r],e,i)}else delete this._events;return this},_on:function(t,e,i,n){if("function"==typeof e){if(!1===this._listens(t,e,i)){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}}else console.warn("wrong listener type: "+typeof e)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(1!==arguments.length)if("function"==typeof e){var s=this._listens(t,e,i);if(!1!==s){var a=n[s];this._firingCount&&(a.fn=h,this._events[t]=n=n.slice()),n.splice(s,1)}}else console.warn("wrong listener type: "+typeof e);else{if(this._firingCount)for(o=0,r=n.length;o<r;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,n){if(!this.listens(t,n))return this;var o=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s],h=l.fn;l.once&&this.off(t,h,l.ctx),h.call(l.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e;"function"!=typeof e&&(n=!!e,o=void 0,i=void 0);var r=this._events&&this._events[t];if(r&&r.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var s in this._eventParents)if(this._eventParents[s].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,r=n.length;o<r;o++)if(n[o].fn===e&&n[o].ctx===i)return o;return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var z=E.extend(O);function k(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof k?t:g(t)?new k(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,e,i)}function D(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof D?t:new D(t,e)}function F(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function N(t,e){return t instanceof F?t:new F(t,e)}function Z(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function H(t,e,i){return t instanceof Z?t:g(t)&&"object"!=typeof t[0]?3===t.length?new Z(t[0],t[1],t[2]):2===t.length?new Z(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new Z(t,e,i)}k.prototype={clone:function(){return new k(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new k(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new k(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},D.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof k||"number"==typeof t[0]||"x"in t)e=i=B(t);else if(e=(t=R(t)).min,i=t.max,!e||!i)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone()),this},getCenter:function(t){return B((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return B(this.min.x,this.max.y)},getTopRight:function(){return B(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof k?B(t):R(t))instanceof D?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>=e.x&&n.x<=i.x,s=o.y>=e.y&&n.y<=i.y;return r&&s},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>e.x&&n.x<i.x,s=o.y>e.y&&n.y<i.y;return r&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return R(B(e.x-n,e.y-o),B(i.x+n,i.y+o))},equals:function(t){return!!t&&(t=R(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},F.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof Z)e=t,i=t;else{if(!(t instanceof F))return t?this.extend(H(t)||N(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new Z(e.lat,e.lng),this._northEast=new Z(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new F(new Z(e.lat-n,e.lng-o),new Z(i.lat+n,i.lng+o))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof Z||"lat"in t?H(t):N(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof F?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=N(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&n.lat<=i.lat,s=o.lng>=e.lng&&n.lng<=i.lng;return r&&s},overlaps:function(t){t=N(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&n.lat<i.lat,s=o.lng>e.lng&&n.lng<i.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=N(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},Z.prototype={equals:function(t,e){return!!t&&(t=H(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+u(this.lat,t)+", "+u(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,H(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return N([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};var j,W={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new D(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new Z(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new F(new Z(r.lat-n,r.lng-o),new Z(s.lat-n,s.lng-o))}},V=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),U=6378137,G={R:U,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new k(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(j=U*Math.PI,new D([-j,-j],[j,j]))};function Y(t,e,i,n){if(g(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function X(t,e,i,n){return new Y(t,e,i,n)}Y.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new k((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var q,K=i({},V,{code:"EPSG:3857",projection:G,transformation:(q=.5/(Math.PI*G.R),X(q,.5,-q,.5))}),J=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $(t,e){var i,n,o,r,s,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(s=t[i]).length;n<r;n++)l+=(n?"L":"M")+(a=s[n]).x+" "+a.y;l+=e?Nt.svg?"z":"x":""}return l||"M0 0"}var tt,et=document.documentElement.style,it="ActiveXObject"in window,nt=it&&!document.addEventListener,ot="msLaunchUri"in navigator&&!("documentMode"in document),rt=Ft("webkit"),st=Ft("android"),at=Ft("android 2")||Ft("android 3"),lt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ht=st&&Ft("Google")&&lt<537&&!("AudioNode"in window),ut=!!window.opera,ct=!ot&&Ft("chrome"),dt=Ft("gecko")&&!rt&&!ut&&!it,mt=!ct&&Ft("safari"),pt=Ft("phantom"),ft="OTransition"in et,_t=0===navigator.platform.indexOf("Win"),gt=it&&"transition"in et,vt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!at,yt="MozPerspective"in et,Ct=!window.L_DISABLE_3D&&(gt||vt||yt)&&!ft&&!pt,xt="undefined"!=typeof orientation||Ft("mobile"),wt=xt&&rt,bt=xt&&vt,St=!window.PointerEvent&&window.MSPointerEvent,Tt=!(!window.PointerEvent&&!St),Pt="ontouchstart"in window||!!window.TouchEvent,Lt=!window.L_NO_TOUCH&&(Pt||Tt),Mt=xt&&ut,Et=xt&&dt,At=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),zt=!!document.createElement("canvas").getContext,kt=!(!document.createElementNS||!Q("svg").createSVGRect),It=!!kt&&((tt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(tt.firstChild&&tt.firstChild.namespaceURI)),Bt=!kt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}(),Dt=0===navigator.platform.indexOf("Mac"),Rt=0===navigator.platform.indexOf("Linux");function Ft(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Nt={ie:it,ielt9:nt,edge:ot,webkit:rt,android:st,android23:at,androidStock:ht,opera:ut,chrome:ct,gecko:dt,safari:mt,phantom:pt,opera12:ft,win:_t,ie3d:gt,webkit3d:vt,gecko3d:yt,any3d:Ct,mobile:xt,mobileWebkit:wt,mobileWebkit3d:bt,msPointer:St,pointer:Tt,touch:Lt,touchNative:Pt,mobileOpera:Mt,mobileGecko:Et,retina:At,passiveEvents:Ot,canvas:zt,svg:kt,vml:Bt,inlineSvg:It,mac:Dt,linux:Rt},Zt=Nt.msPointer?"MSPointerDown":"pointerdown",Ht=Nt.msPointer?"MSPointerMove":"pointermove",jt=Nt.msPointer?"MSPointerUp":"pointerup",Wt=Nt.msPointer?"MSPointerCancel":"pointercancel",Vt={touchstart:Zt,touchmove:Ht,touchend:jt,touchcancel:Wt},Ut={touchstart:ee,touchmove:te,touchend:te,touchcancel:te},Gt={},Yt=!1;function Xt(t,e,i){return"touchstart"===e&&$t(),Ut[e]?(i=Ut[e].bind(this,i),t.addEventListener(Vt[e],i,!1),i):(console.warn("wrong event specified:",e),h)}function qt(t,e,i){Vt[e]?t.removeEventListener(Vt[e],i,!1):console.warn("wrong event specified:",e)}function Kt(t){Gt[t.pointerId]=t}function Jt(t){Gt[t.pointerId]&&(Gt[t.pointerId]=t)}function Qt(t){delete Gt[t.pointerId]}function $t(){Yt||(document.addEventListener(Zt,Kt,!0),document.addEventListener(Ht,Jt,!0),document.addEventListener(jt,Qt,!0),document.addEventListener(Wt,Qt,!0),Yt=!0)}function te(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Gt)e.touches.push(Gt[i]);e.changedTouches=[e],t(e)}}function ee(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ke(e),te(t,e)}function ie(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ne=200;function oe(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=Qe(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var r=Date.now();r-n<=ne?2==++i&&e(ie(t)):i=1,n=r}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function re(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var se,ae,le,he,ue,ce=Me(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),de=Me(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),me="webkitTransition"===de||"OTransition"===de?de+"End":"transitionend";function pe(t){return"string"==typeof t?document.getElementById(t):t}function fe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function _e(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ge(t){var e=t.parentNode;e&&e.removeChild(t)}function ve(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ye(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Ce(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function xe(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Te(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function we(t,e){if(void 0!==t.classList)for(var i=d(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!xe(t,e)){var r=Te(t);Se(t,(r?r+" ":"")+e)}}function be(t,e){void 0!==t.classList?t.classList.remove(e):Se(t,c((" "+Te(t)+" ").replace(" "+e+" "," ")))}function Se(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function Te(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function Pe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Le(t,e)}function Le(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function Me(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Ee(t,e,i){var n=e||new k(0,0);t.style[ce]=(Nt.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ae(t,e){t._leaflet_pos=e,Nt.any3d?Ee(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new k(0,0)}if("onselectstart"in document)se=function(){Ze(window,"selectstart",Ke)},ae=function(){je(window,"selectstart",Ke)};else{var ze=Me(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);se=function(){if(ze){var t=document.documentElement.style;le=t[ze],t[ze]="none"}},ae=function(){ze&&(document.documentElement.style[ze]=le,le=void 0)}}function ke(){Ze(window,"dragstart",Ke)}function Ie(){je(window,"dragstart",Ke)}function Be(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(De(),he=t,ue=t.style.outlineStyle,t.style.outlineStyle="none",Ze(window,"keydown",De))}function De(){he&&(he.style.outlineStyle=ue,he=void 0,ue=void 0,je(window,"keydown",De))}function Re(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Fe(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ne={__proto__:null,TRANSFORM:ce,TRANSITION:de,TRANSITION_END:me,get:pe,getStyle:fe,create:_e,remove:ge,empty:ve,toFront:ye,toBack:Ce,hasClass:xe,addClass:we,removeClass:be,setClass:Se,getClass:Te,setOpacity:Pe,testProp:Me,setTransform:Ee,setPosition:Ae,getPosition:Oe,get disableTextSelection(){return se},get enableTextSelection(){return ae},disableImageDrag:ke,enableImageDrag:Ie,preventOutline:Be,restoreOutline:De,getSizedParentNode:Re,getScale:Fe};function Ze(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)Ue(t,o,e[o],i);else for(var r=0,s=(e=d(e)).length;r<s;r++)Ue(t,e[r],i,n);return this}var He="_leaflet_events";function je(t,e,i,n){if(1===arguments.length)We(t),delete t[He];else if(e&&"object"==typeof e)for(var o in e)Ge(t,o,e[o],i);else if(e=d(e),2===arguments.length)We(t,(function(t){return-1!==v(e,t)}));else for(var r=0,s=e.length;r<s;r++)Ge(t,e[r],i,n);return this}function We(t,e){for(var i in t[He]){var n=i.split(/\d/)[0];e&&!e(n)||Ge(t,n,null,null,i)}}var Ve={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ue(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):"");if(t[He]&&t[He][o])return this;var r=function(e){return i.call(n||t,e||window.event)},a=r;!Nt.touchNative&&Nt.pointer&&0===e.indexOf("touch")?r=Xt(t,e,r):Nt.touch&&"dblclick"===e?r=oe(t,r):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ve[e]||e,r,!!Nt.passiveEvents&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(r=function(e){e=e||window.event,ii(t,e)&&a(e)},t.addEventListener(Ve[e],r,!1)):t.addEventListener(e,a,!1):t.attachEvent("on"+e,r),t[He]=t[He]||{},t[He][o]=r}function Ge(t,e,i,n,o){o=o||e+s(i)+(n?"_"+s(n):"");var r=t[He]&&t[He][o];if(!r)return this;!Nt.touchNative&&Nt.pointer&&0===e.indexOf("touch")?qt(t,e,r):Nt.touch&&"dblclick"===e?re(t,r):"removeEventListener"in t?t.removeEventListener(Ve[e]||e,r,!1):t.detachEvent("on"+e,r),t[He][o]=null}function Ye(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Xe(t){return Ue(t,"wheel",Ye),this}function qe(t){return Ze(t,"mousedown touchstart dblclick contextmenu",Ye),t._leaflet_disable_click=!0,this}function Ke(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Je(t){return Ke(t),Ye(t),this}function Qe(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function $e(t,e){if(!e)return new k(t.clientX,t.clientY);var i=Fe(e),n=i.boundingClientRect;return new k((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var ti=Nt.linux&&Nt.chrome?window.devicePixelRatio:Nt.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function ei(t){return Nt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/ti:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ii(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t}var ni={__proto__:null,on:Ze,off:je,stopPropagation:Ye,disableScrollPropagation:Xe,disableClickPropagation:qe,preventDefault:Ke,stop:Je,getPropagationPath:Qe,getMousePosition:$e,getWheelDelta:ei,isExternalTarget:ii,addListener:Ze,removeListener:je},oi=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=T(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ae(this._el,i),this.fire("step")},_complete:function(){P(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ri=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(H(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=de&&Nt.any3d&&!Nt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ze(this._proxy,me,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(H(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e,n.pan&&n.pan.noMoveStart),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Nt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Nt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof k?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():N(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=N(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new oi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){we(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!Nt.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=H(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),h=o.distanceTo(n)||1,u=1.42,c=u*u;function d(t){var e=(l*l-a*a+(t?-1:1)*c*c*h*h)/(2*(t?l:a)*c*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function m(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return m(t)/p(t)}var _=d(0);function g(t){return a*(p(_)/p(_+u*t))}function v(t){return a*(p(_)*f(_+u*t)-m(_))/c}function y(t){return 1-Math.pow(1-t,1.5)}var C=Date.now(),x=(d(1)-_)/u,w=i.duration?1e3*i.duration:1e3*x*.8;function b(){var i=(Date.now()-C)/w,r=y(i)*x;i<=1?(this._flyToFrame=T(b,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(v(r)/h)),s),this.getScaleZoom(a/g(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),b.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return t=N(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,N(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),s=this.getPixelBounds(),a=R([s.min.add(i),s.max.subtract(n)]),l=a.getSize();if(!a.contains(r)){this._enforcingBounds=!0;var h=r.subtract(a.getCenter()),u=a.extend(r).getSize().subtract(l);o.x+=h.x<0?-u.x:u.x,o.y+=h.y<0?-u.y:u.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=e.divideBy(2).round(),s=n.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new Z(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(P(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ge(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=_e("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new F(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=N(t),i=B(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=R(this.project(a,n),this.project(s,n)).getSize(),u=Nt.any3d?this.options.zoomSnap:1,c=l.x/h.x,d=l.y/h.y,m=e?Math.max(c,d):Math.min(c,d);return n=this.getScaleZoom(m,n),u&&(n=Math.round(n/(u/100))*(u/100),n=e?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new D(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(H(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(H(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(H(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(N(t))},distance:function(t,e){return this.options.crs.distance(H(t),H(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(H(t)))},mouseEventToContainerPoint:function(t){return $e(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Nt.any3d,we(t,"leaflet-container"+(Nt.touch?" leaflet-touch":"")+(Nt.retina?" leaflet-retina":"")+(Nt.ielt9?" leaflet-oldie":"")+(Nt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=fe(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ae(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(we(t.markerPane,"leaflet-zoom-hide"),we(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Ae(this._mapPane,new k(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return P(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ae(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?je:Ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Nt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){P(this._resizeRequest),this._resizeRequest=T((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ii(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Be(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var r=this._findEventTargets(t,e);if(n){for(var s=[],a=0;a<n.length;a++)n[a].listens(e,!0)&&s.push(n[a]);r=s.concat(r)}if(r.length){"contextmenu"===e&&Ke(t);var l=r[0],h={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);h.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=u?l.getLatLng():this.layerPointToLatLng(h.layerPoint)}for(a=0;a<r.length;a++)if(r[a].fire(e,h,!0),h.originalEvent._stopped||!1===r[a].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new k(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new D(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,e);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new D(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new k(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Nt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){be(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=_e("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=ce,i=this._proxy.style[e];Ee(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ee(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(T((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,we(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&be(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function si(t,e){return new ri(t,e)}var ai=E.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return we(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),li=function(t){return new ai(t)};ri.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=_e("div",e+"control-container",this._container);function n(n,o){var r=e+n+" "+e+o;t[n+o]=_e("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ge(this._controlCorners[t]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var hi=ai.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ai.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){we(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(we(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):be(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return be(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=_e("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),qe(e),Xe(e);var n=this._section=_e("section",t+"-list");i&&(this._map.on("click",this.collapse,this),Ze(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var o=this._layersLink=_e("a",t+"-toggle",e);o.href="#",o.title="Layers",o.setAttribute("role","button"),Ze(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){Ke(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=_e("div",t+"-base",n),this._separator=_e("div",t+"-separator",n),this._overlaysList=_e("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(o((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ve(this._baseLayersList),ve(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(e),e.layerId=s(t.layer),Ze(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("span");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)t=i[r],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,Ze(t,"click",Ke),this.expand();var e=this;setTimeout((function(){je(t,"click",Ke),e._preventClick=!1}))}}),ui=function(t,e,i){return new hi(t,e,i)},ci=ai.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=_e("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=_e("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),qe(r),Ze(r,"click",Je),Ze(r,"click",o,this),Ze(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";be(this._zoomInButton,e),be(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(we(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(we(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});ri.mergeOptions({zoomControl:!0}),ri.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ci,this.addControl(this.zoomControl))}));var di=function(t){return new ci(t)},mi=ai.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=_e("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=_e("div",e,i)),t.imperial&&(this._iScale=_e("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(t){return new mi(t)},fi='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',_i=ai.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Nt.inlineSvg?fi+" ":"")+"Leaflet</a>"},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=_e("div","leaflet-control-attribution"),qe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}});ri.mergeOptions({attributionControl:!0}),ri.addInitHook((function(){this.options.attributionControl&&(new _i).addTo(this)}));var gi=function(t){return new _i(t)};ai.Layers=hi,ai.Zoom=ci,ai.Scale=mi,ai.Attribution=_i,li.layers=ui,li.zoom=di,li.scale=pi,li.attribution=gi;var vi=E.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});vi.addTo=function(t,e){return t.addHandler(e,this),this};var yi={Events:O},Ci=Nt.touch?"touchstart mousedown":"mousedown",xi=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ze(this._dragStartTarget,Ci,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(xi._dragging===this&&this.finishDrag(!0),je(this._dragStartTarget,Ci,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!xe(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)xi._dragging===this&&this.finishDrag();else if(!(xi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(xi._dragging=this,this._preventOutline&&Be(this._element),ke(),se(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Re(this._element);this._startPoint=new k(e.clientX,e.clientY),this._startPos=Oe(this._element),this._parentScale=Fe(i);var n="mousedown"===t.type;Ze(document,n?"mousemove":"touchmove",this._onMove,this),Ze(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new k(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ke(t),this._moved||(this.fire("dragstart"),this._moved=!0,we(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),we(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=t,this._updatePosition()))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ae(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){be(document.body,"leaflet-dragging"),this._lastTarget&&(be(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),je(document,"mousemove touchmove",this._onMove,this),je(document,"mouseup touchend touchcancel",this._onUp,this),Ie(),ae();var e=this._moved&&this._moving;this._moving=!1,xi._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function wi(t,e,i){var n,o,r,s,a,l,h,u,c,d=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Bi(t[o],e);for(s=0;s<4;s++){for(u=d[s],n=[],o=0,r=(h=t.length)-1;o<h;r=o++)a=t[o],l=t[r],a._code&u?l._code&u||((c=Ii(l,a,u,e,i))._code=Bi(c,e),n.push(c)):(l._code&u&&((c=Ii(l,a,u,e,i))._code=Bi(c,e),n.push(c)),n.push(a));t=n}return t}function bi(t,e){var i,n,o,r,s,a,l,h,u;if(!t||0===t.length)throw new Error("latlngs not passed");Fi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var c=H([0,0]),d=N(t);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(c=Si(t));var m=t.length,p=[];for(i=0;i<m;i++){var f=H(t[i]);p.push(e.project(H([f.lat-c.lat,f.lng-c.lng])))}for(a=l=h=0,i=0,n=m-1;i<m;n=i++)o=p[i],r=p[n],s=o.y*r.x-r.y*o.x,l+=(o.x+r.x)*s,h+=(o.y+r.y)*s,a+=3*s;u=0===a?p[0]:[l/a,h/a];var _=e.unproject(B(u));return H([_.lat+c.lat,_.lng+c.lng])}function Si(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var r=H(t[o]);e+=r.lat,i+=r.lng,n++}return H([e/n,i/n])}var Ti,Pi={__proto__:null,clipPolygon:wi,polygonCenter:bi,centroid:Si};function Li(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Ai(t=zi(t,i),i)}function Mi(t,e,i){return Math.sqrt(Ri(t,e,i,!0))}function Ei(t,e,i){return Ri(t,e,i)}function Ai(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Oi(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}function Oi(t,e,i,n,o){var r,s,a,l=0;for(s=n+1;s<=o-1;s++)(a=Ri(t[s],t[n],t[o],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Oi(t,e,i,n,r),Oi(t,e,i,r,o))}function zi(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)Di(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<r-1&&i.push(t[r-1]),i}function ki(t,e,i,n,o){var r,s,a,l=n?Ti:Bi(t,i),h=Bi(e,i);for(Ti=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Bi(s=Ii(t,e,r=l||h,i,o),i),r===l?(t=s,l=a):(e=s,h=a)}}function Ii(t,e,i,n,o){var r,s,a=e.x-t.x,l=e.y-t.y,h=n.min,u=n.max;return 8&i?(r=t.x+a*(u.y-t.y)/l,s=u.y):4&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):2&i?(r=u.x,s=t.y+l*(u.x-t.x)/a):1&i&&(r=h.x,s=t.y+l*(h.x-t.x)/a),new k(r,s,o)}function Bi(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Di(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ri(t,e,i,n){var o,r=e.x,s=e.y,a=i.x-r,l=i.y-s,h=a*a+l*l;return h>0&&((o=((t.x-r)*a+(t.y-s)*l)/h)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=l*o)),a=t.x-r,l=t.y-s,n?a*a+l*l:new k(r,s)}function Fi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ni(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Fi(t)}function Zi(t,e){var i,n,o,r,s,a,l,h;if(!t||0===t.length)throw new Error("latlngs not passed");Fi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=H([0,0]),c=N(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(u=Si(t));var d=t.length,m=[];for(i=0;i<d;i++){var p=H(t[i]);m.push(e.project(H([p.lat-u.lat,p.lng-u.lng])))}for(i=0,n=0;i<d-1;i++)n+=m[i].distanceTo(m[i+1])/2;if(0===n)h=m[0];else for(i=0,r=0;i<d-1;i++)if(s=m[i],a=m[i+1],(r+=o=s.distanceTo(a))>n){l=(r-n)/o,h=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var f=e.unproject(B(h));return H([f.lat+u.lat,f.lng+u.lng])}var Hi={__proto__:null,simplify:Li,pointToSegmentDistance:Mi,closestPointOnSegment:Ei,clipSegment:ki,_getEdgeIntersection:Ii,_getBitCode:Bi,_sqClosestPointOnSegment:Ri,isFlat:Fi,_flat:Ni,polylineCenter:Zi},ji={project:function(t){return new k(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new D([-180,-90],[180,90])},Wi={R:6378137,R_MINOR:6356752.314245179,bounds:new D([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new k(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new Z(a*i,t.x*i/n)}},Vi={__proto__:null,LonLat:ji,Mercator:Wi,SphericalMercator:G},Ui=i({},V,{code:"EPSG:3395",projection:Wi,transformation:function(){var t=.5/(Math.PI*Wi.R);return X(t,.5,-t,.5)}()}),Gi=i({},V,{code:"EPSG:4326",projection:ji,transformation:X(1/180,1,-1/180,.5)}),Yi=i({},W,{projection:ji,transformation:X(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});W.Earth=V,W.EPSG3395=Ui,W.EPSG3857=K,W.EPSG900913=J,W.EPSG4326=Gi,W.Simple=Yi;var Xi=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});ri.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var qi=Xi.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Ki=function(t,e){return new qi(t,e)},Ji=qi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),qi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),qi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new F;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Qi=function(t,e){return new Ji(t,e)},$i=E.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=B(n),r=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Nt.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function tn(t){return new $i(t)}var en=$i.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof en.imagePath&&(en.imagePath=this._detectIconPath()),(this.options.imagePath||en.imagePath)+$i.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(t,e,i){var n=e.exec(t);return n&&n[i]};return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=_e("div","leaflet-default-icon-path",document.body),e=fe(t,"background-image")||fe(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e))return e;var i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-"leaflet.css".length-1):""}}),nn=vi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new xi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),we(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&be(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Oe(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!l.contains(r)){var h=B((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ae(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=T(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(P(this._panRequest),this._panRequest=T(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Oe(e._icon),o=e._map.layerPointToLatLng(n);i&&Ae(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){P(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),on=Xi.extend({options:{icon:new en,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=H(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=H(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),we(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ze(i,"focus",this._panOnFocus,this);var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(we(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&je(this._icon,"focus",this._panOnFocus,this),ge(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ge(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Ae(this._icon,t),this._shadow&&Ae(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(we(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),nn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new nn(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,i=e.iconSize?B(e.iconSize):B(0,0),n=e.iconAnchor?B(e.iconAnchor):B(0,0);t.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:i.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function rn(t,e){return new on(t,e)}var sn=Xi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),an=sn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=H(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=H(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return sn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new D(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ln(t,e){return new an(t,e)}var hn=an.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),m(this,e),this._latlng=H(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new F(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:sn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,r=this._mRadius/V.R/o,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),h=i.unproject(l).lat,u=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(u)||0===u)&&(u=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-i.project([h,t-u]).x,this._radiusY=l.y-s.y}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(c).x}this._updateBounds()}});function un(t,e,i){return new hn(t,e,i)}var cn=sn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=Ri,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],h=1,u=l.length;h<u;h++){var c=r(t,e=l[h-1],i=l[h],!0);c<n&&(n=c,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Zi(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=H(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new F,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Fi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Fi(t),n=0,o=t.length;n<o;n++)i?(e[n]=H(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new D;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new k(t,t);this._rawPxBounds&&(this._pxBounds=new D([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n,o,r=t[0]instanceof Z,s=t.length;if(r){for(o=[],n=0;n<s;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<s;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,s,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=ki(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Li(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((e||0!==n)&&Mi(t,a[o],a[n])<=l)return!0;return!1}});function dn(t,e){return new cn(t,e)}cn._flat=Ni;var mn=cn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return bi(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=cn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof Z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){cn.prototype._setLatLngs.call(this,t),Fi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Fi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new k(e,e);if(t=new D(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=wi(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,s,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(l=(e=this._parts[o]).length)-1;r<l;s=r++)i=e[r],n=e[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||cn.prototype._containsPoint.call(this,t,!0)}});function pn(t,e){return new mn(t,e)}var fn=Ji.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=g(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=_n(t,r);return s?(s.feature=bn(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function _n(t,e){var i,n,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],h=e&&e.pointToLayer,u=e&&e.coordsToLatLng||vn;if(!a&&!s)return null;switch(s.type){case"Point":return gn(h,t,i=u(a),e);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=u(a[o]),l.push(gn(h,t,i,e));return new Ji(l);case"LineString":case"MultiLineString":return n=yn(a,"LineString"===s.type?0:1,u),new cn(n,e);case"Polygon":case"MultiPolygon":return n=yn(a,"Polygon"===s.type?1:2,u),new mn(n,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var c=_n({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);c&&l.push(c)}return new Ji(l);case"FeatureCollection":for(o=0,r=s.features.length;o<r;o++){var d=_n(s.features[o],e);d&&l.push(d)}return new Ji(l);default:throw new Error("Invalid GeoJSON object.")}}function gn(t,e,i,n){return t?t(e,i):new on(i,n&&n.markersInheritOptions&&n)}function vn(t){return new Z(t[1],t[0],t[2])}function yn(t,e,i){for(var n,o=[],r=0,s=t.length;r<s;r++)n=e?yn(t[r],e-1,i):(i||vn)(t[r]),o.push(n);return o}function Cn(t,e){return void 0!==(t=H(t)).alt?[u(t.lng,e),u(t.lat,e),u(t.alt,e)]:[u(t.lng,e),u(t.lat,e)]}function xn(t,e,i,n){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?xn(t[r],Fi(t[r])?0:e-1,i,n):Cn(t[r],n));return!e&&i&&o.length>0&&o.push(o[0].slice()),o}function wn(t,e){return t.feature?i({},t.feature,{geometry:e}):bn(e)}function bn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Sn={toGeoJSON:function(t){return wn(this,{type:"Point",coordinates:Cn(this.getLatLng(),t)})}};function Tn(t,e){return new fn(t,e)}on.include(Sn),hn.include(Sn),an.include(Sn),cn.include({toGeoJSON:function(t){var e=!Fi(this._latlngs);return wn(this,{type:(e?"Multi":"")+"LineString",coordinates:xn(this._latlngs,e?1:0,!1,t)})}}),mn.include({toGeoJSON:function(t){var e=!Fi(this._latlngs),i=e&&!Fi(this._latlngs[0]),n=xn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),wn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),qi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),wn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var r=bn(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?wn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Pn=Tn,Ln=Xi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=N(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(we(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ye(this._image),this},bringToBack:function(){return this._map&&Ce(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=N(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:_e("img");we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ee(this._image,i,e)},_reset:function(){var t=this._image,e=new D(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ae(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Pe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Mn=function(t,e,i){return new Ln(t,e,i)},En=Ln.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:_e("video");if(we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=_e("source");a.src=this._url[s],e.appendChild(a)}}}});function An(t,e,i){return new En(t,e,i)}var On=Ln.extend({_initImage:function(){var t=this._image=this._url;we(t,"leaflet-image-layer"),this._zoomAnimated&&we(t,"leaflet-zoom-animated"),this.options.className&&we(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function zn(t,e,i){return new On(t,e,i)}var kn=Xi.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof Z||g(t))?(this._latlng=H(t),m(this,e)):(m(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Pe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Pe(this._container,1),this.bringToFront(),this.options.interactive&&(we(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Pe(this._container,0),this._removeTimeout=setTimeout(o(ge,void 0,this._container),200)):ge(this._container),this.options.interactive&&(be(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=H(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ye(this._container),this},bringToBack:function(){return this._map&&Ce(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Ji){e=null;var i=this._source._layers;for(var n in i)if(i[n]._map){e=i[n];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else{if(!e.getBounds)throw new Error("Unable to get source layer LatLng.");t=e.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ae(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}});ri.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),Xi.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(m(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}});var In=kn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,kn.prototype.openOn.call(this,t)},onAdd:function(t){kn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof sn||this._source.on("preclick",Ye))},onRemove:function(t){kn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof sn||this._source.off("preclick",Ye))},getEvents:function(){var t=kn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=_e("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=_e("div",t+"-content-wrapper",e);if(this._contentNode=_e("div",t+"-content",i),qe(e),Xe(this._contentNode),Ze(e,"contextmenu",Ye),this._tipContainer=_e("div",t+"-tip-container",e),this._tip=_e("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=_e("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">&#215;</span>',Ze(n,"click",(function(t){Ke(t),this.close()}),this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",we(t,r)):be(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ae(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(fe(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new k(this._containerLeft,-i-this._containerBottom);o._add(Oe(this._container));var r=t.layerPointToContainerPoint(o),s=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||s),l=B(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),u=0,c=0;r.x+n+l.x>h.x&&(u=r.x+n-h.x+l.x),r.x-u-a.x<0&&(u=r.x-a.x),r.y+i+l.y>h.y&&(c=r.y+i-h.y+l.y),r.y-c-a.y<0&&(c=r.y-a.y),(u||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,c]))}},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Bn=function(t,e){return new In(t,e)};ri.mergeOptions({closePopupOnClick:!0}),ri.include({openPopup:function(t,e,i){return this._initOverlay(In,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Xi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(In,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Ji||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Je(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof sn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Dn=kn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){kn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){kn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=kn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=_e("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,r=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(t),a=this.options.direction,l=o.offsetWidth,h=o.offsetHeight,u=B(this.options.offset),c=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=l,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=l+2*(u.x+c.x),i=h/2),t=t.subtract(B(e,i,!0)).add(u).add(c),be(o,"leaflet-tooltip-right"),be(o,"leaflet-tooltip-left"),be(o,"leaflet-tooltip-top"),be(o,"leaflet-tooltip-bottom"),we(o,"leaflet-tooltip-"+a),Ae(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Pe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Rn=function(t,e){return new Dn(t,e)};ri.include({openTooltip:function(t,e,i){return this._initOverlay(Dn,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Xi.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Dn,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Ji||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(Ze(e,"focus",(function(){this._tooltip._source=t,this.openTooltip()}),this),Ze(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",(function(){e._openOnceFlag=!1,e._openTooltip(t)}))}else this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var Fn=$i.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(ve(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=B(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Nn(t){return new Fn(t)}$i.Default=en;var Zn=Xi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Nt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ge(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ye(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ce(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof k?t:new k(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Nt.ielt9){Pe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);Pe(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(P(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=_e("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ge(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=_e("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ge(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new k(+o,+r);a.z=+s;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new k(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o);var r=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();Nt.any3d?Ee(t.el,o,n):Ae(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new D(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new D(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var u=this._tiles[h].coords;u.z===this._tileZoom&&l.contains(new k(u.x,u.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var m=new k(d,c);if(m.z=this._tileZoom,this._isValidTile(m)){var p=this._tiles[this._tileCoordsToKey(m)];p?p.current=!0:s.push(m)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(d=0;d<s.length;d++)this._addTile(s[d],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return N(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new F(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new k(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ge(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){we(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,Nt.ielt9&&this.options.opacity<1&&Pe(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&T(o(this._tileReady,this,t,null,r)),Ae(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Pe(i.el,0),P(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(we(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Nt.ielt9||!this._map._fadeAnimated?T(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new k(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new D(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Hn(t){return new Zn(t)}var jn=Zn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Nt.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ze(i,"load",o(this._tileOnLoad,this,e,i)),Ze(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Nt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Nt.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,!e.complete)){e.src=y;var i=this._tiles[t].coords;ge(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),Zn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return Zn.prototype._tileReady.call(this,t,e,i)}});function Wn(t,e){return new jn(t,e)}var Vn=jn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var r=(e=m(this,e)).detectRetina&&Nt.retina?2:1,s=this.getTileSize();n.width=s.x*r,n.height=s.y*r,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,jn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===Gi?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=jn.prototype.getTileUrl.call(this,t);return a+p(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Un(t,e){return new Vn(t,e)}jn.WMS=Vn,Wn.wms=Un;var Gn=Xi.extend({options:{padding:.1},initialize:function(t){m(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),we(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Nt.any3d?Ee(this._container,r,i):Ae(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new D(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Yn=Gn.extend({options:{tolerance:0},getEvents:function(){var t=Gn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Gn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ze(t,"mousemove",this._onMouseMove,this),Ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ze(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){P(this._redrawRequest),delete this._ctx,ge(this._container),je(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Gn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Nt.retina?2:1;Ae(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Nt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Gn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||T(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new D,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)r=s[i][n],l[n?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(e))&&(i=e);this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(be(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(we(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Xn(t){return Nt.canvas?new Yn(t):null}var qn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Kn={_initContainer:function(){this._container=_e("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Gn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=qn("shape");we(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=qn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ge(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=qn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=qn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ye(t._container)},_bringToBack:function(t){Ce(t._container)}},Jn=Nt.vml?qn:Q,Qn=Gn.extend({_initContainer:function(){this._container=Jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),je(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Gn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ae(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Jn("path");t.options.className&&we(e,t.options.className),t.options.interactive&&we(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ge(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,$(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ye(t._path)},_bringToBack:function(t){Ce(t._path)}});function $n(t){return Nt.svg||Nt.vml?new Qn(t):null}Nt.vml&&Qn.include(Kn),ri.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Xn(t)||$n(t)}});var to=mn.extend({initialize:function(t,e){mn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=N(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function eo(t,e){return new to(t,e)}Qn.create=Jn,Qn.pointsToPath=$,fn.geometryToLayer=_n,fn.coordsToLatLng=vn,fn.coordsToLatLngs=yn,fn.latLngToCoords=Cn,fn.latLngsToCoords=xn,fn.getFeature=wn,fn.asFeature=bn,ri.mergeOptions({boxZoom:!0});var io=vi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),se(),ke(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ze(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=_e("div","leaflet-zoom-box",this._container),we(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new D(this._point,this._startPoint),i=e.getSize();Ae(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ge(this._box),be(this._container,"leaflet-crosshair")),ae(),Ie(),je(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new F(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ri.addInitHook("addHandler","boxZoom",io),ri.mergeOptions({doubleClickZoom:!0});var no=vi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ri.addInitHook("addHandler","doubleClickZoom",no),ri.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var oo=vi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new xi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}we(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){be(this._map._container,"leaflet-grab"),be(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=N(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=i.easeLinearity,a=o.multiplyBy(s/r),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),u=a.multiplyBy(h/l),c=h/(i.inertiaDeceleration*s),d=u.multiplyBy(-c/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),T((function(){e.panBy(d,{duration:c,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ri.addInitHook("addHandler","dragging",oo),ri.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ro=vi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),je(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){je(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),n.options.maxBounds&&(e=n._limitOffset(B(e),n.options.maxBounds)),n.options.worldCopyJump){var o=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(e)));n.panTo(o)}else n.panBy(e)}else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Je(t)}}});ri.addInitHook("addHandler","keyboard",ro),ri.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var so=vi.extend({addHooks:function(){Ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){je(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=ei(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),n),Je(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,s=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});ri.addInitHook("addHandler","scrollWheelZoom",so);var ao=600;ri.mergeOptions({tapHold:Nt.touchNative&&Nt.safari&&Nt.mobile,tapTolerance:15});var lo=vi.extend({addHooks:function(){Ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new k(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(Ze(document,"touchend",Ke),Ze(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),ao),Ze(document,"touchend touchcancel contextmenu",this._cancel,this),Ze(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){je(document,"touchend",Ke),je(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new k(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});ri.addInitHook("addHandler","tapHold",lo),ri.mergeOptions({touchZoom:Nt.touch,bounceAtZoomLimits:!0});var ho=vi.extend({addHooks:function(){we(this._map._container,"leaflet-touch-zoom"),Ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){be(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ze(document,"touchmove",this._onTouchMove,this),Ze(document,"touchend touchcancel",this._onTouchEnd,this),Ke(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),P(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=T(a,this,!0),Ke(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,P(this._animRequest),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ri.addInitHook("addHandler","touchZoom",ho),ri.BoxZoom=io,ri.DoubleClickZoom=no,ri.Drag=oo,ri.Keyboard=ro,ri.ScrollWheelZoom=so,ri.TapHold=lo,ri.TouchZoom=ho,t.Bounds=D,t.Browser=Nt,t.CRS=W,t.Canvas=Yn,t.Circle=hn,t.CircleMarker=an,t.Class=E,t.Control=ai,t.DivIcon=Fn,t.DivOverlay=kn,t.DomEvent=ni,t.DomUtil=Ne,t.Draggable=xi,t.Evented=z,t.FeatureGroup=Ji,t.GeoJSON=fn,t.GridLayer=Zn,t.Handler=vi,t.Icon=$i,t.ImageOverlay=Ln,t.LatLng=Z,t.LatLngBounds=F,t.Layer=Xi,t.LayerGroup=qi,t.LineUtil=Hi,t.Map=ri,t.Marker=on,t.Mixin=yi,t.Path=sn,t.Point=k,t.PolyUtil=Pi,t.Polygon=mn,t.Polyline=cn,t.Popup=In,t.PosAnimation=oi,t.Projection=Vi,t.Rectangle=to,t.Renderer=Gn,t.SVG=Qn,t.SVGOverlay=On,t.TileLayer=jn,t.Tooltip=Dn,t.Transformation=Y,t.Util=M,t.VideoOverlay=En,t.bind=o,t.bounds=R,t.canvas=Xn,t.circle=un,t.circleMarker=ln,t.control=li,t.divIcon=Nn,t.extend=i,t.featureGroup=Qi,t.geoJSON=Tn,t.geoJson=Pn,t.gridLayer=Hn,t.icon=tn,t.imageOverlay=Mn,t.latLng=H,t.latLngBounds=N,t.layerGroup=Ki,t.map=si,t.marker=rn,t.point=B,t.polygon=pn,t.polyline=dn,t.popup=Bn,t.rectangle=eo,t.setOptions=m,t.stamp=s,t.svg=$n,t.svgOverlay=zn,t.tileLayer=Wn,t.tooltip=Rn,t.transformation=X,t.version=e,t.videoOverlay=An;var uo=window.L;t.noConflict=function(){return window.L=uo,this},window.L=t}(e)}(0,pn.exports);var fn=pn.exports;function _n(){this.init.apply(this,arguments)}_n.prototype={_container:null,_miniMap:null,_viewerMoving:!1,_miniMapMoving:!1,_userToggledDisplay:!1,_minimized:!1,viewer:null,tileLayer:null,Cesium:null,options:{position:"bottomleft",toggleDisplay:!0,zoomLevelOffset:-5,zoomLevelFixed:!1,centerFixed:!1,zoomControl:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,interactive:!1},shadowRectOptions:{color:"#000000",weight:1,interactive:!1,opacity:0,fillOpacity:0},strings:{hideText:"隐藏鹰眼",showText:"显示鹰眼"},mapOptions:{toggleDisplay:!0,aimingRectOptions:{color:"#ff1100",weight:3},shadowRectOptions:{color:"#0000AA",weight:1,opacity:0,fillOpacity:0}}},init:function(t,e,i,n){this.viewer=t,this.tileLayer=e,this.Cesium=i,this._container=n.container,fn.Util.setOptions(this,n),this.options.aimingRectOptions.interactive=!1,this.options.shadowRectOptions.interactive=!1,this._initMap(),this._showInitView()},updateAimingRect:function(){var t=this._getViewRange();this._aimingRect.setBounds(t)},_initMap:function(){this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",fn.DomEvent.disableClickPropagation(this._container),fn.DomEvent.on(this._container,"mousewheel",fn.DomEvent.stopPropagation);var t={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:this.options.zoomControl,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:fn.CRS.EPSG3857,center:[30,120],zoom:1};t=fn.Util.extend(this.options.mapOptions,t),this._miniMap=new fn.Map(this._container,t);var e=this.tileLayer;return this._miniMap.addLayer(e),this._viewerMoving=!0,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(fn.Util.bind((()=>{var t=this._getViewRange();this._aimingRect=fn.rectangle(t,this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=fn.rectangle(t,this.options.shadowRectOptions).addTo(this._miniMap);var e=this.viewer.scene.camera;e.moveEnd.addEventListener((t=>{var e=this._getViewRange();if(this._miniMapMoving)this._miniMapMoving=!1;else{this._viewerMoving=!0;var i=this._getZoomOutRange(e);i&&(this._miniMap.fitBounds(i),this._setDisplay(this._decideMinimized()))}e&&this._aimingRect.setBounds(e)})),e.moveStart.addEventListener((t=>{var e=this._getViewRange();e&&this._aimingRect.setBounds(e)})),this._miniMap.on("movestart",this._onMiniMapMoveStarted,this),this._miniMap.on("move",this._onMiniMapMoving,this),this._miniMap.on("moveend",this._onMiniMapMoved,this)}),this)),this._container},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText:function(){return this.options.minimized?this.options.strings.showText:this.options.strings.hideText},_createButton:function(t,e,i,n,o,r){var s=fn.DomUtil.create("a",i,n);s.innerHTML=t,s.href="#",s.title=e;var a=fn.DomEvent.stopPropagation;return fn.DomEvent.on(s,"click",a).on(s,"mousedown",a).on(s,"dblclick",a).on(s,"click",fn.DomEvent.preventDefault).on(s,"click",o,r),s},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_showInitView:function(){var t=this._getViewRange(),e=this._getZoomOutRange(t);e&&this._miniMap.fitBounds(e)},_setDisplay:function(t){t!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore:function(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMiniMapMoveStarted:function(t){if(!this.options.centerFixed){var e=this._aimingRect.getBounds(),i=this._miniMap.latLngToContainerPoint(e.getSouthWest()),n=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:i,ne:n}}},_onMiniMapMoving:function(t){this.options.centerFixed||!this._viewerMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new fn.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){if(this._viewerMoving)this._viewerMoving=!1;else{this._miniMapMoving=!0;var e=this._shadowRect.getBounds(),i=e.getWest(),n=e.getEast(),o=e.getNorth(),r=e.getSouth(),s=this.Cesium.Rectangle.fromDegrees(i,r,n,o),a={heading:this.Cesium.Math.toRadians(0),pitch:this.Cesium.Math.toRadians(-90),roll:0};this.viewer.scene.camera.setView({destination:s,orientation:a}),this._shadowRect.setStyle({opacity:0,fillOpacity:0})}},_isZoomLevelFixed:function(){var t=this.options.zoomLevelFixed;return this._isDefined(t)&&this._isInteger(t)},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._getViewRange().contains(this._miniMap.getBounds()):this._minimized},_isInteger:function(t){return"number"==typeof t},_isDefined:function(t){return void 0!==t},_onToggle:function(){fn.Util.requestAnimFrame((function(){fn.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),fn.Browser.any3d||fn.Util.requestAnimFrame(this._fireToggleEvents,this)}),this)},_fireToggleEvents:function(){fn.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this)},_getViewRange:function(){var t=null,e=this.viewer.scene.camera.computeViewRectangle();if(e){var i=e.west/Math.PI*180,n=e.east/Math.PI*180,o=e.north/Math.PI*180,r=e.south/Math.PI*180;t=new fn.LatLngBounds(new fn.LatLng(o,i),new fn.LatLng(r,n))}return t},_getZoomOutRange:function(t){var e=null;if(t){var i=t.getWest(),n=t.getEast(),o=t.getNorth(),r=t.getSouth(),s=2*Math.abs(n-i)/2,a=2*Math.abs(o-r)/2;(i-=s)<-180&&(i=-180),(n+=s)>180&&(n=180),(o+=a)>90&&(o=90),(r-=a)<-90&&(r=-90),e=new fn.LatLngBounds(new fn.LatLng(o,i),new fn.LatLng(r,n))}return e},CLASS_NAME:"CesiumOverviewMapControl"};const gn={id:"minimap",class:"leaflet-control-minimap"};var vn=pt({props:{width:{type:Number,default:220},height:{type:Number,default:150},viewer:{type:Object,required:!0}},setup(t){const i=t;return e.onMounted((()=>{var t,e,n;t="https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token=pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",e=new fn.TileLayer(t,{minZoom:0,maxZoom:20}),n={container:document.getElementById("minimap"),toggleDisplay:!0,width:i.width,height:i.height,position:"topright",aimingRectOptions:{color:"#ff1100",weight:3},shadowRectOptions:{color:"#e1b000",weight:1,opacity:0,fillOpacity:0}},new _n(i.viewer,e,Cesium,n)})),(t,i)=>(e.openBlock(),e.createElementBlock("div",gn))}},[["__scopeId","data-v-7136a901"]]);const yn={class:"info_data"};var Cn=pt({emits:["close"],setup(t,{expose:i,emit:n}){const{wgs84ToWindowCoordinates:o}=Mn;let r=e.ref(!1),s=e.ref({x:0,y:0}),a=null,l=null;function h(t,e){l=e||l,null==a&&t&&(a=t,a.scene.postRender.addEventListener((()=>{r.value&&h()})));let i=function(){let t=o(a,l);if(t){return{x:t.x,y:a.canvas.clientHeight-t.y}}}();i?(s.value=i,r.value=!0):r.value=!1}function u(){r.value=!1}return e.onUnmounted((()=>{r.value=!1})),i({openInfo:h,close:u}),(t,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"content_info",style:e.normalizeStyle({left:e.unref(s).x+"px",bottom:e.unref(s).y+"px"})},[e.createElementVNode("div",{class:"close_btn",onClick:u},"x"),e.createElementVNode("div",yn,[e.renderSlot(t.$slots,"default",{},void 0,!0)])],4)),[[e.vShow,e.unref(r)]])}},[["__scopeId","data-v-7e9262c2"]]);const xn={props:{loading:{type:Boolean,default:!0},loadTime:{type:Number,default:5e3},image:{type:String,default:""}},data:()=>({progress:0,timer:"",show:!0}),watch:{loading:{handler(t){t||(this.show=!1,this.progress=100,window.clearInterval(this.timer))},immediate:!0}},unMounted(){window.clearInterval(this.timer)},created(){this.timer=setInterval((()=>{this.progress+=3,this.progress>=99&&window.clearInterval(this.timer)}),this.loadTime/30)}},wn=(t=>(e.pushScopeId("data-v-4fb4eee2"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("div",{id:"ajaxloader"},[e.createElementVNode("div",{class:"outer"}),e.createElementVNode("div",{class:"inner"})],-1))),bn={class:"text-center",style:{width:"400px"}},Sn={class:"mb-20 flex flex-center"},Tn={class:"progress-wrap"},Pn={class:"progress-inner"};var Ln=pt(xn,[["render",function(t,i,n,o,r,s){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mapLoad flex flex-col flex-center",{loadOver:!r.show}]),style:e.normalizeStyle(n.image?`background: url(${n.image}) no-repeat center;background-size:cover;`:"")},[wn,e.createElementVNode("div",bn,[e.createElementVNode("div",Sn," 正在努力加载中..."+e.toDisplayString(r.progress.toFixed(0))+"% ",1),e.createElementVNode("div",Tn,[e.createElementVNode("div",Pn,[e.createElementVNode("div",{class:"progress-nums",style:e.normalizeStyle(`width: ${r.progress}%`)},null,4)])])])],6)}],["__scopeId","data-v-4fb4eee2"]]);const Mn={firstFly:(t,e)=>new Promise((i=>{const n=Object.assign({lng:120,lat:30,height:2e3,heading:0,pitch:-90,roll:0},e);t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,2e7),duration:5,complete:()=>{t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.height+1e3),duration:2,complete:()=>{t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.height),orientation:{heading:Cesium.Math.toRadians(n.heading),pitch:Cesium.Math.toRadians(n.pitch),roll:Cesium.Math.toRadians(n.roll)},duration:2,complete:()=>{i(!0)}})}})}})})),flyTo:(t,e)=>new Promise((i=>{const n=Object.assign({lng:120,lat:30,height:2e3,duration:2,heading:0,pitch:-90,roll:0},e);t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.height),orientation:{heading:Cesium.Math.toRadians(n.heading),pitch:Cesium.Math.toRadians(n.pitch),roll:Cesium.Math.toRadians(n.roll)},duration:n.duration,complete:()=>{i(!0)}})})),flyToRectangle:(t,e,i)=>new Promise((n=>{const o=Object.assign({duration:2,heading:0,pitch:-90,roll:0},i);t.camera.flyTo({destination:e,orientation:{heading:Cesium.Math.toRadians(o.heading),pitch:Cesium.Math.toRadians(o.pitch),roll:Cesium.Math.toRadians(o.roll)},duration:o.duration,complete:()=>{n(!0)}})})),flyToPoint:(t,{lng:e,lat:i,distance:n=2e3,duration:o=2,heading:r=0,pitch:s=-30})=>new Promise((async a=>{t.entities.values.forEach((e=>{"tempEntity"===e.name&&t.entities.remove(e)}));const l=t.entities.add({name:"tempEntity",position:Cesium.Cartesian3.fromDegrees(e,i),point:{color:Cesium.Color.RED,pixelSize:0,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND}});t.flyTo(l,{offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(r),Cesium.Math.toRadians(s),n),duration:o}).then((()=>{console.log("飞行结束"),t.entities.remove(l),a(!0)}))})),setView:(t,e)=>{const i=Object.assign({lng:120,lat:30,height:1e3,duration:2,heading:0,pitch:-90,roll:0},e);t.camera.setView({destination:Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.height),orientation:{heading:Cesium.Math.toRadians(i.heading),pitch:Cesium.Math.toRadians(i.pitch),roll:i.roll}})},gazeAngle:(t,e)=>{const i=Object.assign({lng:120,lat:30,heading:0,pitch:-60,range:15e3},e),n=Cesium.Cartesian3.fromDegrees(i.lng,i.lat),o=Cesium.Math.toRadians(i.heading),r=Cesium.Math.toRadians(i.pitch),s=i.range;t.camera.lookAt(n,new Cesium.HeadingPitchRange(o,r,s))},screenToWgs84:dt,wgs84ToWindowCoordinates:(t,e)=>Cesium.SceneTransforms.worldToWindowCoordinates(t.scene,e),getCamera:mt,enterUnderGround:(t,e=.5)=>{const{scene:i}=t,{globe:n}=t.scene;n.depthTestAgainstTerrain=!1,i.screenSpaceCameraController.inertiaZoom=.5,i.screenSpaceCameraController.enableCollisionDetection=!1,i.highDynamicRange=!1,i.skyAtmosphere.show=!1,i.skyBox.show=!1,i.fog.enabled=!1,n.baseColor=Cesium.Color.BLACK,n.translucency.enabled=!0,n.translucency.frontFaceAlpha=e,n.translucency.backFaceAlpha=.1,n.undergroundColor=Cesium.Color.BLACK,n.undergroundColorAlphaByDistance.near=1e3,n.undergroundColorAlphaByDistance.far=1e6,n.undergroundColorAlphaByDistance.nearValue=0,n.undergroundColorAlphaByDistance.farValue=1},cancelUnderGround:(t,e)=>{const{scene:i}=t,{globe:n}=t.scene,{imageryLayers:o}=t;i.globe.depthTestAgainstTerrain=!0;n.baseColor;const r=!0,s=!0,a=!0,l=!0;if(i.screenSpaceCameraController.enableCollisionDetection=!0,i.highDynamicRange=a,i.skyAtmosphere.show=s,i.skyBox.show=r,i.fog.enabled=l,n.baseColor,o&&o.length>0)for(let h=0;h<o.length;h++){o.get(h).alpha=1}},measurePolyLine:function(t){vt=t;var e=[],i=null;vt.screenSpaceEventHandler.setInputAction((function(t){var n=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);0==e.length?(e.push(n.clone()),yt(n),vt.screenSpaceEventHandler.setInputAction((function(t){var n=vt.scene.globe.pick(vt.camera.getPickRay(t.endPosition),vt.scene);if(2==e.length){e.pop(),e.push(n),i&&(vt.entities.remove(i),gt.splice(gt.indexOf(i),1));var o=Cesium.Cartesian3.midpoint(e[0],e[1],new Cesium.Cartesian3),r="距离:"+bt(e[0],e[1]);i=wt(o,r),gt.push(i)}else e.push(n),Ct(e)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)):(e.pop(),e.push(n),yt(n),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE))}),Cesium.ScreenSpaceEventType.LEFT_CLICK)},measurePolygon:function(t){vt=t;var e=[],i=!1,n=null;vt.screenSpaceEventHandler.setInputAction((function(t){i=!0;var o=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);console.log(o),0==e.length?(e.push(o.clone()),yt(o),vt.screenSpaceEventHandler.setInputAction((function(t){var o=vt.scene.globe.pick(vt.camera.getPickRay(t.endPosition),vt.scene);if(console.log(o),1==e.length?(e.push(o),Ct(e,2)):(i||e.pop(),e.push(o)),e.length>=3){n&&(vt.entities.remove(n),gt.splice(gt.indexOf(n),1));var r="面积:"+St(e),s=Tt(e);n=wt(s,r),gt.push(n)}i=!1}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)):2==e.length?(e.pop(),e.push(o.clone()),yt(o),xt(e),vt.screenSpaceEventHandler.setInputAction((function(t){var i=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);console.log(i),e.pop(),e.push(i),e.push(e[0]),yt(i),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)):e.length>=3&&(e.pop(),e.push(o.clone()),yt(o))}),Cesium.ScreenSpaceEventType.LEFT_CLICK)},measureHeight:function(t){vt=t;var e=[],i=null,n=null,o=null;vt.screenSpaceEventHandler.setInputAction((function(t){var r=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);if(0==e.length)e.push(r.clone()),yt(r),vt.screenSpaceEventHandler.setInputAction((function(t){var r=vt.scene.globe.pick(vt.camera.getPickRay(t.endPosition),vt.scene);if(e.length>=2){e.pop(),e.pop(),e.pop();var s=Cesium.Cartographic.fromCartesian(r),a=Cesium.Cartographic.fromCartesian(e[0]).height,l=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(s.longitude),Cesium.Math.toDegrees(s.latitude),a);e.push(l),e.push(r),e.push(e[0]),i&&(vt.entities.remove(i),gt.splice(gt.indexOf(i),1),vt.entities.remove(n),gt.splice(gt.indexOf(n),1),vt.entities.remove(o),gt.splice(gt.indexOf(o),1));var h=Cesium.Cartesian3.midpoint(e[0],e[1],new Cesium.Cartesian3),u="水平距离:"+bt(e[0],e[1]);i=wt(h,u),gt.push(i);var c=Cesium.Cartesian3.midpoint(e[1],e[2],new Cesium.Cartesian3),d="垂直距离:"+bt(e[1],e[2]);n=wt(c,d),gt.push(n);var m=Cesium.Cartesian3.midpoint(e[2],e[3],new Cesium.Cartesian3),p="直线距离:"+bt(e[2],e[3]);o=wt(m,p),gt.push(o)}else{l=new Cesium.Cartesian3(r.x,r.y,e[0].z);e.push(l),e.push(r),e.push(e[0]),Ct(e)}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE);else{e.pop(),e.pop(),e.pop();var s=Cesium.Cartographic.fromCartesian(r),a=Cesium.Cartographic.fromCartesian(e[0]).height,l=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(s.longitude),Cesium.Math.toDegrees(s.latitude),a);e.push(l),e.push(r),e.push(e[0]),yt(r),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)},clearMeasure:function(t){vt=t;for(var e=0;e<gt.length;e++)vt.entities.remove(gt[e]);gt=[]},drawBoundary:function(t,e,i){let n=Object.assign({},$t,i);Qt=t;const o=function(t){const e=[];return t.features.forEach((t=>{const{coordinates:i,type:n}=t.geometry;if("MultiPolygon"===n)i.forEach((t=>{t.forEach((t=>{e.push(t.flat())}))}));else{const t=[];i[0].forEach((e=>{t.push(e.flat())})),e.push(t)}})),e}(e),r=function(t,e){let i=[new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t[0]))];const n=new Cesium.GeometryInstance({id:"boundary-polygon",geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([0,0,0,90,179,90,179,0]),i)})}),o=new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString(e.fillColor).withAlpha(e.fillOpacity)})})});return Qt.scene.primitives.add(o),o}(o,n),s=function(t,e){const i=t.map((t=>new Cesium.GeometryInstance({id:"boundary-line",geometry:Cesium.WallGeometry.fromConstantHeights({positions:Cesium.Cartesian3.fromDegreesArray(t),minimumHeight:2e3,maximumHeight:1e3,vertexFormat:Cesium.MaterialAppearance.VERTEX_FORMAT})}))),n=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString(e.lineColor).withAlpha(e.fillOpacity)})})});return Qt.scene.primitives.add(n),n}(o,n);return[r,s]},addGroundSkyBox:function(t,e,i=!0){qt=t,Xt=new Yt({sources:e,nearGround:!0}),i?(Kt=qt.scene.skyBox,qt.scene.postRender.addEventListener(Jt)):Jt()},removeGroundSkyBox:function(t){qt=t,qt.scene.skyBox=Kt,qt.scene.skyAtmosphere.show=!1,qt.scene.postRender.removeEventListener(Jt)},getPolygonCenter:(t=[])=>{let e=ct(s(t));return[e.geometry.coordinates[0],e.geometry.coordinates[1]]}},En={getLayerAll:function(t){return{dataSources:t.dataSources,primitives:t.scene.primitives}},hasLayer:function(t,e){let i=null;return t.dataSources.length>0&&(i=t.dataSources.getByName(e)),i},showLayer:function(t,e,i=!1){if(t.dataSources.length>0){let n=t.dataSources._dataSources.find((t=>t.name==e));n&&(n.show=i)}if(t.scene.primitives.length>0){let n=[...t.scene.primitives._primitives];for(let t=0;t<n.length;t++){let o=n[t];if(o instanceof Cesium.BillboardCollection){o._billboards.findIndex((t=>t.id&&t.id.layerId==e))>=0&&(o.show=i)}else if(o instanceof Cesium.LabelCollection){o._labels.findIndex((t=>t.id&&t.id.layerId==e+"_text"))>=0&&(o.show=i)}}}},showLayerText:function(t,e,i=!1){if(t.dataSources.length>0){let n=t.dataSources._dataSources.find((t=>t.name==e));n&&n.entities.values.forEach((t=>{t.label&&(t.label.show=i)}))}if(t.scene.primitives.length>0){let n=[...t.scene.primitives._primitives];for(let t=0;t<n.length;t++){let o=n[t];if(o instanceof Cesium.LabelCollection){if(o._labels.findIndex((t=>t.id&&t.id.layerId==e+"_text"))>=0){o.show=i;break}}}}},removeLayer:function(t,e){if(t.dataSources.length>0){let i=t.dataSources._dataSources.find((t=>t.name==e));i&&t.dataSources.remove(i)}if(t.scene.primitives.length>0){let i=[...t.scene.primitives._primitives];for(let n=0;n<i.length;n++){let o=i[n];if(o instanceof Cesium.BillboardCollection){o._billboards.findIndex((t=>t.id&&t.id.layerId==e))>=0&&t.scene.primitives.remove(o)}else if(o instanceof Cesium.LabelCollection){o._labels.findIndex((t=>t.id&&t.id.layerId==e+"_text"))>=0&&t.scene.primitives.remove(o)}}}},removeLayerAll:function(t){t.dataSources.removeAll(),t.scene.primitives.removeAll()},removePrimitiveLayer:function(t,e){t.scene.primitives.remove(e)},removeEntityLayer:function(t,e){t.entities.remove(e)}},An={addEntityPoint:(t,e)=>{const i=Object.assign({},te,e),n=i.image||{},o=i.text||{},r=i.data||[],s=i.props||{},a=void 0===i.show||i.show,l=new Cesium.CustomDataSource(i.id);if(t.dataSources.add(l),r.forEach((t=>{if(t[s.lgtd]&&t[s.lttd]){var e=new Cesium.Entity({name:t.id,show:a,position:Cesium.Cartesian3.fromDegrees(Number(t[s.lgtd]),Number(t[s.lttd]),Number(t[s.height]||0)),billboard:Object.assign({image:t.image||n.image,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,zIndex:0},n),label:o.show?Object.assign({text:t[s.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.fromCssColorString("#000000").withAlpha(1),outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},o.style):null,description:JSON.stringify(t)});l.entities.add(e)}})),i.cluster.enabled){let t=function(){e=e&&e.destroy()},e=null;t();const n=new Cesium.PinBuilder;let o;l.clustering.enabled=!0,l.clustering.pixelRange=i.cluster.pixelRange||30,l.clustering.minimumClusterSize=i.cluster.minimumClusterSize||2;(()=>{Cesium.defined(o)?(o(),o=void 0):o=l.clustering.clusterEvent.addEventListener(((t,e)=>{if(0==e.label.id.length||!e.label.id[0])return e.label.show=!1,void(e.billboard.show=!1);const i=t.length>100?"99+":t.length;e.label.show=!1,e.billboard.show=!0,e.billboard.id=e.label.id,e.billboard.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,e.billboard.image=n.fromText(i,Cesium.Color.VIOLET,40).toDataURL()}))})()}},addPrimitivePoint:(t,e)=>{let i=Object.assign({},te,e),n=i.image||{},o=i.text||{},r=i.data||[],s=i.props||{};const a=t.scene.primitives.add(new Cesium.BillboardCollection({scene:t.scene})),l=t.scene.primitives.add(new Cesium.LabelCollection({scene:t.scene}));r.forEach((t=>{t[s.lgtd]&&t[s.lttd]&&(a.add(Object.assign({id:Object.assign({layerId:i.id},t),position:Cesium.Cartesian3.fromDegrees(t[s.lgtd],t[s.lttd],t[s.height]||0),image:t.image||n.image,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,zIndex:0},n)),o.show&&l.add(Object.assign({id:Object.assign({layerId:i.id+"_text"},t),position:Cesium.Cartesian3.fromDegrees(t[s.lgtd],t[s.lttd],t[s.height]||0),text:t[s.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,n.height||20)},o.style)))}))},addFlashPoint:(t,e)=>{let i=Object.assign({},te,e),n=Object.assign({},te.point,e.point),o=i.data||[],r=i.props||{},s=new Cesium.CustomDataSource(i.id);t.dataSources.add(s),o.forEach((t=>{if(t[r.lgtd]&&t[r.lttd]){t.size=n.size;var e=new Cesium.Entity({name:t.id,show:!0,position:Cesium.Cartesian3.fromDegrees(t[r.lgtd],t[r.lttd],t[r.height]||0),point:Object.assign({show:!0,color:Cesium.Color.RED.withAlpha(.7),pixelSize:new Cesium.CallbackProperty((()=>(t.size=t.size+n.speed,t.size>=n.maxSize&&(t.size=n.size),t.size)),!1),outlineWidth:0,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND},n),description:JSON.stringify(t)});s.entities.add(e)}}))},addEntityLine:(t,e)=>{let i=Object.assign({},xi,e),n=i.line||{},o=i.text||{},r=i.props||{},s=i.data||[];s=s.filter((t=>t[r.lglt]));const a=void 0===i.show||i.show;let l=new Cesium.CustomDataSource(i.id);t.dataSources.add(l),s.forEach((t=>{let e=t[r.lglt].flat(),i=Cesium.Cartesian3.fromDegreesArray(e);var s=new Cesium.Entity({name:"line_"+t.id,show:a,polyline:Object.assign({positions:i,width:n.width||5,material:Cesium.Color.RED,clampToGround:!0,zIndex:0},n),description:JSON.stringify(t)});if(l.entities.add(s),o.show){const e=bi(i);let n={name:"line_text_"+t.id,show:a,position:e,label:Object.assign({text:t[r.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},o),description:JSON.stringify(t)};l.entities.add(n)}}))},addPrimitiveLine:(t,e)=>{let i=Object.assign({},xi,e),n=i.line||{};i.text;let o=i.data||[],r=i.props||{},s=[];o.forEach((t=>{let e=t[r.lglt].flat();s.push(new Cesium.GeometryInstance({id:Object.assign({layerId:i.id},t),geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(e),width:n.width||5})}))}));const a=new Cesium.GroundPolylinePrimitive({geometryInstances:s,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.AQUA})})});t.scene.primitives.add(a)},addPolylineTrail:(t,e)=>{let i=Object.assign({},wi,e),n=i.data||[],o=i.props||{},r=[];n.forEach((t=>{let e=t[o.lglt].flat();r.push(new Cesium.GeometryInstance({id:Object.assign({layerId:i.id},t),geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(e),width:i.width||5})}))}));const s=new Cesium.GroundPolylinePrimitive({geometryInstances:r,appearance:new Cesium.PolylineMaterialAppearance({material:new Ci({color:new Cesium.Color.fromCssColorString(i.color),image:i.image,speed:i.speed,repeat:i.repeat,type:i.type})})});t.scene.primitives.add(s)},addEntityPolygon:(t,e)=>{let i=Object.assign({},Ei,e),n=i.polygon||{},o=i.text||{},r=i.props||{},s=i.data||[];const a=void 0===i.show||i.show;s=s.filter((t=>t[r.lglt]));let l=new Cesium.CustomDataSource(i.id);t.dataSources.add(l),s.forEach((t=>{let e=t[r.lglt].flat(),s=null,h=Object.assign({},n);i.isCustomColor&&(h=Object.assign({},h,t)),!h.extrudedHeight&&h.outline&&(s={show:a,positions:Cesium.Cartesian3.fromDegreesArray(e),width:h.outlineWidth,material:h.outlineColor,arcType:Cesium.ArcType.RHUMB,clampToGround:!0,zIndex:h.zIndex||0});let u=Cesium.Cartesian3.fromDegreesArray(e);var c=new Cesium.Entity({name:"polygon_"+t.id,show:a,polygon:Object.assign({hierarchy:u,material:Cesium.Color.RED,clampToGround:!0,zIndex:0},h),polyline:s,description:JSON.stringify(t)});if(l.entities.add(c),o.show){const e=Cesium.BoundingSphere.fromPoints(u).center,i=Cesium.Cartographic.fromCartesian(e),n=Cesium.Math.toDegrees(i.longitude),s=Cesium.Math.toDegrees(i.latitude);let h={name:"polygon_text_"+t.id,show:a,position:Cesium.Cartesian3.fromDegrees(n,s,0),label:Object.assign({text:t[r.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},o),description:JSON.stringify(t)};l.entities.add(h)}}))},addPrimitivePolygon:(t,e)=>{let i=Object.assign({},Ei,e);i.polygon,i.text;let n=i.data||[],o=i.props||{},r=[];n.forEach((t=>{let e=t[o.lglt].flat();r.push(new Cesium.GeometryInstance({id:Object.assign({layerId:i.id},t),geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e))}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)}}))}));const s=new Cesium.GroundPrimitive({geometryInstances:r});t.scene.primitives.add(s)},addPolylineVolume:(t,e)=>{let i=Object.assign({},Ai,e),n=i.props||{},o=i.data||[],r=i.style||{};o=o.filter((t=>t[n.lglt]));let s=new Cesium.CustomDataSource(i.id);function a(t,e){var i=[];let n=t?0:-45,o=t?360:325,r=t?10:90;for(;n<o;n++){var s=Cesium.Math.toRadians(n);i.push(new Cesium.Cartesian2(e*Math.cos(s),e*Math.sin(s))),n+=r}return i}t.dataSources.add(s),o.forEach((t=>{let e=t[n.lglt].flat();var o=new Cesium.Entity({name:"line_"+t.id,show:!0,polylineVolume:Object.assign({},r,{positions:Cesium.Cartesian3.fromDegreesArrayHeights(e),shape:a(i.isCircle,i.width)})});s.entities.add(o)}))},addPrimitiveWall:(t,e)=>{let i=Object.assign({},Ti,e),n=i.data||[],o=i.props||{},r=[];n.forEach((async t=>{let e=t[o.lglt].flat();if(i.isGround){let n=await Pi(t[o.lglt],i.height);r.push(new Cesium.GeometryInstance({id:i.id,geometry:new Cesium.WallGeometry({positions:Cesium.Cartesian3.fromDegreesArray(e),minimumHeights:n.minimumHeights,maximumHeights:n.maximumHeights})}))}else r.push(new Cesium.GeometryInstance({id:i.id,geometry:Cesium.WallGeometry.fromConstantHeights({positions:Cesium.Cartesian3.fromDegreesArray(e),maximumHeight:i.maximumHeight,minimumHeight:i.minimumHeight,vertexFormat:Cesium.MaterialAppearance.VERTEX_FORMAT})}))}));const s=new Cesium.Primitive({geometryInstances:r,appearance:new Cesium.MaterialAppearance({material:new Si({color:new Cesium.Color.fromCssColorString(i.color),image:i.image,speed:i.speed,repeat:i.repeat})})});return t.scene.primitives.add(s),s},addPrimitiveRadar:(t,e)=>{let i=Object.assign({},Mi,e),n=Cesium.Cartesian3.fromDegrees(i.center.lgtd,i.center.lttd);const o=new Cesium.Primitive({geometryInstances:[new Cesium.GeometryInstance({id:i.id,geometry:new Cesium.EllipseGeometry({center:n,semiMajorAxis:i.radius,semiMinorAxis:i.radius,height:i.height})})],appearance:new Cesium.MaterialAppearance({material:new Li(i.style),flat:!1,faceForward:!1,translucent:!0,closed:!1})});t.scene.primitives.add(o)},addWaterAnimation:(t,e)=>{let i=(e.data||[]).flat(),n=e.style||{};n=Object.assign({},Oi,n);let o,r={show:!0,geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,extrudedHeight:n.waterHeight||void 0,height:n.height||void 0})}),appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:Object.assign({},{normalMap:"/img/waterNormals.jpg",frequency:8e3,animationSpeed:.02,amplitude:10,specularIntensity:.5,baseWaterColor:Cesium.Color.fromCssColorString("#006ab4").withAlpha(.8),blendColor:Cesium.Color.fromCssColorString("#006ab4")},n)}}),fragmentShaderSource:`\n in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n layout(location = 0) out vec4 out_FragColor;\n\n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n out_FragColor.a=${n.alpha};\n #endif\n }`})};o=n.heightReference&&n.heightReference===Cesium.HeightReference.CLAMP_TO_GROUND?new Cesium.GroundPrimitive(r):new Cesium.Primitive(r),t.scene.primitives.add(o)},addParticleSystemRain:(t,e)=>{Zi(t);let i=Object.assign({},zi,e),{scene:n}=t;const o=i.particleSize,r=1e5,s=new Cesium.Cartesian2(.2*o,4*o);let a=new Cesium.Cartesian3;n.primitives.add(new Cesium.ParticleSystem(Object.assign({modelMatrix:new Cesium.Matrix4.fromTranslation(n.camera.position),speed:-1,lifetime:15,emitter:new Cesium.SphereEmitter(r),startScale:1,endScale:0,image:"/img/rain.png",emissionRate:1e4,startColor:Cesium.Color.WHITESMOKE.withAlpha(0),endColor:Cesium.Color.SILVER.withAlpha(1),imageSize:s,updateCallback:(t,e)=>{a=Cesium.Cartesian3.normalize(t.position,a),a=Cesium.Cartesian3.multiplyByScalar(a,-1050,a),t.position=Cesium.Cartesian3.add(t.position,a,t.position);const i=Cesium.Cartesian3.distance(n.camera.position,t.position);t.endColor.alpha=i>r?0:Cesium.Color.SILVER.alpha/(i/r+.1)}},i))),console.log(i),n.skyAtmosphere.hueShift=-.97,n.skyAtmosphere.saturationShift=.25,n.skyAtmosphere.brightnessShift=-.4,n.fog.density=25e-5,n.fog.minimumBrightness=.01},addParticleSystemSnow:(t,e)=>{Zi(t);let i=Object.assign({},Bi,e),{scene:n}=t;const o=1e5,r=new Cesium.Cartesian2(i.particleSize,i.particleSize),s=new Cesium.Cartesian2(2*i.particleSize,2*i.particleSize);let a=new Cesium.Cartesian3;n.primitives.add(new Cesium.ParticleSystem({modelMatrix:new Cesium.Matrix4.fromTranslation(n.camera.position),minimumSpeed:-.2,maximumSpeed:0,lifetime:15,emitter:new Cesium.SphereEmitter(o),startScale:.5,endScale:1,image:"/img/snow.png",emissionRate:5e3,startColor:Cesium.Color.WHITE.withAlpha(0),endColor:Cesium.Color.WHITE.withAlpha(1),minimumImageSize:r,maximumImageSize:s,updateCallback:function(t,e){a=Cesium.Cartesian3.normalize(t.position,a),Cesium.Cartesian3.multiplyByScalar(a,Cesium.Math.randomBetween(-30,-300),a),t.velocity=Cesium.Cartesian3.add(t.velocity,a,t.velocity);const i=Cesium.Cartesian3.distance(n.camera.position,t.position);t.endColor.alpha=i>o?0:1/(i/o+.1)}})),n.skyAtmosphere.hueShift=-.8,n.skyAtmosphere.saturationShift=-.7,n.skyAtmosphere.brightnessShift=-.33,n.fog.density=.001,n.fog.minimumBrightness=.8},addGlslSnow:(t,e)=>{Zi(t);let i=Object.assign({},Ri,e),{scene:n}=t;Di=new Cesium.PostProcessStage({name:"glsl_snow",fragmentShader:"// 下雪\r\nuniform sampler2D colorTexture;\r\nin vec2 v_textureCoordinates;\r\nuniform float snowSpeed;\r\nuniform float snowSize;\r\nout vec4 vFragColor;\r\nfloat snow(vec2 uv, float scale) {\r\n float time = czm_frameNumber / snowSpeed;\r\n float w = smoothstep(1., 0., -uv.y * (scale / 10.));\r\n if (w < .1) return 0.;\r\n uv += time / scale;\r\n uv.y += time * 2. / scale;\r\n uv.x += sin(uv.y + time * .5) / scale;\r\n uv *= scale;\r\n vec2 s = floor(uv), f = fract(uv), p;\r\n float k = 3., d;\r\n p = .5 + .35 * sin(11. * fract(sin((s + p + scale) * mat2(7, 3, 6, 5)) * 5.)) - f;\r\n d = length(p);\r\n k = min(d, k);\r\n k = smoothstep(0., k, sin(f.x + f.y) * snowSize);\r\n return k * w;\r\n}\r\nvoid main(void) {\r\n vec2 resolution = czm_viewport.zw;\r\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\r\n vec3 finalColor = vec3(0);\r\n // float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\r\n float c = 0.;\r\n c += snow(uv, 30.) * .0;\r\n c += snow(uv, 20.) * .0;\r\n c += snow(uv, 15.) * .0;\r\n c += snow(uv, 10.);\r\n c += snow(uv, 8.);\r\n c += snow(uv, 6.);\r\n c += snow(uv, 5.);\r\n finalColor = (vec3(c));\r\n vFragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor, 1), .5);\r\n}",uniforms:{snowSize:()=>i.snowSize,snowSpeed:()=>i.snowSpeed}}),n.postProcessStages.add(Di)},addGlslRain:(t,e)=>{Zi(t);let i=Object.assign({},Ii,e),{scene:n}=t;ki=new Cesium.PostProcessStage({name:"glsl_rain",fragmentShader:"// 下雨\r\nuniform sampler2D colorTexture;\r\nin vec2 v_textureCoordinates;\r\nuniform float tiltAngle;\r\nuniform float rainSize;\r\nuniform float rainSpeed;\r\nout vec4 vFragColor;\r\nfloat hash(float x) { return fract(sin(x * 133.3) * 13.13); }\r\nvoid main(void) {\r\n float time = czm_frameNumber / rainSpeed;\r\n vec2 resolution = czm_viewport.zw;\r\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\r\n vec3 c = vec3(.6, .7, .8);\r\n float a = tiltAngle;\r\n float si = sin(a), co = cos(a);\r\n uv *= mat2(co, -si, si, co);\r\n uv *= length(uv + vec2(0, 4.9)) * rainSize + 1.;\r\n float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);\r\n float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;\r\n c *= v * b;\r\n vFragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), .5);\r\n}",uniforms:{tiltAngle:()=>i.tiltAngle,rainSize:()=>i.rainSize,rainSpeed:()=>i.rainSpeed}}),n.postProcessStages.add(ki)},resetSunnyDay:t=>{let{scene:e}=t;Zi(t),e.skyAtmosphere.hueShift=0,e.skyAtmosphere.saturationShift=0,e.skyAtmosphere.brightnessShift=0,e.fog.density=25e-5,e.fog.minimumBrightness=.01},addGlslFog:(t,e)=>{Zi(t);let i=Object.assign({},Ni,e),{scene:n}=t;Fi=new Cesium.PostProcessStage({name:"glsl_fog",fragmentShader:"// 雾\r\nuniform sampler2D colorTexture;\r\nuniform sampler2D depthTexture;\r\nuniform float visibility;\r\nuniform vec4 fogColor;\r\nin vec2 v_textureCoordinates;\r\nout vec4 vFragColor;\r\nvoid main(void) {\r\n vec4 origcolor = texture(colorTexture, v_textureCoordinates);\r\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\r\n vec4 depthcolor = texture(depthTexture, v_textureCoordinates);\r\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\r\n if (f < 0.0) f = 0.0;\r\n else if (f > 1.0) f = 1.0;\r\n vFragColor = mix(origcolor, fogColor, f);\r\n}",uniforms:{visibility:()=>i.visibility,fogColor:()=>i.color}}),n.postProcessStages.add(Fi)},createWaterSmoke:(t,e,i)=>{Hi=Object.assign({},Hi,i),console.log("defaultOption",Hi);var n=new Cesium.ParticleSystem({image:"/img/smoke.png",startColor:Cesium.Color.WHITE.withAlpha(0),endColor:Cesium.Color.WHITE.withAlpha(.65),startScale:10,endScale:10,particleLife:5,minimumParticleLife:1.5,maximumParticleLife:1.7,minimumSpeed:1.5,maximumSpeed:2.5,imageSize:new Cesium.Cartesian2(3,3),sizeInMeters:!0,emissionRate:Hi.emissionRate,emitter:new Cesium.CircleEmitter(Hi.width),modelMatrix:ji(e),emitterModelMatrix:Wi(),updateCallback:Vi});t.scene.primitives.add(n)},createFire:(t,e,i)=>{Ui=t,Gi=Object.assign({},Gi,i);var n=new Cesium.ParticleSystem({image:"/img/fire.png",startColor:Cesium.Color.RED.withAlpha(.1),endColor:Cesium.Color.YELLOW.withAlpha(.5),startScale:2*Gi.scale,endScale:Gi.scale,minimumParticleLife:1.5,maximumParticleLife:2,minimumSpeed:29,maximumSpeed:30,imageSize:new Cesium.Cartesian2(1,1),sizeInMeters:!0,emissionRate:Gi.emissionRate,emitter:new Cesium.CircleEmitter(Gi.width),modelMatrix:Yi(e),emitterModelMatrix:Xi(),updateCallback:Gi.isWind?qi:null});Ui.scene.primitives.add(n)},addEntityGif:(t,e)=>{let i=Object.assign({},se,e),n=i.props,o=i.data||[];const r=i.style||{},s=i.text||{},a=void 0===i.show||i.show;let l=new Cesium.CustomDataSource(i.id);t.dataSources.add(l),o.forEach((t=>{let e=t[n.image];if(e&&t[n.lgtd]&&t[n.lttd]){let o=document.createElement("div"),h=document.createElement("img");o.appendChild(h),h.src=e,h.onload=()=>{let e=re({gif:h});e.load((()=>{var o=new Cesium.Entity({name:t.id,show:a,position:Cesium.Cartesian3.fromDegrees(t[n.lgtd],t[n.lttd]),billboard:Object.assign({image:new Cesium.CallbackProperty((()=>e.get_canvas().toDataURL("image/png")),!1),scale:t[n.scale]||i.scale,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,zIndex:0},r),label:s.show?Object.assign({text:t[n.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.fromCssColorString("#000000").withAlpha(1),outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},s.style):null,description:JSON.stringify(t)});l.entities.add(o)}))}}}))},addCloud:(t,e)=>{let i=Object.assign({},fi,e),n=i.props,o=i.data||[];var r=t.scene.primitives.add(new Cesium.CloudCollection);o.forEach((t=>{console.log("item",t),r.add({position:Cesium.Cartesian3.fromDegrees(t[n.lgtd],t[n.lttd],t.height),scale:new Cesium.Cartesian2(t.scaleX||i.scaleX,t.scaleY||i.scaleY),slice:t.slice||i.slice,maximumSize:new Cesium.Cartesian3(90,15,13),brightness:t.brightness||i.brightness})}))},addGlobalCloud:(t,e={},i=!1)=>{let n;_i=t,vi=Object.assign({},yi,e),console.log("cloudConfig",vi),i&&(n=new pi,n.add(vi,"cloudCover",0,1).name("云量"),n.add(vi,"cloudBase",0,1e4).name("云的底部高度"),n.add(vi,"cloudTop",0,2e4).name("云的顶部高度"),n.add(vi,"cloudThickness",0,8e3).name("云层厚度"),n.add(vi,"windSpeedRatio",0,.01,1e-4).name("风速"));let o=new Cesium.PostProcessStage({fragmentShader:"// 全球体积云\r\nprecision highp float;\r\nuniform float realPlanetRadius; //地球半径\r\nuniform float windSpeedRatio; //风速\r\nuniform float cloudCover; //云量\r\nuniform float cloudBase; //云的底部高度\r\nuniform float cloudTop; //云的顶部高度\r\nuniform vec3 windVector; //方向\r\nuniform float cloudThickness; //云层厚度\r\nuniform float cloudBaseRadius; //云层底部半径\r\nuniform float cloudTopRadius; //云层顶部半径\r\n\r\nconst float PI = 3.14159265359;\r\nconst float TWO_PI = 6.28318530718;\r\nconst float FOUR_PI = 12.5663706144;\r\n\r\n#define CLOUDS_MAX_LOD 1\r\n#define CLOUDS_MARCH_STEP 500.0 //外部每次步进\r\n#define CLOUDS_DENS_MARCH_STEP 100.0 //云内每次步进\r\n#define MAXIMUM_CLOUDS_STEPS 300 //最大步进次数\r\n#define CLOUDS_MAX_VIEWING_DISTANCE 250000.0\r\n\r\n//射线与球体相交 可参考 https://zhuanlan.zhihu.com/p/645281439\r\nvec2 raySphereIntersect(vec3 r0, vec3 rd, float sr) {\r\n float a = dot(rd, rd);\r\n float b = 2.0 * dot(rd, r0);\r\n float c = dot(r0, r0) - (sr * sr);\r\n float d = (b * b) - 4.0 * a * c;\r\n\r\n if (d < 0.0)\r\n return vec2(-1.0, -1.0);\r\n float squaredD = sqrt(d);\r\n\r\n return vec2((-b - squaredD) / (2.0 * a), (-b + squaredD) / (2.0 * a));\r\n}\r\n\r\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\r\n\r\nfloat isotropic() {\r\n return 0.07957747154594767; // 1.0 / (4.0 * PI);\r\n}\r\n\r\nfloat rayleigh(float costh) {\r\n return (3.0 / (16.0 * PI)) * (1.0 + pow(costh, 2.0));\r\n}\r\n\r\nfloat Schlick(float k, float costh) {\r\n return (1.0 - k * k) / (FOUR_PI * pow(1.0 - k * costh, 2.0));\r\n}\r\nfloat g = 0.9;\r\n\r\nfloat hash(float p) {\r\n p = fract(p * .1031);\r\n p *= p + 33.33;\r\n p *= p + p;\r\n return fract(p);\r\n}\r\n\r\n//噪声\r\nfloat noise(in vec3 x) {\r\n vec3 p = floor(x);\r\n vec3 f = fract(x);\r\n f = f * f * (3.0 - 2.0 * f);\r\n float n = p.x + p.y * 157.0 + 113.0 * p.z;\r\n return mix(mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),\r\n mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),\r\n mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),\r\n mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y),\r\n f.z);\r\n}\r\n\r\n//云的密度\r\nfloat cloudDensity(vec3 p, vec3 wind, int lod, inout float heightRatio) {\r\n float finalCoverage = cloudCover;\r\n if (finalCoverage <= 0.1) {\r\n return 0.0;\r\n }\r\n float height = length(p) - realPlanetRadius;\r\n heightRatio = (height - cloudBase) / cloudThickness;\r\n float positionResolution = 0.002;\r\n p = p * positionResolution + wind;\r\n float shape = noise(p * 0.3);\r\n float shapeHeight = noise(p * 0.05);\r\n float bn = 0.50000 * noise(p);\r\n p = p * 2.0;\r\n if (lod >= 1) {\r\n bn += 0.20000 * noise(p);\r\n p = p * 2.11;\r\n }\r\n float cumuloNimbus = saturate((shapeHeight - 0.5) * 2.0);\r\n cumuloNimbus *= saturate(1.0 - pow(heightRatio - 0.5, 2.0) * 4.0);\r\n float cumulus = saturate(1.0 - pow(heightRatio - 0.25, 2.0) * 25.0) * shapeHeight;\r\n float stratoCumulus = saturate(1.0 - pow(heightRatio - 0.12, 2.0) * 60.0) * (1.0 - shapeHeight);\r\n float dens = saturate(stratoCumulus + cumulus + cumuloNimbus) * 2.0 * finalCoverage;\r\n dens -= 1.0 - shape;\r\n dens -= bn;\r\n return clamp(dens, 0.0, 1.0);\r\n}\r\n\r\nprecision highp float;\r\nuniform sampler2D noiseTexture;\r\nin vec2 v_textureCoordinates;\r\nvec3 skyAmbientColor = vec3(0.705, 0.850, 0.952); // 0.219, 0.380, 0.541\r\nvec3 groundAmbientColor = vec3(0.741, 0.898, 0.823); // 0.639, 0.858, 0.721\r\nfloat distanceQualityR = 0.00005; // LOD/quality ratio\r\nfloat minDistance = 10.0; // avoid cloud in cockpit\r\n\r\nvec4 calculate_clouds(vec3 start, vec3 dir, float maxDistance, vec3 light_dir, vec3 wind) {\r\n vec4 cloud = vec4(0.0, 0.0, 0.0, 1.0);\r\n vec2 toTop = raySphereIntersect(start, dir, cloudTopRadius);\r\n vec2 toCloudBase = raySphereIntersect(start, dir, cloudBaseRadius);\r\n float startHeight = length(start) - realPlanetRadius;\r\n float absoluteMaxDistance = CLOUDS_MAX_VIEWING_DISTANCE;\r\n float tmin = minDistance;\r\n float tmax = maxDistance;\r\n\r\n if (startHeight > cloudTop) {\r\n if (toTop.x < 0.0)\r\n return vec4(0.0); // no intersection with cloud layer\r\n tmin = toTop.x;\r\n if (toCloudBase.x > 0.0) {\r\n tmax = min(toCloudBase.x, maxDistance);\r\n } else {\r\n tmax = min(toTop.y, maxDistance);\r\n }\r\n } else if (startHeight < cloudBase) {\r\n tmin = toCloudBase.y;\r\n tmax = min(toTop.y, maxDistance);\r\n } else {\r\n if (toCloudBase.x > 0.0) {\r\n tmax = min(toCloudBase.x, maxDistance);\r\n } else {\r\n tmax = min(toTop.y, maxDistance);\r\n }\r\n }\r\n\r\n tmin = max(tmin, minDistance);\r\n tmax = min(tmax, absoluteMaxDistance);\r\n\r\n if (tmax < tmin)\r\n return vec4(0.0); // object obstruction\r\n\r\n float rayLength = tmax - tmin; //步进总距离\r\n float longMarchStep = rayLength / float(MAXIMUM_CLOUDS_STEPS); //步进距离/步进次数=每次步进的距离\r\n longMarchStep = max(longMarchStep, CLOUDS_MARCH_STEP); //每次步进多少\r\n\r\n float shortMarchStep = CLOUDS_DENS_MARCH_STEP;\r\n float numberApproachSteps = (CLOUDS_MARCH_STEP / CLOUDS_DENS_MARCH_STEP) * 2.0;\r\n float distance = tmin; //\r\n float dens = 0.0;\r\n float marchStep;\r\n\r\n float lastDensity;\r\n float kInScattering = 0.99;\r\n float dotLightRay = dot(dir, light_dir);\r\n float inScattering = Schlick(kInScattering, dotLightRay);\r\n float outScattering = isotropic();\r\n float sunScatteringPhase = mix(outScattering, inScattering, dotLightRay);\r\n float ambientScatteringPhase = isotropic();\r\n bool inCloud = false;\r\n float stepsBeforeExitingCloud = 0.0;\r\n\r\n for (int i = 0; i < MAXIMUM_CLOUDS_STEPS; i++) {\r\n vec3 position = start + dir * distance;\r\n int qualityRatio = int(distance * distanceQualityR);\r\n int lod = CLOUDS_MAX_LOD - qualityRatio;\r\n float heightRatio;\r\n\r\n if (inCloud == true) {\r\n marchStep = shortMarchStep;\r\n } else {\r\n marchStep = longMarchStep;\r\n lod = 0;\r\n }\r\n\r\n dens = cloudDensity(position, wind, lod, heightRatio);\r\n\r\n if (dens > 0.01) {\r\n if (inCloud != true) {\r\n inCloud = true;\r\n stepsBeforeExitingCloud = numberApproachSteps;\r\n distance = clamp(distance - CLOUDS_MARCH_STEP, tmin,tmax); // 第一次进入云 回退一步\r\n continue;\r\n }\r\n\r\n float deltaDens = clamp((dens - lastDensity) * 10.0, -1.0, 1.0);\r\n float lighting = (abs(deltaDens - dotLightRay) / 2.0) * clamp((heightRatio - 0.02) * 20.0, 0.5, 1.0);\r\n lastDensity = dens;\r\n float scatteringCoeff = 0.15 * dens;\r\n float extinctionCoeff = 0.01 * dens;\r\n cloud.a *= exp(-extinctionCoeff * marchStep);\r\n float sunIntensityAtSurface = clamp(0.2 - dens, 0.0, 1.0);\r\n vec3 sunLight = lighting * czm_lightColor * sunIntensityAtSurface * czm_lightColor.z;\r\n vec3 ambientSun = czm_lightColor * sunIntensityAtSurface * czm_lightColor.z * isotropic();\r\n vec3 skyAmbientLight = (skyAmbientColor * czm_lightColor.z + ambientSun);\r\n vec3 groundAmbientLight = (groundAmbientColor * czm_lightColor.z * 0.5 + ambientSun);\r\n vec3 ambientLight = mix(groundAmbientLight, skyAmbientLight, heightRatio);\r\n vec3 stepScattering = scatteringCoeff * marchStep * (sunScatteringPhase * sunLight + ambientScatteringPhase * ambientLight);\r\n cloud.rgb += cloud.a * stepScattering;\r\n\r\n if (cloud.a < 0.01) {\r\n cloud.a = 0.0;\r\n break;\r\n }\r\n } else {\r\n if (stepsBeforeExitingCloud > 0.0) {\r\n stepsBeforeExitingCloud--;\r\n } else {\r\n inCloud = false;\r\n }\r\n }\r\n\r\n distance += marchStep;\r\n\r\n //步进距离超出总的距离 退出\r\n if (distance > tmax) {\r\n break;\r\n }\r\n }\r\n cloud.a = (1.0 - cloud.a);\r\n return cloud;\r\n}\r\n\r\nuniform sampler2D colorTexture;\r\nvoid main() {\r\n vec4 color = texture(colorTexture, v_textureCoordinates);\r\n vec4 rawDepthColor = texture(czm_globeDepthTexture, v_textureCoordinates);\r\n float depth = czm_unpackDepth(rawDepthColor);\r\n if (depth == 0.0) {\r\n depth = 1.0;\r\n }\r\n vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r\n vec4 worldCoordinate = czm_inverseView * positionEC;\r\n vec3 vWorldPosition = worldCoordinate.xyz / worldCoordinate.w;\r\n vec3 posToEye = vWorldPosition - czm_viewerPositionWC;\r\n vec3 direction = normalize(posToEye);\r\n vec3 lightDirection = normalize(czm_sunPositionWC);\r\n float distance = length(posToEye);\r\n\r\n if (depth == 1.0) {\r\n distance = CLOUDS_MAX_VIEWING_DISTANCE;\r\n }\r\n vec3 wind = windVector * czm_frameNumber * windSpeedRatio;\r\n vec4 clouds = calculate_clouds(\r\n czm_viewerPositionWC, // the position of the camera\r\n direction, // the camera vector (ray direction of this pixel)\r\n distance, // max dist, essentially the scene depth\r\n lightDirection, // light direction\r\n wind);\r\n clouds.rgb *= 3.0;\r\n color = mix(color, clouds, clouds.a * clouds.a);\r\n\r\n float exposure = 1.2;\r\n color = vec4(1.0 - exp(-exposure * color));\r\n out_FragColor = color;\r\n}",uniforms:{realPlanetRadius:6378137,windVector:vi.currentWindVectorWC,cloudCover:vi.cloudCover,cloudBase:vi.cloudBase,cloudTop:vi.cloudTop,cloudThickness:vi.cloudThickness,cloudBaseRadius:vi.cloudBaseRadius,cloudTopRadius:vi.cloudTopRadius,windSpeedRatio:vi.windSpeedRatio}});return _i.scene.postProcessStages.add(o),gi=o,setInterval((()=>{!function(){if(!_i.scene.context._us.globeDepthTexture)return;gi.uniforms.windVector=vi.currentWindVectorWC,gi.uniforms.cloudCover=vi.cloudCover,gi.uniforms.windSpeedRatio=vi.windSpeedRatio;let t=_i.camera.positionCartographic;t=_i.scene.globe.ellipsoid.cartographicToCartesian(new Cesium.Cartographic(t.longitude,t.latitude,0),new Cesium.Cartesian3);let e=Cesium.Cartesian3.magnitude(t),i=vi.cloudTop-vi.cloudBase,n=e+vi.cloudBase,o=n+i;gi.uniforms.realPlanetRadius=e,gi.uniforms.cloudBase=vi.cloudBase,gi.uniforms.cloudTop=vi.cloudTop,gi.uniforms.cloudThickness=i,gi.uniforms.cloudBaseRadius=n,gi.uniforms.cloudTopRadius=o}()}),1e3),n}},On={loadTile3d:(t,e,i=!0,n,o)=>new Promise((r=>{const s=Object.assign({maximumScreenSpaceError:10,maximumNumberOfLoadedTiles:1e3,maximumMemoryUsage:512,loadSiblings:!0},n);Cesium.Cesium3DTileset.fromUrl(e,s).then((e=>{if(o){const t=Cesium.Cartographic.fromCartesian(e.boundingSphere.center),i=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,0),n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,o),r=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3);e.modelMatrix=Cesium.Matrix4.fromTranslation(r)}t.scene.primitives.add(e),r(e),i&&t.flyTo(e)}))})),createModel:(t,e,i={},n={},o=!0)=>{console.log("opt",n);const r=Cesium.Cartesian3.fromDegrees(i.lng||0,i.lat||0,i.height||0),s=Cesium.Math.toRadians(i.heading||135),a=Cesium.Math.toRadians(i.pitch||0),l=Cesium.Math.toRadians(i.roll||0),h=new Cesium.HeadingPitchRoll(s,a,l),u=Cesium.Transforms.headingPitchRollQuaternion(r,h);console.log("opt",n);let c=new Cesium.CustomShader({lightingModel:null==n.lightingModel?Cesium.LightingModel.PBR:n.lightingModel});return new Promise((i=>{const s=t.entities.add({name:e,position:r,orientation:u,model:Object.assign({},{uri:e,customShader:c},n)});o&&(t.trackedEntity=s),i(s)}))}},zn={initFluidViewer:(t,e={},i={},n={},o=!0,r=!1)=>{un=Object.assign({},un,e),cn=Object.assign({},cn,i),mn=Object.assign({},dn,n),console.log("boxInfo, centerInfo",un,cn);let s=tn({boxInfo:un,center:cn});if(o){let e=s.entity;t.entities.add(e),t.flyTo(e)}ln=s.geometry,hn=s.modelMatrix;const a=((t,e)=>{const i=t.attributes.position.values,n=[];for(let r=0;r<i.length;r+=3){const t=new Cesium.Cartesian3(i[r],i[r+1],i[r+2]),o=Cesium.Matrix4.multiplyByPoint(e,t,new Cesium.Cartesian3);n.push(o)}const o=n.map((function(t){return Cesium.Cartographic.fromCartesian(t)}));return console.log("cartographicPositions",o),Cesium.Rectangle.fromCartographicArray(o)})(ln,hn);if(an=new Cesium.Camera(t.scene),an.frustum.near=.1,an.setView({destination:a}),r){const t=new pi;return t.addColor(mn,"color",0,1).name("水体颜色"),t.add(mn,"distance",1,8e3).name("水颜色融合度"),t.add(mn,"highStrength",0,5).name("水高光颜色强度"),t.add(mn,"fminX",0,800).name("喷水位置 x起点"),t.add(mn,"fmaxX",0,800).name("喷水位置 x终点"),t.add(mn,"fminY",0,800).name("喷水位置 y起点"),t.add(mn,"fmaxY",0,800).name("喷水位置 y终点"),t.add(mn,"fHeight",0,100).name("喷水高度"),t.add(mn,"strenght",0,1).name("水强度"),t.add(mn,"attenuation",.9,1,.001).name("水衰减"),t.add(mn,"initialWaterLevel",0,10).name("初始水位"),t.add(mn,"textureSize",500,1500).name("深度图大小"),t}},startFluid:(t,e=[])=>{const{positions:i}=$i(t,an,un.w,un.h,mn.textureSize);0==e.length&&(e=i.map((t=>Cesium.Cartographic.fromCartesian(t).height))),console.log("positionHeights",e);const n=new Float32Array(mn.textureSize*mn.textureSize*4);for(let u=0;u<mn.textureSize*mn.textureSize;u++){const t=e[u],i=en(t,un.h);n[4*u]=i[0],n[4*u+1]=i[1],n[4*u+2]=i[2],n[4*u+3]=i[3]}console.log("hightMap",n);const o=t.scene,r=o.context,s=new Cesium.Texture({context:r,pixelFormat:Cesium.PixelFormat.RGBA,pixelDataType:Cesium.PixelDatatype.FLOAT,source:{arrayBufferView:n,width:mn.textureSize,height:mn.textureSize},sampler:new Cesium.Sampler({minificationFilter:Cesium.TextureMinificationFilter.LINEAR,magnificationFilter:Cesium.TextureMagnificationFilter.LINEAR})}),a=new sn(r,s,ln,hn,un.h,mn);o.primitives.add(a.primitives.bufferA),o.primitives.add(a.primitives.bufferB),o.primitives.add(a.primitives.bufferC),o.primitives.add(a.primitives.bufferD);const l=Cesium.Matrix4.inverse(hn,new Cesium.Matrix4);let h=new Cesium.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\r\nuniform sampler2D depthTexture;\r\nin vec2 v_textureCoordinates;\r\nuniform mat4 inverse;\r\nuniform sampler2D bufferC;\r\nuniform float height;\r\nuniform float baseSize; //深度图大小\r\nuniform vec3 waterColor; // 水颜色\r\nuniform float waterDistance; // 水颜色距离\r\nuniform float highStrength; // 水高光颜色强度\r\n\r\nconst vec3 light = vec3(0., 4., 2.);\r\n\r\n//将输入的三维坐标转换为纹理坐标,然后从纹理中读取高度值\r\nvec2 getHeight(in vec3 p, bool real) {\r\n p = ((p / baseSize) + 1.0) * 0.5;\r\n vec2 h = texture(bufferC, p.xz).xy;\r\n h.y += h.x;\r\n return h - baseSize;\r\n}\r\n//根据距离计算雾的强度,并将雾色与原始颜色混合,生成最终的颜色值\r\nvec3 applyFog(in vec3 rgb, vec3 fogColor, in float distance) {\r\n float fogAmount = exp(-distance);\r\n return mix(fogColor, rgb, fogAmount);\r\n}\r\n//计算给定点 p 处的法线向量\r\nvec3 getNormal(in vec3 p, int comp) {\r\n float d = 1.;\r\n float base = baseSize;\r\n float size = 1.0 / float(baseSize);\r\n float hMid = getHeight(p, false)[comp] / base;\r\n float hRight = getHeight(p + vec3(d, 0, 0), false)[comp] / base;\r\n float hTop = getHeight(p + vec3(0, 0, d), false)[comp] / base;\r\n return normalize(\r\n cross(vec3(0, hTop - hMid, size), vec3(size, hRight - hMid, 0)));\r\n}\r\n\r\n// ro 光线的起始点(原点) rd: 光线的方向向量 rad:\r\n// 边界框的半径(实际上是指边界框的大小的一半) oN:\r\n// 输出参数,表示光线与边界框相交点处的法线向量\r\nvec2 boxIntersection(in vec3 ro, in vec3 rd, in vec3 rad, out vec3 oN) {\r\n vec3 m = 1.0 / rd;\r\n vec3 n = m * ro;\r\n vec3 k = abs(m) * rad;\r\n vec3 t1 = -n - k;\r\n vec3 t2 = -n + k;\r\n\r\n float tN = max(max(t1.x, t1.y), t1.z);\r\n float tF = min(min(t2.x, t2.y), t2.z);\r\n\r\n if (tN > tF || tF < 0.0)\r\n return vec2(-1.0); // no intersection\r\n\r\n oN = -sign(rd) * step(t1.yzx, t1.xyz) * step(t1.zxy, t1.xyz);\r\n\r\n return vec2(tN, tF);\r\n}\r\n\r\nvoid main() {\r\n // colorTexture: 颜色纹理图,即场景渲染的结果,或者上一个后处理的结果\r\n // v_textureCoordinates: 纹理坐标,纹理坐标的范围为(0,0)-(1,1)\r\n out_FragColor = texture(colorTexture, v_textureCoordinates);\r\n vec4 rawDepthColor = texture(czm_globeDepthTexture, v_textureCoordinates);\r\n //从深度图中获取深度\r\n float depth = czm_unpackDepth(rawDepthColor);\r\n if (depth == 0.0) {\r\n depth = 1.0;\r\n }\r\n //根据深度和纹理坐标获取像素在相机坐标系的值\r\n vec4 eyeCoordinate4 = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r\n vec3 eyeCoordinate3 = eyeCoordinate4.xyz / eyeCoordinate4.w;\r\n //将相机坐标系的值转为世界坐标系的值\r\n vec4 worldCoordinate4 = czm_inverseView * vec4(eyeCoordinate3, 1.);\r\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\r\n vec4 worldPos = inverse * vec4(worldCoordinate, 1.);\r\n vec4 cameraPos = inverse * vec4(czm_viewerPositionWC, 1.);\r\n vec3 vDirection = worldPos.xyz - cameraPos.xyz; //方向\r\n vec3 rayDir = normalize(vDirection);\r\n vec3 dim = vec3(height); //盒子长宽高\r\n vec3 box_min = vec3(0.) - dim / 2.;\r\n vec3 box_max = vec3(0.) + dim / 2.;\r\n vec3 n;\r\n vec3 ro = cameraPos.xyz;\r\n vec3 rd = rayDir;\r\n vec2 ret = boxIntersection(ro, rd, dim / 2., n);\r\n\r\n //除掉那些不与光线相交的物体 该代码会导致移动至水面时,水面会被隐藏掉\r\n // if (ret.x > 0.0) {\r\n vec3 pi = ro + rd * ret.x; // 获取当前点\r\n // Find Terrain\r\n vec3 tc;\r\n vec3 tn;\r\n float tt = ret.x;\r\n vec2 h = getHeight(pi, true); // 获取当前点的高度\r\n float spec;\r\n bool flag = false;\r\n vec3 currentColor = texture(colorTexture, v_textureCoordinates).rgb;\r\n if (pi.y < h.x) // 如果当前点高度低于采样到的地形高度\r\n {\r\n tn = n;\r\n tc = currentColor; // 获取当前点颜色\r\n flag = true;\r\n } else {\r\n // 使用ray marching算法获取地形高度\r\n for (int i = 0; i < 80; i++) {\r\n vec3 p = ro + rd * tt; // 获取当前点\r\n float h = p.y - getHeight(p, true).x; // 获取当前点高度和地形高度的差值\r\n if (h < 0.0002 ||\r\n tt > ret.y) // 如果差值小于0.0002或者当前点高度大于最大高度\r\n break;\r\n tt += h * 0.4; // 更新当前点高度\r\n }\r\n tc = currentColor; // 获取当前点颜色\r\n }\r\n\r\n if (tt > ret.y) // 如果当前点高度大于最大高度\r\n {\r\n tc = currentColor; // 获取当前点颜色\r\n flag = true;\r\n }\r\n\r\n // Find Water\r\n float wt = ret.x;\r\n h = getHeight(pi, true); // 获取当前点的高度\r\n vec3 waterNormal; // 水法线\r\n if (pi.y < h.y) // 如果当前点高度低于采样到的水高度\r\n {\r\n waterNormal = n; // 获取水法线\r\n } else {\r\n // 使用ray marching算法获取水高度\r\n for (int i = 0; i < 80; i++) {\r\n vec3 p = ro + rd * wt; // 获取当前点\r\n float h = p.y - getHeight(p, true).y; // 获取当前点高度和水高度的差值\r\n if (h < 0.0002 || wt > min(tt, ret.y)) // 如果差值小于0.0002或者当前点高度大于最大高度\r\n break;\r\n wt += h * 0.4; // 更新当前点高度\r\n }\r\n waterNormal = getNormal(ro + rd * wt, 1); // 获取当前点法线\r\n }\r\n\r\n if (wt < ret.y) {\r\n float dist = (min(tt, ret.y) - wt); // 获取水深\r\n vec3 p = waterNormal;\r\n vec3 lightDir = normalize(light - (ro + rd * wt) / 1000.); // 光线方向\r\n\r\n //控制水流颜色\r\n vec3 wColor = waterColor == vec3(0.0) ? vec3(0, 0, 0.6) : waterColor; //若没有设置颜色,则默认为蓝色\r\n float distance = waterDistance == 0.0 ? 1000.0 : waterDistance; // 若没有设置距离,则默认为1000.0\r\n\r\n tc = applyFog(tc, pow(wColor, vec3(1. / 2.2)), dist * 15. / distance); // 雾效果\r\n\r\n float spec = pow(max(0., dot(lightDir, reflect(rd, waterNormal))), 20.0); // 高光\r\n tc += highStrength * spec * smoothstep(0.0, 0.1, dist); // 高光颜色\r\n }\r\n\r\n if (flag) {\r\n return;\r\n }\r\n out_FragColor = vec4(tc, 1.0); // 输出颜色\r\n // }\r\n}",uniforms:{inverse:l,bufferC:a.textures.nextBufferAColor,height:un.h,baseSize:un.h/2,waterColor:()=>(t=>{const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?new Cesium.Color(parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255):null})(mn.color),waterDistance:()=>mn.distance,highStrength:()=>mn.highStrength}});t.scene.postProcessStages.add(h)}},kn=Cesium;t.Cesium=kn,t.Popup=class{constructor(t){this.options=t,this.viewer=t.viewer,this.className=t.className,this.html=t.html||null,this.type=t.type||1,this.animate=t.animate||!1,this.isClose=null==t.isClose||t.isClose,this.onClose=t.onClose||null,this.onCloseAll=t.onCloseAll||null,this.id=0,this.ctnList={},t.position&&(t.html||t.content)&&this.add(t)}add(t){var e=t.position,i="popup_"+(65536*(1+Math.random())|0).toString(16)+this.id,n=document.createElement("div");let o=this.className||t.className;return n.className="cesium-popup-container"+(o?" "+o:""),n.id=i,n.addEventListener("click",this.handleFloatingClick),document.getElementById(this.viewer.container.id).appendChild(n),n.innerHTML=this.createHtml(t.html,t.content,t.type,t.animate),this.ctnList[i]=[e,n],this.render(),this.eventListener||(this.eventListener=()=>this.render(),this.viewer.clock.onTick.addEventListener(this.eventListener)),this.isClose&&n.getElementsByClassName("bx-popup-close")&&n.getElementsByClassName("bx-popup-close").length>0&&(n.getElementsByClassName("bx-popup-close")[0].onclick=()=>{this.close(n)}),n}render(){for(var t in this.ctnList){var e=Cesium.SceneTransforms.worldToWindowCoordinates(this.viewer.scene,this.ctnList[t][0]);e&&e.x&&e.y&&(Math.abs(e.x)>2*window.innerWidth||Math.abs(e.y)>2*window.innerHeight?this.ctnList[t][1].style.display="none":(this.ctnList[t][1].style.display="",this.ctnList[t][1].style.left=e.x+"px",this.ctnList[t][1].style.top=e.y+"px"))}}handleFloatingClick(t){console.log("Floating div clicked!"),t.stopPropagation()}createHtml(t,e,i,n){if(t=t||this.html)return t;if(e){i=i||this.type;let o=(n=n||this.animate)?" moveAnimate":"";return t=1==i?`\n ${!1===this.isClose?"":'<div class="bx-popup-close"><span class="iconfont_DEU icon-guanbi">×</span></div>'}\n <div class="popup-wrap ${o}">\n <div class="popup-border">\n <div class="popup-center">\n <div class="bx-popup-header-ctn">\n ${e.header}\n </div>\n <div class="bx-popup-content-ctn" >\n <div class="bx-popup-content" >\n ${e.content}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="directional"></div>\n `:2==i?`<div class="popup-bg2 ${o}"><div> ${e}</div></div>`:3==i?`<div class="popup-bg3 ${o}"><div> ${e}</div></div>`:4==i?`<div class="popup-bg4 ${o}"><div> ${e}</div></div>`:5==i?`<div class="popup-bg5 ${o}"><div> ${e}</div></div>`:`<div class="popup-bg6 ${o}"><div> ${e}</div></div>`}}close(t){t.remove(),t.removeEventListener("click",this.handleFloatingClick),"function"==typeof this.onClose&&this.onClose(t),delete this.ctnList[t.id],0==Object.keys(this.ctnList).length&&(this.eventListener&&this.viewer.clock.onTick.removeEventListener(this.eventListener),this.eventListener=null)}closeAll(){for(var t in this.ctnList)this.ctnList[t][1].remove(),this.ctnList[t][1].removeEventListener("click",this.handleFloatingClick);this.ctnList={},this.eventListener&&this.viewer.clock.onTick.removeEventListener(this.eventListener),this.eventListener=null,"function"==typeof this.onCloseAll&&this.onCloseAll()}},t.cesiumMap=_t,t.fluidUtils=zn,t.mapDraw=An,t.mapLayers=En,t.mapPopup=Cn,t.mapUtils=Mn,t.miniMap=vn,t.modelUtils=On,t.pageLoad=Ln,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
5
+ */!function(t,e){!function(t){var e="1.9.4";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return"_leaflet_id"in t||(t._leaflet_id=++r),t._leaflet_id}function a(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function l(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function h(){return!1}function u(t,e){if(!1===e)return t;var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function d(t){return c(t).split(/\s+/)}function m(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function p(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var f=/\{ *([\w_ -]+) *\}/g;function _(t,e){return t.replace(f,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var y="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function C(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var x=0;function w(t){var e=+new Date,i=Math.max(0,16-(e-x));return x=e+i,window.setTimeout(t,i)}var b=window.requestAnimationFrame||C("RequestAnimationFrame")||w,S=window.cancelAnimationFrame||C("CancelAnimationFrame")||C("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function T(t,e,i){if(!i||b!==w)return b.call(window,o(t,e));t.call(e)}function P(t){t&&S.call(window,t)}var M={__proto__:null,extend:i,create:n,bind:o,get lastId(){return r},stamp:s,throttle:a,wrapNum:l,falseFn:h,formatNum:u,trim:c,splitWords:d,setOptions:m,getParamString:p,template:_,isArray:g,indexOf:v,emptyImageUrl:y,requestFn:b,cancelFn:S,requestAnimFrame:T,cancelAnimFrame:P};function E(){}function A(t){if("undefined"!=typeof L&&L&&L.Mixin){t=g(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}E.extend=function(t){var e=function(){m(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=n(o);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&i(e,t.statics),t.includes&&(A(t.includes),i.apply(null,[r].concat(t.includes))),i(r,t),delete r.statics,delete r.includes,r.options&&(r.options=o.options?n(o.options):{},i(r.options,t.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},E.include=function(t){var e=this.prototype.options;return i(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},E.mergeOptions=function(t){return i(this.prototype.options,t),this},E.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=d(t);for(var o=1===arguments.length,r=0,s=t.length;r<s;r++)o?this._off(t[r]):this._off(t[r],e,i)}else delete this._events;return this},_on:function(t,e,i,n){if("function"==typeof e){if(!1===this._listens(t,e,i)){i===this&&(i=void 0);var o={fn:e,ctx:i};n&&(o.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(o)}}else console.warn("wrong listener type: "+typeof e)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(1!==arguments.length)if("function"==typeof e){var s=this._listens(t,e,i);if(!1!==s){var a=n[s];this._firingCount&&(a.fn=h,this._events[t]=n=n.slice()),n.splice(s,1)}}else console.warn("wrong listener type: "+typeof e);else{if(this._firingCount)for(o=0,r=n.length;o<r;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,n){if(!this.listens(t,n))return this;var o=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var l=r[s],h=l.fn;l.once&&this.off(t,h,l.ctx),h.call(l.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e;"function"!=typeof e&&(n=!!e,o=void 0,i=void 0);var r=this._events&&this._events[t];if(r&&r.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var s in this._eventParents)if(this._eventParents[s].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(!this._events)return!1;var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,r=n.length;o<r;o++)if(n[o].fn===e&&n[o].ctx===i)return o;return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,r=(t=d(t)).length;o<r;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var z=E.extend(O);function k(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof k?t:g(t)?new k(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new k(t.x,t.y):new k(t,e,i)}function D(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof D?t:new D(t,e)}function F(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function N(t,e){return t instanceof F?t:new F(t,e)}function Z(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function H(t,e,i){return t instanceof Z?t:g(t)&&"object"!=typeof t[0]?3===t.length?new Z(t[0],t[1],t[2]):2===t.length?new Z(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new Z(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new Z(t,e,i)}k.prototype={clone:function(){return new k(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new k(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new k(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}},D.prototype={extend:function(t){var e,i;if(!t)return this;if(t instanceof k||"number"==typeof t[0]||"x"in t)e=i=B(t);else if(e=(t=R(t)).min,i=t.max,!e||!i)return this;return this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone()),this},getCenter:function(t){return B((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return B(this.min.x,this.max.y)},getTopRight:function(){return B(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof k?B(t):R(t))instanceof D?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>=e.x&&n.x<=i.x,s=o.y>=e.y&&n.y<=i.y;return r&&s},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max,r=o.x>e.x&&n.x<i.x,s=o.y>e.y&&n.y<i.y;return r&&s},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,o=Math.abs(e.y-i.y)*t;return R(B(e.x-n,e.y-o),B(i.x+n,i.y+o))},equals:function(t){return!!t&&(t=R(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},F.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof Z)e=t,i=t;else{if(!(t instanceof F))return t?this.extend(H(t)||N(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new Z(e.lat,e.lng),this._northEast=new Z(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new F(new Z(e.lat-n,e.lng-o),new Z(i.lat+n,i.lng+o))},getCenter:function(){return new Z((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Z(this.getNorth(),this.getWest())},getSouthEast:function(){return new Z(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof Z||"lat"in t?H(t):N(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof F?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=N(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>=e.lat&&n.lat<=i.lat,s=o.lng>=e.lng&&n.lng<=i.lng;return r&&s},overlaps:function(t){t=N(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),r=o.lat>e.lat&&n.lat<i.lat,s=o.lng>e.lng&&n.lng<i.lng;return r&&s},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=N(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},Z.prototype={equals:function(t,e){return!!t&&(t=H(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+u(this.lat,t)+", "+u(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,H(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return N([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new Z(this.lat,this.lng,this.alt)}};var j,W={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new D(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?l(t.lng,this.wrapLng,!0):t.lng;return new Z(this.wrapLat?l(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new F(new Z(r.lat-n,r.lng-o),new Z(s.lat-n,s.lng-o))}},V=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,l=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*l}}),U=6378137,G={R:U,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new k(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new Z((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(j=U*Math.PI,new D([-j,-j],[j,j]))};function Y(t,e,i,n){if(g(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function X(t,e,i,n){return new Y(t,e,i,n)}Y.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new k((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var q,K=i({},V,{code:"EPSG:3857",projection:G,transformation:(q=.5/(Math.PI*G.R),X(q,.5,-q,.5))}),J=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function $(t,e){var i,n,o,r,s,a,l="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(s=t[i]).length;n<r;n++)l+=(n?"L":"M")+(a=s[n]).x+" "+a.y;l+=e?Nt.svg?"z":"x":""}return l||"M0 0"}var tt,et=document.documentElement.style,it="ActiveXObject"in window,nt=it&&!document.addEventListener,ot="msLaunchUri"in navigator&&!("documentMode"in document),rt=Ft("webkit"),st=Ft("android"),at=Ft("android 2")||Ft("android 3"),lt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ht=st&&Ft("Google")&&lt<537&&!("AudioNode"in window),ut=!!window.opera,ct=!ot&&Ft("chrome"),dt=Ft("gecko")&&!rt&&!ut&&!it,mt=!ct&&Ft("safari"),pt=Ft("phantom"),ft="OTransition"in et,_t=0===navigator.platform.indexOf("Win"),gt=it&&"transition"in et,vt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!at,yt="MozPerspective"in et,Ct=!window.L_DISABLE_3D&&(gt||vt||yt)&&!ft&&!pt,xt="undefined"!=typeof orientation||Ft("mobile"),wt=xt&&rt,bt=xt&&vt,St=!window.PointerEvent&&window.MSPointerEvent,Tt=!(!window.PointerEvent&&!St),Pt="ontouchstart"in window||!!window.TouchEvent,Lt=!window.L_NO_TOUCH&&(Pt||Tt),Mt=xt&&ut,Et=xt&&dt,At=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),zt=!!document.createElement("canvas").getContext,kt=!(!document.createElementNS||!Q("svg").createSVGRect),It=!!kt&&((tt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(tt.firstChild&&tt.firstChild.namespaceURI)),Bt=!kt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}(),Dt=0===navigator.platform.indexOf("Mac"),Rt=0===navigator.platform.indexOf("Linux");function Ft(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Nt={ie:it,ielt9:nt,edge:ot,webkit:rt,android:st,android23:at,androidStock:ht,opera:ut,chrome:ct,gecko:dt,safari:mt,phantom:pt,opera12:ft,win:_t,ie3d:gt,webkit3d:vt,gecko3d:yt,any3d:Ct,mobile:xt,mobileWebkit:wt,mobileWebkit3d:bt,msPointer:St,pointer:Tt,touch:Lt,touchNative:Pt,mobileOpera:Mt,mobileGecko:Et,retina:At,passiveEvents:Ot,canvas:zt,svg:kt,vml:Bt,inlineSvg:It,mac:Dt,linux:Rt},Zt=Nt.msPointer?"MSPointerDown":"pointerdown",Ht=Nt.msPointer?"MSPointerMove":"pointermove",jt=Nt.msPointer?"MSPointerUp":"pointerup",Wt=Nt.msPointer?"MSPointerCancel":"pointercancel",Vt={touchstart:Zt,touchmove:Ht,touchend:jt,touchcancel:Wt},Ut={touchstart:ee,touchmove:te,touchend:te,touchcancel:te},Gt={},Yt=!1;function Xt(t,e,i){return"touchstart"===e&&$t(),Ut[e]?(i=Ut[e].bind(this,i),t.addEventListener(Vt[e],i,!1),i):(console.warn("wrong event specified:",e),h)}function qt(t,e,i){Vt[e]?t.removeEventListener(Vt[e],i,!1):console.warn("wrong event specified:",e)}function Kt(t){Gt[t.pointerId]=t}function Jt(t){Gt[t.pointerId]&&(Gt[t.pointerId]=t)}function Qt(t){delete Gt[t.pointerId]}function $t(){Yt||(document.addEventListener(Zt,Kt,!0),document.addEventListener(Ht,Jt,!0),document.addEventListener(jt,Qt,!0),document.addEventListener(Wt,Qt,!0),Yt=!0)}function te(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Gt)e.touches.push(Gt[i]);e.changedTouches=[e],t(e)}}function ee(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&Ke(e),te(t,e)}function ie(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var ne=200;function oe(t,e){t.addEventListener("dblclick",e);var i,n=0;function o(t){if(1===t.detail){if("mouse"!==t.pointerType&&(!t.sourceCapabilities||t.sourceCapabilities.firesTouchEvents)){var o=Qe(t);if(!o.some((function(t){return t instanceof HTMLLabelElement&&t.attributes.for}))||o.some((function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement}))){var r=Date.now();r-n<=ne?2==++i&&e(ie(t)):i=1,n=r}}}else i=t.detail}return t.addEventListener("click",o),{dblclick:e,simDblclick:o}}function re(t,e){t.removeEventListener("dblclick",e.dblclick),t.removeEventListener("click",e.simDblclick)}var se,ae,le,he,ue,ce=Me(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),de=Me(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),me="webkitTransition"===de||"OTransition"===de?de+"End":"transitionend";function pe(t){return"string"==typeof t?document.getElementById(t):t}function fe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function _e(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ge(t){var e=t.parentNode;e&&e.removeChild(t)}function ve(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ye(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function Ce(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function xe(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Te(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function we(t,e){if(void 0!==t.classList)for(var i=d(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!xe(t,e)){var r=Te(t);Se(t,(r?r+" ":"")+e)}}function be(t,e){void 0!==t.classList?t.classList.remove(e):Se(t,c((" "+Te(t)+" ").replace(" "+e+" "," ")))}function Se(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function Te(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function Pe(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&Le(t,e)}function Le(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function Me(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Ee(t,e,i){var n=e||new k(0,0);t.style[ce]=(Nt.ie3d?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Ae(t,e){t._leaflet_pos=e,Nt.any3d?Ee(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Oe(t){return t._leaflet_pos||new k(0,0)}if("onselectstart"in document)se=function(){Ze(window,"selectstart",Ke)},ae=function(){je(window,"selectstart",Ke)};else{var ze=Me(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);se=function(){if(ze){var t=document.documentElement.style;le=t[ze],t[ze]="none"}},ae=function(){ze&&(document.documentElement.style[ze]=le,le=void 0)}}function ke(){Ze(window,"dragstart",Ke)}function Ie(){je(window,"dragstart",Ke)}function Be(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(De(),he=t,ue=t.style.outlineStyle,t.style.outlineStyle="none",Ze(window,"keydown",De))}function De(){he&&(he.style.outlineStyle=ue,he=void 0,ue=void 0,je(window,"keydown",De))}function Re(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Fe(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ne={__proto__:null,TRANSFORM:ce,TRANSITION:de,TRANSITION_END:me,get:pe,getStyle:fe,create:_e,remove:ge,empty:ve,toFront:ye,toBack:Ce,hasClass:xe,addClass:we,removeClass:be,setClass:Se,getClass:Te,setOpacity:Pe,testProp:Me,setTransform:Ee,setPosition:Ae,getPosition:Oe,get disableTextSelection(){return se},get enableTextSelection(){return ae},disableImageDrag:ke,enableImageDrag:Ie,preventOutline:Be,restoreOutline:De,getSizedParentNode:Re,getScale:Fe};function Ze(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)Ue(t,o,e[o],i);else for(var r=0,s=(e=d(e)).length;r<s;r++)Ue(t,e[r],i,n);return this}var He="_leaflet_events";function je(t,e,i,n){if(1===arguments.length)We(t),delete t[He];else if(e&&"object"==typeof e)for(var o in e)Ge(t,o,e[o],i);else if(e=d(e),2===arguments.length)We(t,(function(t){return-1!==v(e,t)}));else for(var r=0,s=e.length;r<s;r++)Ge(t,e[r],i,n);return this}function We(t,e){for(var i in t[He]){var n=i.split(/\d/)[0];e&&!e(n)||Ge(t,n,null,null,i)}}var Ve={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function Ue(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):"");if(t[He]&&t[He][o])return this;var r=function(e){return i.call(n||t,e||window.event)},a=r;!Nt.touchNative&&Nt.pointer&&0===e.indexOf("touch")?r=Xt(t,e,r):Nt.touch&&"dblclick"===e?r=oe(t,r):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ve[e]||e,r,!!Nt.passiveEvents&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(r=function(e){e=e||window.event,ii(t,e)&&a(e)},t.addEventListener(Ve[e],r,!1)):t.addEventListener(e,a,!1):t.attachEvent("on"+e,r),t[He]=t[He]||{},t[He][o]=r}function Ge(t,e,i,n,o){o=o||e+s(i)+(n?"_"+s(n):"");var r=t[He]&&t[He][o];if(!r)return this;!Nt.touchNative&&Nt.pointer&&0===e.indexOf("touch")?qt(t,e,r):Nt.touch&&"dblclick"===e?re(t,r):"removeEventListener"in t?t.removeEventListener(Ve[e]||e,r,!1):t.detachEvent("on"+e,r),t[He][o]=null}function Ye(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Xe(t){return Ue(t,"wheel",Ye),this}function qe(t){return Ze(t,"mousedown touchstart dblclick contextmenu",Ye),t._leaflet_disable_click=!0,this}function Ke(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Je(t){return Ke(t),Ye(t),this}function Qe(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function $e(t,e){if(!e)return new k(t.clientX,t.clientY);var i=Fe(e),n=i.boundingClientRect;return new k((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var ti=Nt.linux&&Nt.chrome?window.devicePixelRatio:Nt.mac?3*window.devicePixelRatio:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function ei(t){return Nt.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/ti:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function ii(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t}var ni={__proto__:null,on:Ze,off:je,stopPropagation:Ye,disableScrollPropagation:Xe,disableClickPropagation:qe,preventDefault:Ke,stop:Je,getPropagationPath:Qe,getMousePosition:$e,getWheelDelta:ei,isExternalTarget:ii,addListener:Ze,removeListener:je},oi=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Oe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=T(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Ae(this._el,i),this.fire("step")},_complete:function(){P(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ri=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=m(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(H(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=de&&Nt.any3d&&!Nt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ze(this._proxy,me,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(H(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e,n.pan&&n.pan.noMoveStart),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(Nt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(Nt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof k?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():N(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=N(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new oi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){we(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!Nt.any3d)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=H(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),l=a*this.getZoomScale(s,e),h=o.distanceTo(n)||1,u=1.42,c=u*u;function d(t){var e=(l*l-a*a+(t?-1:1)*c*c*h*h)/(2*(t?l:a)*c*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function m(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}function f(t){return m(t)/p(t)}var _=d(0);function g(t){return a*(p(_)/p(_+u*t))}function v(t){return a*(p(_)*f(_+u*t)-m(_))/c}function y(t){return 1-Math.pow(1-t,1.5)}var C=Date.now(),x=(d(1)-_)/u,w=i.duration?1e3*i.duration:1e3*x*.8;function b(){var i=(Date.now()-C)/w,r=y(i)*x;i<=1?(this._flyToFrame=T(b,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(v(r)/h)),s),this.getScaleZoom(a/g(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),b.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return t=N(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,N(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),r=this.project(t),s=this.getPixelBounds(),a=R([s.min.add(i),s.max.subtract(n)]),l=a.getSize();if(!a.contains(r)){this._enforcingBounds=!0;var h=r.subtract(a.getCenter()),u=a.extend(r).getSize().subtract(l);o.x+=h.x<0?-u.x:u.x,o.y+=h.y<0?-u.y:u.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=e.divideBy(2).round(),s=n.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e=new Z(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)}},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(P(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ge(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=_e("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new F(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=N(t),i=B(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),l=this.getSize().subtract(i),h=R(this.project(a,n),this.project(s,n)).getSize(),u=Nt.any3d?this.options.zoomSnap:1,c=l.x/h.x,d=l.y/h.y,m=e?Math.max(c,d):Math.min(c,d);return n=this.getScaleZoom(m,n),u&&(n=Math.round(n/(u/100))*(u/100),n=e?Math.ceil(n/u)*u:Math.floor(n/u)*u),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new k(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new D(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs;e=void 0===e?this._zoom:e;var n=i.zoom(t*i.scale(e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(H(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(H(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(H(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(N(t))},distance:function(t,e){return this.options.crs.distance(H(t),H(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(H(t)))},mouseEventToContainerPoint:function(t){return $e(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=pe(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ze(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&Nt.any3d,we(t,"leaflet-container"+(Nt.touch?" leaflet-touch":"")+(Nt.retina?" leaflet-retina":"")+(Nt.ielt9?" leaflet-oldie":"")+(Nt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=fe(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Ae(this._mapPane,new k(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(we(t.markerPane,"leaflet-zoom-hide"),we(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Ae(this._mapPane,new k(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return P(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Ae(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?je:Ze;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),Nt.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){P(this._resizeRequest),this._resizeRequest=T((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!ii(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!this.listens(e,!0)||(n=[this]),n},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e=t.target||t.srcElement;if(!(!this._loaded||e._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(e))){var i=t.type;"mousedown"===i&&Be(e),this._fireDOMEvent(t,i)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}var r=this._findEventTargets(t,e);if(n){for(var s=[],a=0;a<n.length;a++)n[a].listens(e,!0)&&s.push(n[a]);r=s.concat(r)}if(r.length){"contextmenu"===e&&Ke(t);var l=r[0],h={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var u=l.getLatLng&&(!l._radius||l._radius<=10);h.containerPoint=u?this.latLngToContainerPoint(l.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=u?l.getLatLng():this.layerPointToLatLng(h.layerPoint)}for(a=0;a<r.length;a++)if(r[a].fire(e,h,!0),h.originalEvent._stopped||!1===r[a].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Oe(this._mapPane)||new k(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new D(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,e);return Math.abs(s.x)<=1&&Math.abs(s.y)<=1?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new D(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new k(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=Nt.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){be(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=_e("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=ce,i=this._proxy.style[e];Ee(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Ee(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(T((function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,we(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&be(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function si(t,e){return new ri(t,e)}var ai=E.extend({options:{position:"topright"},initialize:function(t){m(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return we(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),li=function(t){return new ai(t)};ri.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=_e("div",e+"control-container",this._container);function n(n,o){var r=e+n+" "+e+o;t[n+o]=_e("div",r,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ge(this._controlCorners[t]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var hi=ai.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in m(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ai.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){we(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(we(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):be(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return be(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=_e("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),qe(e),Xe(e);var n=this._section=_e("section",t+"-list");i&&(this._map.on("click",this.collapse,this),Ze(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var o=this._layersLink=_e("a",t+"-toggle",e);o.href="#",o.title="Layers",o.setAttribute("role","button"),Ze(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){Ke(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=_e("div",t+"-base",n),this._separator=_e("div",t+"-separator",n),this._overlaysList=_e("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(o((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;ve(this._baseLayersList),ve(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)n=this._layers[i],this._addItem(n),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(t=t&&o>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(e),e.layerId=s(t.layer),Ze(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("span");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)t=i[r],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,Ze(t,"click",Ke),this.expand();var e=this;setTimeout((function(){je(t,"click",Ke),e._preventClick=!1}))}}),ui=function(t,e,i){return new hi(t,e,i)},ci=ai.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=_e("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=_e("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),qe(r),Ze(r,"click",Je),Ze(r,"click",o,this),Ze(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";be(this._zoomInButton,e),be(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(we(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(we(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}});ri.mergeOptions({zoomControl:!0}),ri.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ci,this.addControl(this.zoomControl))}));var di=function(t){return new ci(t)},mi=ai.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=_e("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=_e("div",e,i)),t.imperial&&(this._iScale=_e("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(e=o/5280,i=this._getRoundNum(e),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),pi=function(t){return new mi(t)},fi='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',_i=ai.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Nt.inlineSvg?fi+" ":"")+"Leaflet</a>"},initialize:function(t){m(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=_e("div","leaflet-control-attribution"),qe(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",(function(){this.removeAttribution(t.layer.getAttribution())}),this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}});ri.mergeOptions({attributionControl:!0}),ri.addInitHook((function(){this.options.attributionControl&&(new _i).addTo(this)}));var gi=function(t){return new _i(t)};ai.Layers=hi,ai.Zoom=ci,ai.Scale=mi,ai.Attribution=_i,li.layers=ui,li.zoom=di,li.scale=pi,li.attribution=gi;var vi=E.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});vi.addTo=function(t,e){return t.addHandler(e,this),this};var yi={Events:O},Ci=Nt.touch?"touchstart mousedown":"mousedown",xi=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){m(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ze(this._dragStartTarget,Ci,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(xi._dragging===this&&this.finishDrag(!0),je(this._dragStartTarget,Ci,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!xe(this._element,"leaflet-zoom-anim")))if(t.touches&&1!==t.touches.length)xi._dragging===this&&this.finishDrag();else if(!(xi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(xi._dragging=this,this._preventOutline&&Be(this._element),ke(),se(),this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Re(this._element);this._startPoint=new k(e.clientX,e.clientY),this._startPos=Oe(this._element),this._parentScale=Fe(i);var n="mousedown"===t.type;Ze(document,n?"mousemove":"touchmove",this._onMove,this),Ze(document,n?"mouseup":"touchend touchcancel",this._onUp,this)}},_onMove:function(t){if(this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new k(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,Ke(t),this._moved||(this.fire("dragstart"),this._moved=!0,we(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),we(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,this._lastEvent=t,this._updatePosition()))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Ae(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){be(document.body,"leaflet-dragging"),this._lastTarget&&(be(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),je(document,"mousemove touchmove",this._onMove,this),je(document,"mouseup touchend touchcancel",this._onUp,this),Ie(),ae();var e=this._moved&&this._moving;this._moving=!1,xi._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function wi(t,e,i){var n,o,r,s,a,l,h,u,c,d=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Bi(t[o],e);for(s=0;s<4;s++){for(u=d[s],n=[],o=0,r=(h=t.length)-1;o<h;r=o++)a=t[o],l=t[r],a._code&u?l._code&u||((c=Ii(l,a,u,e,i))._code=Bi(c,e),n.push(c)):(l._code&u&&((c=Ii(l,a,u,e,i))._code=Bi(c,e),n.push(c)),n.push(a));t=n}return t}function bi(t,e){var i,n,o,r,s,a,l,h,u;if(!t||0===t.length)throw new Error("latlngs not passed");Fi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var c=H([0,0]),d=N(t);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(c=Si(t));var m=t.length,p=[];for(i=0;i<m;i++){var f=H(t[i]);p.push(e.project(H([f.lat-c.lat,f.lng-c.lng])))}for(a=l=h=0,i=0,n=m-1;i<m;n=i++)o=p[i],r=p[n],s=o.y*r.x-r.y*o.x,l+=(o.x+r.x)*s,h+=(o.y+r.y)*s,a+=3*s;u=0===a?p[0]:[l/a,h/a];var _=e.unproject(B(u));return H([_.lat+c.lat,_.lng+c.lng])}function Si(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var r=H(t[o]);e+=r.lat,i+=r.lng,n++}return H([e/n,i/n])}var Ti,Pi={__proto__:null,clipPolygon:wi,polygonCenter:bi,centroid:Si};function Li(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Ai(t=zi(t,i),i)}function Mi(t,e,i){return Math.sqrt(Ri(t,e,i,!0))}function Ei(t,e,i){return Ri(t,e,i)}function Ai(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Oi(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}function Oi(t,e,i,n,o){var r,s,a,l=0;for(s=n+1;s<=o-1;s++)(a=Ri(t[s],t[n],t[o],!0))>l&&(r=s,l=a);l>i&&(e[r]=1,Oi(t,e,i,n,r),Oi(t,e,i,r,o))}function zi(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)Di(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<r-1&&i.push(t[r-1]),i}function ki(t,e,i,n,o){var r,s,a,l=n?Ti:Bi(t,i),h=Bi(e,i);for(Ti=h;;){if(!(l|h))return[t,e];if(l&h)return!1;a=Bi(s=Ii(t,e,r=l||h,i,o),i),r===l?(t=s,l=a):(e=s,h=a)}}function Ii(t,e,i,n,o){var r,s,a=e.x-t.x,l=e.y-t.y,h=n.min,u=n.max;return 8&i?(r=t.x+a*(u.y-t.y)/l,s=u.y):4&i?(r=t.x+a*(h.y-t.y)/l,s=h.y):2&i?(r=u.x,s=t.y+l*(u.x-t.x)/a):1&i&&(r=h.x,s=t.y+l*(h.x-t.x)/a),new k(r,s,o)}function Bi(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Di(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function Ri(t,e,i,n){var o,r=e.x,s=e.y,a=i.x-r,l=i.y-s,h=a*a+l*l;return h>0&&((o=((t.x-r)*a+(t.y-s)*l)/h)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=l*o)),a=t.x-r,l=t.y-s,n?a*a+l*l:new k(r,s)}function Fi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ni(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Fi(t)}function Zi(t,e){var i,n,o,r,s,a,l,h;if(!t||0===t.length)throw new Error("latlngs not passed");Fi(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var u=H([0,0]),c=N(t);c.getNorthWest().distanceTo(c.getSouthWest())*c.getNorthEast().distanceTo(c.getNorthWest())<1700&&(u=Si(t));var d=t.length,m=[];for(i=0;i<d;i++){var p=H(t[i]);m.push(e.project(H([p.lat-u.lat,p.lng-u.lng])))}for(i=0,n=0;i<d-1;i++)n+=m[i].distanceTo(m[i+1])/2;if(0===n)h=m[0];else for(i=0,r=0;i<d-1;i++)if(s=m[i],a=m[i+1],(r+=o=s.distanceTo(a))>n){l=(r-n)/o,h=[a.x-l*(a.x-s.x),a.y-l*(a.y-s.y)];break}var f=e.unproject(B(h));return H([f.lat+u.lat,f.lng+u.lng])}var Hi={__proto__:null,simplify:Li,pointToSegmentDistance:Mi,closestPointOnSegment:Ei,clipSegment:ki,_getEdgeIntersection:Ii,_getBitCode:Bi,_sqClosestPointOnSegment:Ri,isFlat:Fi,_flat:Ni,polylineCenter:Zi},ji={project:function(t){return new k(t.lng,t.lat)},unproject:function(t){return new Z(t.y,t.x)},bounds:new D([-180,-90],[180,90])},Wi={R:6378137,R_MINOR:6356752.314245179,bounds:new D([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new k(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),l=0,h=.1;l<15&&Math.abs(h)>1e-7;l++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new Z(a*i,t.x*i/n)}},Vi={__proto__:null,LonLat:ji,Mercator:Wi,SphericalMercator:G},Ui=i({},V,{code:"EPSG:3395",projection:Wi,transformation:function(){var t=.5/(Math.PI*Wi.R);return X(t,.5,-t,.5)}()}),Gi=i({},V,{code:"EPSG:4326",projection:ji,transformation:X(1/180,1,-1/180,.5)}),Yi=i({},W,{projection:ji,transformation:X(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});W.Earth=V,W.EPSG3395=Ui,W.EPSG3857=K,W.EPSG900913=J,W.EPSG4326=Gi,W.Simple=Yi;var Xi=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.fire("add"),e.fire("layeradd",{layer:this})}}});ri.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var qi=Xi.extend({initialize:function(t,e){var i,n;if(m(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Ki=function(t,e){return new qi(t,e)},Ji=qi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),qi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),qi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new F;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),Qi=function(t,e){return new Ji(t,e)},$i=E.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){m(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=B(n),r=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Nt.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function tn(t){return new $i(t)}var en=$i.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof en.imagePath&&(en.imagePath=this._detectIconPath()),(this.options.imagePath||en.imagePath)+$i.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var e=function(t,e,i){var n=e.exec(t);return n&&n[i]};return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=_e("div","leaflet-default-icon-path",document.body),e=fe(t,"background-image")||fe(t,"backgroundImage");if(document.body.removeChild(t),e=this._stripUrl(e))return e;var i=document.querySelector('link[href$="leaflet.css"]');return i?i.href.substring(0,i.href.length-"leaflet.css".length-1):""}}),nn=vi.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new xi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),we(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&be(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Oe(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),l=R(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!l.contains(r)){var h=B((Math.max(l.max.x,r.x)-l.max.x)/(s.max.x-l.max.x)-(Math.min(l.min.x,r.x)-l.min.x)/(s.min.x-l.min.x),(Math.max(l.max.y,r.y)-l.max.y)/(s.max.y-l.max.y)-(Math.min(l.min.y,r.y)-l.min.y)/(s.min.y-l.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Ae(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=T(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(P(this._panRequest),this._panRequest=T(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Oe(e._icon),o=e._map.layerPointToLatLng(n);i&&Ae(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){P(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),on=Xi.extend({options:{icon:new en,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){m(this,e),this._latlng=H(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=H(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),we(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ze(i,"focus",this._panOnFocus,this);var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(we(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&je(this._icon,"focus",this._panOnFocus,this),ge(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ge(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Ae(this._icon,t),this._shadow&&Ae(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(we(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),nn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new nn(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var e=this.options.icon.options,i=e.iconSize?B(e.iconSize):B(0,0),n=e.iconAnchor?B(e.iconAnchor):B(0,0);t.panInside(this._latlng,{paddingTopLeft:n,paddingBottomRight:i.subtract(n)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function rn(t,e){return new on(t,e)}var sn=Xi.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return m(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),an=sn.extend({options:{fill:!0,radius:10},initialize:function(t,e){m(this,e),this._latlng=H(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=H(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return sn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new D(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ln(t,e){return new an(t,e)}var hn=an.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),m(this,e),this._latlng=H(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new F(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:sn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===V.distance){var o=Math.PI/180,r=this._mRadius/V.R/o,s=i.project([e+r,t]),a=i.project([e-r,t]),l=s.add(a).divideBy(2),h=i.unproject(l).lat,u=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(u)||0===u)&&(u=r/Math.cos(Math.PI/180*e)),this._point=l.subtract(i.getPixelOrigin()),this._radius=isNaN(u)?0:l.x-i.project([h,t-u]).x,this._radiusY=l.y-s.y}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(c).x}this._updateBounds()}});function un(t,e,i){return new hn(t,e,i)}var cn=sn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){m(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=Ri,s=0,a=this._parts.length;s<a;s++)for(var l=this._parts[s],h=1,u=l.length;h<u;h++){var c=r(t,e=l[h-1],i=l[h],!0);c<n&&(n=c,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Zi(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=H(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new F,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Fi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Fi(t),n=0,o=t.length;n<o;n++)i?(e[n]=H(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new D;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new k(t,t);this._rawPxBounds&&(this._pxBounds=new D([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)]))},_projectLatlngs:function(t,e,i){var n,o,r=t[0]instanceof Z,s=t.length;if(r){for(o=[],n=0;n<s;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<s;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,s,a,l=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=ki(a[i],a[i+1],t,i,!0))&&(l[n]=l[n]||[],l[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(l[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=Li(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,s,a,l=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((e||0!==n)&&Mi(t,a[o],a[n])<=l)return!0;return!1}});function dn(t,e){return new cn(t,e)}cn._flat=Ni;var mn=cn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return bi(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var e=cn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof Z&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){cn.prototype._setLatLngs.call(this,t),Fi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Fi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new k(e,e);if(t=new D(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=wi(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,s,a,l,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(l=(e=this._parts[o]).length)-1;r<l;s=r++)i=e[r],n=e[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||cn.prototype._containsPoint.call(this,t,!0)}});function pn(t,e){return new mn(t,e)}var fn=Ji.extend({initialize:function(t,e){m(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=g(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=_n(t,r);return s?(s.feature=bn(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function _n(t,e){var i,n,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,l=[],h=e&&e.pointToLayer,u=e&&e.coordsToLatLng||vn;if(!a&&!s)return null;switch(s.type){case"Point":return gn(h,t,i=u(a),e);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=u(a[o]),l.push(gn(h,t,i,e));return new Ji(l);case"LineString":case"MultiLineString":return n=yn(a,"LineString"===s.type?0:1,u),new cn(n,e);case"Polygon":case"MultiPolygon":return n=yn(a,"Polygon"===s.type?1:2,u),new mn(n,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var c=_n({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);c&&l.push(c)}return new Ji(l);case"FeatureCollection":for(o=0,r=s.features.length;o<r;o++){var d=_n(s.features[o],e);d&&l.push(d)}return new Ji(l);default:throw new Error("Invalid GeoJSON object.")}}function gn(t,e,i,n){return t?t(e,i):new on(i,n&&n.markersInheritOptions&&n)}function vn(t){return new Z(t[1],t[0],t[2])}function yn(t,e,i){for(var n,o=[],r=0,s=t.length;r<s;r++)n=e?yn(t[r],e-1,i):(i||vn)(t[r]),o.push(n);return o}function Cn(t,e){return void 0!==(t=H(t)).alt?[u(t.lng,e),u(t.lat,e),u(t.alt,e)]:[u(t.lng,e),u(t.lat,e)]}function xn(t,e,i,n){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?xn(t[r],Fi(t[r])?0:e-1,i,n):Cn(t[r],n));return!e&&i&&o.length>0&&o.push(o[0].slice()),o}function wn(t,e){return t.feature?i({},t.feature,{geometry:e}):bn(e)}function bn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Sn={toGeoJSON:function(t){return wn(this,{type:"Point",coordinates:Cn(this.getLatLng(),t)})}};function Tn(t,e){return new fn(t,e)}on.include(Sn),hn.include(Sn),an.include(Sn),cn.include({toGeoJSON:function(t){var e=!Fi(this._latlngs);return wn(this,{type:(e?"Multi":"")+"LineString",coordinates:xn(this._latlngs,e?1:0,!1,t)})}}),mn.include({toGeoJSON:function(t){var e=!Fi(this._latlngs),i=e&&!Fi(this._latlngs[0]),n=xn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),wn(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),qi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),wn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var r=bn(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?wn(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var Pn=Tn,Ln=Xi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=N(e),m(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(we(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ye(this._image),this},bringToBack:function(){return this._map&&Ce(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=N(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:_e("img");we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Ee(this._image,i,e)},_reset:function(){var t=this._image,e=new D(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Ae(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){Pe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Mn=function(t,e,i){return new Ln(t,e,i)},En=Ln.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:_e("video");if(we(e,"leaflet-image-layer"),this._zoomAnimated&&we(e,"leaflet-zoom-animated"),this.options.className&&we(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var a=_e("source");a.src=this._url[s],e.appendChild(a)}}}});function An(t,e,i){return new En(t,e,i)}var On=Ln.extend({_initImage:function(){var t=this._image=this._url;we(t,"leaflet-image-layer"),this._zoomAnimated&&we(t,"leaflet-zoom-animated"),this.options.className&&we(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function zn(t,e,i){return new On(t,e,i)}var kn=Xi.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof Z||g(t))?(this._latlng=H(t),m(this,e)):(m(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Pe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Pe(this._container,1),this.bringToFront(),this.options.interactive&&(we(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Pe(this._container,0),this._removeTimeout=setTimeout(o(ge,void 0,this._container),200)):ge(this._container),this.options.interactive&&(be(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=H(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ye(this._container),this},bringToBack:function(){return this._map&&Ce(this._container),this},_prepareOpen:function(t){var e=this._source;if(!e._map)return!1;if(e instanceof Ji){e=null;var i=this._source._layers;for(var n in i)if(i[n]._map){e=i[n];break}if(!e)return!1;this._source=e}if(!t)if(e.getCenter)t=e.getCenter();else if(e.getLatLng)t=e.getLatLng();else{if(!e.getBounds)throw new Error("Unable to get source layer LatLng.");t=e.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Ae(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}});ri.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),Xi.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(m(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}});var In=kn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,kn.prototype.openOn.call(this,t)},onAdd:function(t){kn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof sn||this._source.on("preclick",Ye))},onRemove:function(t){kn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof sn||this._source.off("preclick",Ye))},getEvents:function(){var t=kn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=_e("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=_e("div",t+"-content-wrapper",e);if(this._contentNode=_e("div",t+"-content",i),qe(e),Xe(this._contentNode),Ze(e,"contextmenu",Ye),this._tipContainer=_e("div",t+"-tip-container",e),this._tip=_e("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=_e("a",t+"-close-button",e);n.setAttribute("role","button"),n.setAttribute("aria-label","Close popup"),n.href="#close",n.innerHTML='<span aria-hidden="true">&#215;</span>',Ze(n,"click",(function(t){Ke(t),this.close()}),this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=t.offsetHeight,o=this.options.maxHeight,r="leaflet-popup-scrolled";o&&n>o?(e.height=o+"px",we(t,r)):be(t,r),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Ae(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan)if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning)this._autopanning=!1;else{var t=this._map,e=parseInt(fe(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new k(this._containerLeft,-i-this._containerBottom);o._add(Oe(this._container));var r=t.layerPointToContainerPoint(o),s=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||s),l=B(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),u=0,c=0;r.x+n+l.x>h.x&&(u=r.x+n-h.x+l.x),r.x-u-a.x<0&&(u=r.x-a.x),r.y+i+l.y>h.y&&(c=r.y+i-h.y+l.y),r.y-c-a.y<0&&(c=r.y-a.y),(u||c)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([u,c]))}},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Bn=function(t,e){return new In(t,e)};ri.mergeOptions({closePopupOnClick:!0}),ri.include({openPopup:function(t,e,i){return this._initOverlay(In,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),Xi.include({bindPopup:function(t,e){return this._popup=this._initOverlay(In,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof Ji||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(this._popup&&this._map){Je(t);var e=t.layer||t.target;this._popup._source!==e||e instanceof sn?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Dn=kn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){kn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){kn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=kn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=_e("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+s(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,r=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(t),a=this.options.direction,l=o.offsetWidth,h=o.offsetHeight,u=B(this.options.offset),c=this._getAnchor();"top"===a?(e=l/2,i=h):"bottom"===a?(e=l/2,i=0):"center"===a?(e=l/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=l,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=l+2*(u.x+c.x),i=h/2),t=t.subtract(B(e,i,!0)).add(u).add(c),be(o,"leaflet-tooltip-right"),be(o,"leaflet-tooltip-left"),be(o,"leaflet-tooltip-top"),be(o,"leaflet-tooltip-bottom"),we(o,"leaflet-tooltip-"+a),Ae(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Pe(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Rn=function(t,e){return new Dn(t,e)};ri.include({openTooltip:function(t,e,i){return this._initOverlay(Dn,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Xi.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Dn,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Ji||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(Ze(e,"focus",(function(){this._tooltip._source=t,this.openTooltip()}),this),Ze(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&e.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(this._tooltip&&this._map)if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var e=this;this._map.once("moveend",(function(){e._openOnceFlag=!1,e._openTooltip(t)}))}else this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var Fn=$i.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(ve(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=B(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Nn(t){return new Fn(t)}$i.Default=en;var Zn=Xi.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Nt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){m(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ge(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ye(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Ce(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof k?t:new k(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Nt.ielt9){Pe(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);Pe(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(P(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=_e("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ge(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=_e("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ge(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new k(+o,+r);a.z=+s;var l=this._tileCoordsToKey(a),h=this._tiles[l];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new k(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),l=this._tiles[a];l&&l.active?l.retain=!0:(l&&l.loaded&&(l.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o);var r=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!r||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();Nt.any3d?Ee(t.el,o,n):Ae(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new D(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,l=new D(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var u=this._tiles[h].coords;u.z===this._tileZoom&&l.contains(new k(u.x,u.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var d=o.min.x;d<=o.max.x;d++){var m=new k(d,c);if(m.z=this._tileZoom,this._isValidTile(m)){var p=this._tiles[this._tileCoordsToKey(m)];p?p.current=!0:s.push(m)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var f=document.createDocumentFragment();for(d=0;d<s.length;d++)this._addTile(s[d],f);this._level.el.appendChild(f)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return N(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new F(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new k(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ge(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){we(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,Nt.ielt9&&this.options.opacity<1&&Pe(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&T(o(this._tileReady,this,t,null,r)),Ae(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(Pe(i.el,0),P(this._fadeFrame),this._fadeFrame=T(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(we(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Nt.ielt9||!this._map._fadeAnimated?T(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new k(this._wrapX?l(t.x,this._wrapX):t.x,this._wrapY?l(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new D(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Hn(t){return new Zn(t)}var jn=Zn.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=m(this,e)).detectRetina&&Nt.retina&&e.maxZoom>0?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ze(i,"load",o(this._tileOnLoad,this,e,i)),Ze(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Nt.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){Nt.ielt9?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,!e.complete)){e.src=y;var i=this._tiles[t].coords;ge(e),delete this._tiles[t],this.fire("tileabort",{tile:e,coords:i})}},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",y),Zn.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==y))return Zn.prototype._tileReady.call(this,t,e,i)}});function Wn(t,e){return new jn(t,e)}var Vn=jn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var r=(e=m(this,e)).detectRetina&&Nt.retina?2:1,s=this.getTileSize();n.width=s.x*r,n.height=s.y*r,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,jn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===Gi?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=jn.prototype.getTileUrl.call(this,t);return a+p(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Un(t,e){return new Vn(t,e)}jn.WMS=Vn,Wn.wms=Un;var Gn=Xi.extend({options:{padding:.1},initialize:function(t){m(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),we(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),r=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));Nt.any3d?Ee(this._container,r,i):Ae(this._container,r)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new D(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Yn=Gn.extend({options:{tolerance:0},getEvents:function(){var t=Gn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Gn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ze(t,"mousemove",this._onMouseMove,this),Ze(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ze(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){P(this._redrawRequest),delete this._ctx,ge(this._container),je(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){Gn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Nt.retina?2:1;Ae(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Nt.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){Gn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||T(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new D,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,s=t._parts,a=s.length,l=this._ctx;if(a){for(l.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)r=s[i][n],l[n?"lineTo":"moveTo"](r.x,r.y);e&&l.closePath()}this._fillStroke(l,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&("click"!==t.type&&"preclick"!==t.type||!this._map._draggableMoved(e))&&(i=e);this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(be(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(we(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Xn(t){return Nt.canvas?new Yn(t):null}var qn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),Kn={_initContainer:function(){this._container=_e("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Gn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=qn("shape");we(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=qn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ge(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=qn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=qn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ye(t._container)},_bringToBack:function(t){Ce(t._container)}},Jn=Nt.vml?qn:Q,Qn=Gn.extend({_initContainer:function(){this._container=Jn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Jn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),je(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!this._map._animatingZoom||!this._bounds){Gn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Ae(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Jn("path");t.options.className&&we(e,t.options.className),t.options.interactive&&we(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ge(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,$(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ye(t._path)},_bringToBack:function(t){Ce(t._path)}});function $n(t){return Nt.svg||Nt.vml?new Qn(t):null}Nt.vml&&Qn.include(Kn),ri.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Xn(t)||$n(t)}});var to=mn.extend({initialize:function(t,e){mn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=N(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function eo(t,e){return new to(t,e)}Qn.create=Jn,Qn.pointsToPath=$,fn.geometryToLayer=_n,fn.coordsToLatLng=vn,fn.coordsToLatLngs=yn,fn.latLngToCoords=Cn,fn.latLngsToCoords=xn,fn.getFeature=wn,fn.asFeature=bn,ri.mergeOptions({boxZoom:!0});var io=vi.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ze(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),se(),ke(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ze(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=_e("div","leaflet-zoom-box",this._container),we(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new D(this._point,this._startPoint),i=e.getSize();Ae(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ge(this._box),be(this._container,"leaflet-crosshair")),ae(),Ie(),je(document,{contextmenu:Je,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new F(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ri.addInitHook("addHandler","boxZoom",io),ri.mergeOptions({doubleClickZoom:!0});var no=vi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ri.addInitHook("addHandler","doubleClickZoom",no),ri.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var oo=vi.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new xi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}we(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){be(this._map._container,"leaflet-grab"),be(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=N(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||t.noInertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=(this._lastTime-this._times[0])/1e3,s=i.easeLinearity,a=o.multiplyBy(s/r),l=a.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,l),u=a.multiplyBy(h/l),c=h/(i.inertiaDeceleration*s),d=u.multiplyBy(-c/2).round();d.x||d.y?(d=e._limitOffset(d,e.options.maxBounds),T((function(){e.panBy(d,{duration:c,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ri.addInitHook("addHandler","dragging",oo),ri.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ro=vi.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ze(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),je(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ze(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){je(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys){if(!n._panAnim||!n._panAnim._inProgress)if(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),n.options.maxBounds&&(e=n._limitOffset(B(e),n.options.maxBounds)),n.options.worldCopyJump){var o=n.wrapLatLng(n.unproject(n.project(n.getCenter()).add(e)));n.panTo(o)}else n.panBy(e)}else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Je(t)}}});ri.addInitHook("addHandler","keyboard",ro),ri.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var so=vi.extend({addHooks:function(){Ze(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){je(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=ei(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),n),Je(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=this._delta/(4*this._map.options.wheelPxPerZoomLevel),o=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,r=i?Math.ceil(o/i)*i:o,s=t._limitZoom(e+(this._delta>0?r:-r))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});ri.addInitHook("addHandler","scrollWheelZoom",so);var ao=600;ri.mergeOptions({tapHold:Nt.touchNative&&Nt.safari&&Nt.mobile,tapTolerance:15});var lo=vi.extend({addHooks:function(){Ze(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),1===t.touches.length){var e=t.touches[0];this._startPos=this._newPos=new k(e.clientX,e.clientY),this._holdTimeout=setTimeout(o((function(){this._cancel(),this._isTapValid()&&(Ze(document,"touchend",Ke),Ze(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))}),this),ao),Ze(document,"touchend touchcancel contextmenu",this._cancel,this),Ze(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){je(document,"touchend",Ke),je(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)},_onMove:function(t){var e=t.touches[0];this._newPos=new k(e.clientX,e.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});i._simulated=!0,e.target.dispatchEvent(i)}});ri.addInitHook("addHandler","tapHold",lo),ri.mergeOptions({touchZoom:Nt.touch,bounceAtZoomLimits:!0});var ho=vi.extend({addHooks:function(){we(this._map._container,"leaflet-touch-zoom"),Ze(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){be(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ze(document,"touchmove",this._onTouchMove,this),Ze(document,"touchend touchcancel",this._onTouchEnd,this),Ke(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),P(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=T(a,this,!0),Ke(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,P(this._animRequest),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ri.addInitHook("addHandler","touchZoom",ho),ri.BoxZoom=io,ri.DoubleClickZoom=no,ri.Drag=oo,ri.Keyboard=ro,ri.ScrollWheelZoom=so,ri.TapHold=lo,ri.TouchZoom=ho,t.Bounds=D,t.Browser=Nt,t.CRS=W,t.Canvas=Yn,t.Circle=hn,t.CircleMarker=an,t.Class=E,t.Control=ai,t.DivIcon=Fn,t.DivOverlay=kn,t.DomEvent=ni,t.DomUtil=Ne,t.Draggable=xi,t.Evented=z,t.FeatureGroup=Ji,t.GeoJSON=fn,t.GridLayer=Zn,t.Handler=vi,t.Icon=$i,t.ImageOverlay=Ln,t.LatLng=Z,t.LatLngBounds=F,t.Layer=Xi,t.LayerGroup=qi,t.LineUtil=Hi,t.Map=ri,t.Marker=on,t.Mixin=yi,t.Path=sn,t.Point=k,t.PolyUtil=Pi,t.Polygon=mn,t.Polyline=cn,t.Popup=In,t.PosAnimation=oi,t.Projection=Vi,t.Rectangle=to,t.Renderer=Gn,t.SVG=Qn,t.SVGOverlay=On,t.TileLayer=jn,t.Tooltip=Dn,t.Transformation=Y,t.Util=M,t.VideoOverlay=En,t.bind=o,t.bounds=R,t.canvas=Xn,t.circle=un,t.circleMarker=ln,t.control=li,t.divIcon=Nn,t.extend=i,t.featureGroup=Qi,t.geoJSON=Tn,t.geoJson=Pn,t.gridLayer=Hn,t.icon=tn,t.imageOverlay=Mn,t.latLng=H,t.latLngBounds=N,t.layerGroup=Ki,t.map=si,t.marker=rn,t.point=B,t.polygon=pn,t.polyline=dn,t.popup=Bn,t.rectangle=eo,t.setOptions=m,t.stamp=s,t.svg=$n,t.svgOverlay=zn,t.tileLayer=Wn,t.tooltip=Rn,t.transformation=X,t.version=e,t.videoOverlay=An;var uo=window.L;t.noConflict=function(){return window.L=uo,this},window.L=t}(e)}(0,pn.exports);var fn=pn.exports;function _n(){this.init.apply(this,arguments)}_n.prototype={_container:null,_miniMap:null,_viewerMoving:!1,_miniMapMoving:!1,_userToggledDisplay:!1,_minimized:!1,viewer:null,tileLayer:null,Cesium:null,options:{position:"bottomleft",toggleDisplay:!0,zoomLevelOffset:-5,zoomLevelFixed:!1,centerFixed:!1,zoomControl:!1,zoomAnimation:!1,autoToggleDisplay:!1,minimized:!1,width:150,height:150,collapsedWidth:19,collapsedHeight:19,aimingRectOptions:{color:"#ff7800",weight:1,interactive:!1},shadowRectOptions:{color:"#000000",weight:1,interactive:!1,opacity:0,fillOpacity:0},strings:{hideText:"隐藏鹰眼",showText:"显示鹰眼"},mapOptions:{toggleDisplay:!0,aimingRectOptions:{color:"#ff1100",weight:3},shadowRectOptions:{color:"#0000AA",weight:1,opacity:0,fillOpacity:0}}},init:function(t,e,i,n){this.viewer=t,this.tileLayer=e,this.Cesium=i,this._container=n.container,fn.Util.setOptions(this,n),this.options.aimingRectOptions.interactive=!1,this.options.shadowRectOptions.interactive=!1,this._initMap(),this._showInitView()},updateAimingRect:function(){var t=this._getViewRange();this._aimingRect.setBounds(t)},_initMap:function(){this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",fn.DomEvent.disableClickPropagation(this._container),fn.DomEvent.on(this._container,"mousewheel",fn.DomEvent.stopPropagation);var t={attributionControl:!1,dragging:!this.options.centerFixed,zoomControl:this.options.zoomControl,zoomAnimation:this.options.zoomAnimation,autoToggleDisplay:this.options.autoToggleDisplay,touchZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),scrollWheelZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),doubleClickZoom:this.options.centerFixed?"center":!this._isZoomLevelFixed(),boxZoom:!this._isZoomLevelFixed(),crs:fn.CRS.EPSG3857,center:[30,120],zoom:1};t=fn.Util.extend(this.options.mapOptions,t),this._miniMap=new fn.Map(this._container,t);var e=this.tileLayer;return this._miniMap.addLayer(e),this._viewerMoving=!0,this._miniMapMoving=!1,this._userToggledDisplay=!1,this._minimized=!1,this.options.toggleDisplay&&this._addToggleButton(),this._miniMap.whenReady(fn.Util.bind((()=>{var t=this._getViewRange();this._aimingRect=fn.rectangle(t,this.options.aimingRectOptions).addTo(this._miniMap),this._shadowRect=fn.rectangle(t,this.options.shadowRectOptions).addTo(this._miniMap);var e=this.viewer.scene.camera;e.moveEnd.addEventListener((t=>{var e=this._getViewRange();if(this._miniMapMoving)this._miniMapMoving=!1;else{this._viewerMoving=!0;var i=this._getZoomOutRange(e);i&&(this._miniMap.fitBounds(i),this._setDisplay(this._decideMinimized()))}e&&this._aimingRect.setBounds(e)})),e.moveStart.addEventListener((t=>{var e=this._getViewRange();e&&this._aimingRect.setBounds(e)})),this._miniMap.on("movestart",this._onMiniMapMoveStarted,this),this._miniMap.on("move",this._onMiniMapMoving,this),this._miniMap.on("moveend",this._onMiniMapMoved,this)}),this)),this._container},_addToggleButton:function(){this._toggleDisplayButton=this.options.toggleDisplay?this._createButton("",this._toggleButtonInitialTitleText(),"leaflet-control-minimap-toggle-display leaflet-control-minimap-toggle-display-"+this.options.position,this._container,this._toggleDisplayButtonClicked,this):void 0,this._toggleDisplayButton.style.width=this.options.collapsedWidth+"px",this._toggleDisplayButton.style.height=this.options.collapsedHeight+"px"},_toggleButtonInitialTitleText:function(){return this.options.minimized?this.options.strings.showText:this.options.strings.hideText},_createButton:function(t,e,i,n,o,r){var s=fn.DomUtil.create("a",i,n);s.innerHTML=t,s.href="#",s.title=e;var a=fn.DomEvent.stopPropagation;return fn.DomEvent.on(s,"click",a).on(s,"mousedown",a).on(s,"dblclick",a).on(s,"click",fn.DomEvent.preventDefault).on(s,"click",o,r),s},_toggleDisplayButtonClicked:function(){this._userToggledDisplay=!0,this._minimized?this._restore():this._minimize()},_showInitView:function(){var t=this._getViewRange(),e=this._getZoomOutRange(t);e&&this._miniMap.fitBounds(e)},_setDisplay:function(t){t!==this._minimized&&(this._minimized?this._restore():this._minimize())},_minimize:function(){this.options.toggleDisplay?(this._container.style.width=this.options.collapsedWidth+"px",this._container.style.height=this.options.collapsedHeight+"px",this._toggleDisplayButton.className+=" minimized-"+this.options.position,this._toggleDisplayButton.title=this.options.strings.showText):this._container.style.display="none",this._minimized=!0,this._onToggle()},_restore:function(){this.options.toggleDisplay?(this._container.style.width=this.options.width+"px",this._container.style.height=this.options.height+"px",this._toggleDisplayButton.className=this._toggleDisplayButton.className.replace("minimized-"+this.options.position,""),this._toggleDisplayButton.title=this.options.strings.hideText):this._container.style.display="block",this._minimized=!1,this._onToggle()},_onMiniMapMoveStarted:function(t){if(!this.options.centerFixed){var e=this._aimingRect.getBounds(),i=this._miniMap.latLngToContainerPoint(e.getSouthWest()),n=this._miniMap.latLngToContainerPoint(e.getNorthEast());this._lastAimingRectPosition={sw:i,ne:n}}},_onMiniMapMoving:function(t){this.options.centerFixed||!this._viewerMoving&&this._lastAimingRectPosition&&(this._shadowRect.setBounds(new fn.LatLngBounds(this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.sw),this._miniMap.containerPointToLatLng(this._lastAimingRectPosition.ne))),this._shadowRect.setStyle({opacity:1,fillOpacity:.3}))},_onMiniMapMoved:function(t){if(this._viewerMoving)this._viewerMoving=!1;else{this._miniMapMoving=!0;var e=this._shadowRect.getBounds(),i=e.getWest(),n=e.getEast(),o=e.getNorth(),r=e.getSouth(),s=this.Cesium.Rectangle.fromDegrees(i,r,n,o),a={heading:this.Cesium.Math.toRadians(0),pitch:this.Cesium.Math.toRadians(-90),roll:0};this.viewer.scene.camera.setView({destination:s,orientation:a}),this._shadowRect.setStyle({opacity:0,fillOpacity:0})}},_isZoomLevelFixed:function(){var t=this.options.zoomLevelFixed;return this._isDefined(t)&&this._isInteger(t)},_decideMinimized:function(){return this._userToggledDisplay?this._minimized:this.options.autoToggleDisplay?!!this._getViewRange().contains(this._miniMap.getBounds()):this._minimized},_isInteger:function(t){return"number"==typeof t},_isDefined:function(t){return void 0!==t},_onToggle:function(){fn.Util.requestAnimFrame((function(){fn.DomEvent.on(this._container,"transitionend",this._fireToggleEvents,this),fn.Browser.any3d||fn.Util.requestAnimFrame(this._fireToggleEvents,this)}),this)},_fireToggleEvents:function(){fn.DomEvent.off(this._container,"transitionend",this._fireToggleEvents,this)},_getViewRange:function(){var t=null,e=this.viewer.scene.camera.computeViewRectangle();if(e){var i=e.west/Math.PI*180,n=e.east/Math.PI*180,o=e.north/Math.PI*180,r=e.south/Math.PI*180;t=new fn.LatLngBounds(new fn.LatLng(o,i),new fn.LatLng(r,n))}return t},_getZoomOutRange:function(t){var e=null;if(t){var i=t.getWest(),n=t.getEast(),o=t.getNorth(),r=t.getSouth(),s=2*Math.abs(n-i)/2,a=2*Math.abs(o-r)/2;(i-=s)<-180&&(i=-180),(n+=s)>180&&(n=180),(o+=a)>90&&(o=90),(r-=a)<-90&&(r=-90),e=new fn.LatLngBounds(new fn.LatLng(o,i),new fn.LatLng(r,n))}return e},CLASS_NAME:"CesiumOverviewMapControl"};const gn={id:"minimap",class:"leaflet-control-minimap"};var vn=pt({props:{width:{type:Number,default:220},height:{type:Number,default:150},viewer:{type:Object,required:!0}},setup(t){const i=t;return e.onMounted((()=>{var t,e,n;t="https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token=pk.eyJ1IjoiaGo0NjI3NzEzOTYiLCJhIjoiY2w5YzNjOTZvMDF6NDNwb2d6YmJkYWRpMCJ9.-fW-OChGB1oY2DCMO_c8sg",e=new fn.TileLayer(t,{minZoom:0,maxZoom:20}),n={container:document.getElementById("minimap"),toggleDisplay:!0,width:i.width,height:i.height,position:"topright",aimingRectOptions:{color:"#ff1100",weight:3},shadowRectOptions:{color:"#e1b000",weight:1,opacity:0,fillOpacity:0}},new _n(i.viewer,e,Cesium,n)})),(t,i)=>(e.openBlock(),e.createElementBlock("div",gn))}},[["__scopeId","data-v-7136a901"]]);const yn={class:"info_data"};var Cn=pt({emits:["close"],setup(t,{expose:i,emit:n}){const{wgs84ToWindowCoordinates:o}=Mn;let r=e.ref(!1),s=e.ref({x:0,y:0}),a=null,l=null;function h(t,e){l=e||l,null==a&&t&&(a=t,a.scene.postRender.addEventListener((()=>{r.value&&h()})));let i=function(){let t=o(a,l);if(t){return{x:t.x,y:a.canvas.clientHeight-t.y}}}();i?(s.value=i,r.value=!0):r.value=!1}function u(){r.value=!1}return e.onUnmounted((()=>{r.value=!1})),i({openInfo:h,close:u}),(t,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"content_info",style:e.normalizeStyle({left:e.unref(s).x+"px",bottom:e.unref(s).y+"px"})},[e.createElementVNode("div",{class:"close_btn",onClick:u},"x"),e.createElementVNode("div",yn,[e.renderSlot(t.$slots,"default",{},void 0,!0)])],4)),[[e.vShow,e.unref(r)]])}},[["__scopeId","data-v-7e9262c2"]]);const xn={props:{loading:{type:Boolean,default:!0},loadTime:{type:Number,default:5e3},image:{type:String,default:""}},data:()=>({progress:0,timer:"",show:!0}),watch:{loading:{handler(t){t||(this.show=!1,this.progress=100,window.clearInterval(this.timer))},immediate:!0}},unMounted(){window.clearInterval(this.timer)},created(){this.timer=setInterval((()=>{this.progress+=3,this.progress>=99&&window.clearInterval(this.timer)}),this.loadTime/30)}},wn=(t=>(e.pushScopeId("data-v-4fb4eee2"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("div",{id:"ajaxloader"},[e.createElementVNode("div",{class:"outer"}),e.createElementVNode("div",{class:"inner"})],-1))),bn={class:"text-center",style:{width:"400px"}},Sn={class:"mb-20 flex flex-center"},Tn={class:"progress-wrap"},Pn={class:"progress-inner"};var Ln=pt(xn,[["render",function(t,i,n,o,r,s){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["mapLoad flex flex-col flex-center",{loadOver:!r.show}]),style:e.normalizeStyle(n.image?`background: url(${n.image}) no-repeat center;background-size:cover;`:"")},[wn,e.createElementVNode("div",bn,[e.createElementVNode("div",Sn," 正在努力加载中..."+e.toDisplayString(r.progress.toFixed(0))+"% ",1),e.createElementVNode("div",Tn,[e.createElementVNode("div",Pn,[e.createElementVNode("div",{class:"progress-nums",style:e.normalizeStyle(`width: ${r.progress}%`)},null,4)])])])],6)}],["__scopeId","data-v-4fb4eee2"]]);const Mn={firstFly:(t,e)=>new Promise((i=>{const n=Object.assign({lng:120,lat:30,height:2e3,heading:0,pitch:-90,roll:0},e);t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,2e7),duration:5,complete:()=>{t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.height+1e3),duration:2,complete:()=>{t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.height),orientation:{heading:Cesium.Math.toRadians(n.heading),pitch:Cesium.Math.toRadians(n.pitch),roll:Cesium.Math.toRadians(n.roll)},duration:2,complete:()=>{i(!0)}})}})}})})),flyTo:(t,e)=>new Promise((i=>{const n=Object.assign({lng:120,lat:30,height:2e3,duration:2,heading:0,pitch:-90,roll:0},e);t.camera.flyTo({destination:Cesium.Cartesian3.fromDegrees(n.lng,n.lat,n.height),orientation:{heading:Cesium.Math.toRadians(n.heading),pitch:Cesium.Math.toRadians(n.pitch),roll:Cesium.Math.toRadians(n.roll)},duration:n.duration,complete:()=>{i(!0)}})})),flyToRectangle:(t,e,i)=>new Promise((n=>{const o=Object.assign({duration:2,heading:0,pitch:-90,roll:0},i);t.camera.flyTo({destination:e,orientation:{heading:Cesium.Math.toRadians(o.heading),pitch:Cesium.Math.toRadians(o.pitch),roll:Cesium.Math.toRadians(o.roll)},duration:o.duration,complete:()=>{n(!0)}})})),flyToPoint:(t,{lng:e,lat:i,distance:n=2e3,duration:o=2,heading:r=0,pitch:s=-30})=>new Promise((async a=>{t.entities.values.forEach((e=>{"tempEntity"===e.name&&t.entities.remove(e)}));const l=t.entities.add({name:"tempEntity",position:Cesium.Cartesian3.fromDegrees(e,i),point:{color:Cesium.Color.RED,pixelSize:0,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND}});t.flyTo(l,{offset:new Cesium.HeadingPitchRange(Cesium.Math.toRadians(r),Cesium.Math.toRadians(s),n),duration:o}).then((()=>{console.log("飞行结束"),t.entities.remove(l),a(!0)}))})),setView:(t,e)=>{const i=Object.assign({lng:120,lat:30,height:1e3,duration:2,heading:0,pitch:-90,roll:0},e);t.camera.setView({destination:Cesium.Cartesian3.fromDegrees(i.lng,i.lat,i.height),orientation:{heading:Cesium.Math.toRadians(i.heading),pitch:Cesium.Math.toRadians(i.pitch),roll:i.roll}})},gazeAngle:(t,e)=>{const i=Object.assign({lng:120,lat:30,heading:0,pitch:-60,range:15e3},e),n=Cesium.Cartesian3.fromDegrees(i.lng,i.lat),o=Cesium.Math.toRadians(i.heading),r=Cesium.Math.toRadians(i.pitch),s=i.range;t.camera.lookAt(n,new Cesium.HeadingPitchRange(o,r,s))},screenToWgs84:dt,wgs84ToWindowCoordinates:(t,e)=>Cesium.SceneTransforms.worldToWindowCoordinates(t.scene,e),getCamera:mt,enterUnderGround:(t,e=.5)=>{const{scene:i}=t,{globe:n}=t.scene;n.depthTestAgainstTerrain=!1,i.screenSpaceCameraController.inertiaZoom=.5,i.screenSpaceCameraController.enableCollisionDetection=!1,i.highDynamicRange=!1,i.skyAtmosphere.show=!1,i.skyBox.show=!1,i.fog.enabled=!1,n.baseColor=Cesium.Color.BLACK,n.translucency.enabled=!0,n.translucency.frontFaceAlpha=e,n.translucency.backFaceAlpha=.1,n.undergroundColor=Cesium.Color.BLACK,n.undergroundColorAlphaByDistance.near=1e3,n.undergroundColorAlphaByDistance.far=1e6,n.undergroundColorAlphaByDistance.nearValue=0,n.undergroundColorAlphaByDistance.farValue=1},cancelUnderGround:(t,e)=>{const{scene:i}=t,{globe:n}=t.scene,{imageryLayers:o}=t;i.globe.depthTestAgainstTerrain=!0;n.baseColor;const r=!0,s=!0,a=!0,l=!0;if(i.screenSpaceCameraController.enableCollisionDetection=!0,i.highDynamicRange=a,i.skyAtmosphere.show=s,i.skyBox.show=r,i.fog.enabled=l,n.baseColor,o&&o.length>0)for(let h=0;h<o.length;h++){o.get(h).alpha=1}},measurePolyLine:function(t){vt=t;var e=[],i=null;vt.screenSpaceEventHandler.setInputAction((function(t){var n=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);0==e.length?(e.push(n.clone()),yt(n),vt.screenSpaceEventHandler.setInputAction((function(t){var n=vt.scene.globe.pick(vt.camera.getPickRay(t.endPosition),vt.scene);if(2==e.length){e.pop(),e.push(n),i&&(vt.entities.remove(i),gt.splice(gt.indexOf(i),1));var o=Cesium.Cartesian3.midpoint(e[0],e[1],new Cesium.Cartesian3),r="距离:"+bt(e[0],e[1]);i=wt(o,r),gt.push(i)}else e.push(n),Ct(e)}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)):(e.pop(),e.push(n),yt(n),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE))}),Cesium.ScreenSpaceEventType.LEFT_CLICK)},measurePolygon:function(t){vt=t;var e=[],i=!1,n=null;vt.screenSpaceEventHandler.setInputAction((function(t){i=!0;var o=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);console.log(o),0==e.length?(e.push(o.clone()),yt(o),vt.screenSpaceEventHandler.setInputAction((function(t){var o=vt.scene.globe.pick(vt.camera.getPickRay(t.endPosition),vt.scene);if(console.log(o),1==e.length?(e.push(o),Ct(e,2)):(i||e.pop(),e.push(o)),e.length>=3){n&&(vt.entities.remove(n),gt.splice(gt.indexOf(n),1));var r="面积:"+St(e),s=Tt(e);n=wt(s,r),gt.push(n)}i=!1}),Cesium.ScreenSpaceEventType.MOUSE_MOVE)):2==e.length?(e.pop(),e.push(o.clone()),yt(o),xt(e),vt.screenSpaceEventHandler.setInputAction((function(t){var i=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);console.log(i),e.pop(),e.push(i),e.push(e[0]),yt(i),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.RIGHT_CLICK)}),Cesium.ScreenSpaceEventType.RIGHT_CLICK)):e.length>=3&&(e.pop(),e.push(o.clone()),yt(o))}),Cesium.ScreenSpaceEventType.LEFT_CLICK)},measureHeight:function(t){vt=t;var e=[],i=null,n=null,o=null;vt.screenSpaceEventHandler.setInputAction((function(t){var r=vt.scene.globe.pick(vt.camera.getPickRay(t.position),vt.scene);if(0==e.length)e.push(r.clone()),yt(r),vt.screenSpaceEventHandler.setInputAction((function(t){var r=vt.scene.globe.pick(vt.camera.getPickRay(t.endPosition),vt.scene);if(e.length>=2){e.pop(),e.pop(),e.pop();var s=Cesium.Cartographic.fromCartesian(r),a=Cesium.Cartographic.fromCartesian(e[0]).height,l=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(s.longitude),Cesium.Math.toDegrees(s.latitude),a);e.push(l),e.push(r),e.push(e[0]),i&&(vt.entities.remove(i),gt.splice(gt.indexOf(i),1),vt.entities.remove(n),gt.splice(gt.indexOf(n),1),vt.entities.remove(o),gt.splice(gt.indexOf(o),1));var h=Cesium.Cartesian3.midpoint(e[0],e[1],new Cesium.Cartesian3),u="水平距离:"+bt(e[0],e[1]);i=wt(h,u),gt.push(i);var c=Cesium.Cartesian3.midpoint(e[1],e[2],new Cesium.Cartesian3),d="垂直距离:"+bt(e[1],e[2]);n=wt(c,d),gt.push(n);var m=Cesium.Cartesian3.midpoint(e[2],e[3],new Cesium.Cartesian3),p="直线距离:"+bt(e[2],e[3]);o=wt(m,p),gt.push(o)}else{l=new Cesium.Cartesian3(r.x,r.y,e[0].z);e.push(l),e.push(r),e.push(e[0]),Ct(e)}}),Cesium.ScreenSpaceEventType.MOUSE_MOVE);else{e.pop(),e.pop(),e.pop();var s=Cesium.Cartographic.fromCartesian(r),a=Cesium.Cartographic.fromCartesian(e[0]).height,l=Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(s.longitude),Cesium.Math.toDegrees(s.latitude),a);e.push(l),e.push(r),e.push(e[0]),yt(r),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK),vt.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)}}),Cesium.ScreenSpaceEventType.LEFT_CLICK)},clearMeasure:function(t){vt=t;for(var e=0;e<gt.length;e++)vt.entities.remove(gt[e]);gt=[]},drawBoundary:function(t,e,i){let n=Object.assign({},$t,i);Qt=t;const o=function(t){const e=[];return t.features.forEach((t=>{const{coordinates:i,type:n}=t.geometry;if("MultiPolygon"===n)i.forEach((t=>{t.forEach((t=>{e.push(t.flat())}))}));else{const t=[];i[0].forEach((e=>{t.push(e.flat())})),e.push(t)}})),e}(e),r=function(t,e){let i=[new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(t[0]))];const n=new Cesium.GeometryInstance({id:"boundary-polygon",geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray([0,0,0,90,179,90,179,0]),i)})}),o=new Cesium.GroundPrimitive({geometryInstances:n,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString(e.fillColor).withAlpha(e.fillOpacity)})})});return Qt.scene.primitives.add(o),o}(o,n),s=function(t,e){const i=t.map((t=>new Cesium.GeometryInstance({id:"boundary-line",geometry:Cesium.WallGeometry.fromConstantHeights({positions:Cesium.Cartesian3.fromDegreesArray(t),minimumHeight:2e3,maximumHeight:1e3,vertexFormat:Cesium.MaterialAppearance.VERTEX_FORMAT})}))),n=new Cesium.Primitive({geometryInstances:i,appearance:new Cesium.MaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.fromCssColorString(e.lineColor).withAlpha(e.fillOpacity)})})});return Qt.scene.primitives.add(n),n}(o,n);return[r,s]},addGroundSkyBox:function(t,e,i=!0){qt=t,Xt=new Yt({sources:e,nearGround:!0}),i?(Kt=qt.scene.skyBox,qt.scene.postRender.addEventListener(Jt)):Jt()},removeGroundSkyBox:function(t){qt=t,qt.scene.skyBox=Kt,qt.scene.skyAtmosphere.show=!1,qt.scene.postRender.removeEventListener(Jt)},getPolygonCenter:(t=[])=>{let e=ct(s(t));return[e.geometry.coordinates[0],e.geometry.coordinates[1]]}},En={getLayerAll:function(t){return{dataSources:t.dataSources,primitives:t.scene.primitives}},hasLayer:function(t,e){let i=null;return t.dataSources.length>0&&(i=t.dataSources.getByName(e)),i},showLayer:function(t,e,i=!1){if(t.dataSources.length>0){let n=t.dataSources._dataSources.find((t=>t.name==e));n&&(n.show=i)}if(t.scene.primitives.length>0){let n=[...t.scene.primitives._primitives];for(let t=0;t<n.length;t++){let o=n[t];if(o instanceof Cesium.BillboardCollection){o._billboards.findIndex((t=>t.id&&t.id.layerId==e))>=0&&(o.show=i)}else if(o instanceof Cesium.LabelCollection){o._labels.findIndex((t=>t.id&&t.id.layerId==e+"_text"))>=0&&(o.show=i)}}}},showLayerText:function(t,e,i=!1){if(t.dataSources.length>0){let n=t.dataSources._dataSources.find((t=>t.name==e));n&&n.entities.values.forEach((t=>{t.label&&(t.label.show=i)}))}if(t.scene.primitives.length>0){let n=[...t.scene.primitives._primitives];for(let t=0;t<n.length;t++){let o=n[t];if(o instanceof Cesium.LabelCollection){if(o._labels.findIndex((t=>t.id&&t.id.layerId==e+"_text"))>=0){o.show=i;break}}}}},removeLayer:function(t,e){if(t.dataSources.length>0){let i=t.dataSources._dataSources.find((t=>t.name==e));i&&t.dataSources.remove(i)}if(t.scene.primitives.length>0){let i=[...t.scene.primitives._primitives];for(let n=0;n<i.length;n++){let o=i[n];if(o instanceof Cesium.BillboardCollection){o._billboards.findIndex((t=>t.id&&t.id.layerId==e))>=0&&t.scene.primitives.remove(o)}else if(o instanceof Cesium.LabelCollection){o._labels.findIndex((t=>t.id&&t.id.layerId==e+"_text"))>=0&&t.scene.primitives.remove(o)}}}},removeLayerAll:function(t){t.dataSources.removeAll(),t.scene.primitives.removeAll()},removePrimitiveLayer:function(t,e){t.scene.primitives.remove(e)},removeEntityLayer:function(t,e){t.entities.remove(e)}},An={addEntityPoint:(t,e)=>{const i=Object.assign({},te,e),n=i.image||{},o=i.text||{},r=i.data||[],s=i.props||{},a=void 0===i.show||i.show,l=new Cesium.CustomDataSource(i.id);if(t.dataSources.add(l),r.forEach((t=>{if(t[s.lgtd]&&t[s.lttd]){var e=new Cesium.Entity({name:t.id,show:a,position:Cesium.Cartesian3.fromDegrees(Number(t[s.lgtd]),Number(t[s.lttd]),Number(t[s.height]||0)),billboard:Object.assign({image:t.image||n.image,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,zIndex:0},n),label:o.show?Object.assign({text:t[s.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.fromCssColorString("#000000").withAlpha(1),outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},o.style):null,description:JSON.stringify(t)});l.entities.add(e)}})),i.cluster.enabled){let t=function(){e=e&&e.destroy()},e=null;t();const n=new Cesium.PinBuilder;let o;l.clustering.enabled=!0,l.clustering.pixelRange=i.cluster.pixelRange||30,l.clustering.minimumClusterSize=i.cluster.minimumClusterSize||2;(()=>{Cesium.defined(o)?(o(),o=void 0):o=l.clustering.clusterEvent.addEventListener(((t,e)=>{if(0==e.label.id.length||!e.label.id[0])return e.label.show=!1,void(e.billboard.show=!1);const i=t.length>100?"99+":t.length;e.label.show=!1,e.billboard.show=!0,e.billboard.id=e.label.id,e.billboard.verticalOrigin=Cesium.VerticalOrigin.BOTTOM,e.billboard.image=n.fromText(i,Cesium.Color.VIOLET,40).toDataURL()}))})()}},addPrimitivePoint:(t,e)=>{let i=Object.assign({},te,e),n=i.image||{},o=i.text||{},r=i.data||[],s=i.props||{};const a=void 0===i.show||i.show,l=t.scene.primitives.add(new Cesium.BillboardCollection({scene:t.scene})),h=t.scene.primitives.add(new Cesium.LabelCollection({scene:t.scene}));r.forEach((t=>{t[s.lgtd]&&t[s.lttd]&&(l.add(Object.assign({id:Object.assign({layerId:i.id},t),show:a,position:Cesium.Cartesian3.fromDegrees(t[s.lgtd],t[s.lttd],t[s.height]||0),image:t.image||n.image,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,zIndex:0},n)),o.show&&h.add(Object.assign({id:Object.assign({layerId:i.id+"_text"},t),show:a,position:Cesium.Cartesian3.fromDegrees(t[s.lgtd],t[s.lttd],t[s.height]||0),text:t[s.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,n.height||20)},o.style)))}))},addFlashPoint:(t,e)=>{let i=Object.assign({},te,e),n=Object.assign({},te.point,e.point),o=i.data||[],r=i.props||{};const s=void 0===i.show||i.show;let a=new Cesium.CustomDataSource(i.id);t.dataSources.add(a),o.forEach((t=>{if(t[r.lgtd]&&t[r.lttd]){t.size=n.size;var e=new Cesium.Entity({name:t.id,show:s,position:Cesium.Cartesian3.fromDegrees(t[r.lgtd],t[r.lttd],t[r.height]||0),point:Object.assign({show:!0,color:t.color||Cesium.Color.RED.withAlpha(.7),pixelSize:new Cesium.CallbackProperty((()=>(t.size=t.size+n.speed,t.size>=n.maxSize&&(t.size=n.size),t.size)),!1),outlineWidth:0,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND},n),description:JSON.stringify(t)});a.entities.add(e)}}))},addEntityLine:(t,e)=>{let i=Object.assign({},xi,e),n=i.line||{},o=i.text||{},r=i.props||{},s=i.data||[];s=s.filter((t=>t[r.lglt]));const a=void 0===i.show||i.show;let l=new Cesium.CustomDataSource(i.id);t.dataSources.add(l),s.forEach((t=>{let e=t[r.lglt].flat(),i=Cesium.Cartesian3.fromDegreesArray(e);var s=new Cesium.Entity({name:"line_"+t.id,show:a,polyline:Object.assign({positions:i,width:n.width||5,material:Cesium.Color.RED,clampToGround:!0,zIndex:0},n),description:JSON.stringify(t)});if(l.entities.add(s),o.show){const e=bi(i);let n={name:"line_text_"+t.id,show:a,position:e,label:Object.assign({text:t[r.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},o),description:JSON.stringify(t)};l.entities.add(n)}}))},addPrimitiveLine:(t,e)=>{let i=Object.assign({},xi,e),n=i.line||{};i.text;let o=i.data||[],r=i.props||{};const s=void 0===i.show||i.show;let a=[];o.forEach((t=>{let e=t[r.lglt].flat();a.push(new Cesium.GeometryInstance({id:Object.assign({layerId:i.id},t),show:s,geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(e),width:n.width||5})}))}));const l=new Cesium.GroundPolylinePrimitive({geometryInstances:a,appearance:new Cesium.PolylineMaterialAppearance({material:Cesium.Material.fromType("Color",{color:Cesium.Color.AQUA})})});t.scene.primitives.add(l)},addPolylineTrail:(t,e)=>{let i=Object.assign({},wi,e),n=i.data||[],o=i.props||{},r=[];n.forEach((t=>{let e=t[o.lglt].flat();r.push(new Cesium.GeometryInstance({id:Object.assign({layerId:i.id},t),geometry:new Cesium.GroundPolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(e),width:i.width||5})}))}));const s=new Cesium.GroundPolylinePrimitive({geometryInstances:r,appearance:new Cesium.PolylineMaterialAppearance({material:new Ci({color:new Cesium.Color.fromCssColorString(i.color),image:i.image,speed:i.speed,repeat:i.repeat,type:i.type})})});t.scene.primitives.add(s)},addEntityPolygon:(t,e)=>{let i=Object.assign({},Ei,e),n=i.polygon||{},o=i.text||{},r=i.props||{},s=i.data||[];const a=void 0===i.show||i.show;s=s.filter((t=>t[r.lglt]));let l=new Cesium.CustomDataSource(i.id);t.dataSources.add(l),s.forEach((t=>{let e=t[r.lglt].flat(),s=null,h=Object.assign({},n);i.isCustomColor&&(h=Object.assign({},h,t)),!h.extrudedHeight&&h.outline&&(s={show:a,positions:Cesium.Cartesian3.fromDegreesArray(e),width:h.outlineWidth,material:h.outlineColor,arcType:Cesium.ArcType.RHUMB,clampToGround:!0,zIndex:h.zIndex||0});let u=Cesium.Cartesian3.fromDegreesArray(e);var c=new Cesium.Entity({name:"polygon_"+t.id,show:a,polygon:Object.assign({hierarchy:u,material:Cesium.Color.RED,clampToGround:!0,zIndex:0},h),polyline:s,description:JSON.stringify(t)});if(l.entities.add(c),o.show){const e=Cesium.BoundingSphere.fromPoints(u).center,i=Cesium.Cartographic.fromCartesian(e),n=Cesium.Math.toDegrees(i.longitude),s=Cesium.Math.toDegrees(i.latitude);let h={name:"polygon_text_"+t.id,show:a,position:Cesium.Cartesian3.fromDegrees(n,s,0),label:Object.assign({text:t[r.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.BLACK,outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},o),description:JSON.stringify(t)};l.entities.add(h)}}))},addPrimitivePolygon:(t,e)=>{let i=Object.assign({},Ei,e);i.polygon,i.text;let n=i.data||[],o=i.props||{},r=[];n.forEach((t=>{let e=t[o.lglt].flat();r.push(new Cesium.GeometryInstance({id:Object.assign({layerId:i.id},t),geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(e))}),attributes:{color:Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)}}))}));const s=new Cesium.GroundPrimitive({geometryInstances:r});t.scene.primitives.add(s)},addPolylineVolume:(t,e)=>{let i=Object.assign({},Ai,e),n=i.props||{},o=i.data||[],r=i.style||{};o=o.filter((t=>t[n.lglt]));let s=new Cesium.CustomDataSource(i.id);function a(t,e){var i=[];let n=t?0:-45,o=t?360:325,r=t?10:90;for(;n<o;n++){var s=Cesium.Math.toRadians(n);i.push(new Cesium.Cartesian2(e*Math.cos(s),e*Math.sin(s))),n+=r}return i}t.dataSources.add(s),o.forEach((t=>{let e=t[n.lglt].flat();var o=new Cesium.Entity({name:"line_"+t.id,show:!0,polylineVolume:Object.assign({},r,{positions:Cesium.Cartesian3.fromDegreesArrayHeights(e),shape:a(i.isCircle,i.width)})});s.entities.add(o)}))},addPrimitiveWall:(t,e)=>{let i=Object.assign({},Ti,e),n=i.data||[],o=i.props||{},r=[];n.forEach((async t=>{let e=t[o.lglt].flat();if(i.isGround){let n=await Pi(t[o.lglt],i.height);r.push(new Cesium.GeometryInstance({id:i.id,geometry:new Cesium.WallGeometry({positions:Cesium.Cartesian3.fromDegreesArray(e),minimumHeights:n.minimumHeights,maximumHeights:n.maximumHeights})}))}else r.push(new Cesium.GeometryInstance({id:i.id,geometry:Cesium.WallGeometry.fromConstantHeights({positions:Cesium.Cartesian3.fromDegreesArray(e),maximumHeight:i.maximumHeight,minimumHeight:i.minimumHeight,vertexFormat:Cesium.MaterialAppearance.VERTEX_FORMAT})}))}));const s=new Cesium.Primitive({geometryInstances:r,appearance:new Cesium.MaterialAppearance({material:new Si({color:new Cesium.Color.fromCssColorString(i.color),image:i.image,speed:i.speed,repeat:i.repeat})})});return t.scene.primitives.add(s),s},addPrimitiveRadar:(t,e)=>{let i=Object.assign({},Mi,e),n=Cesium.Cartesian3.fromDegrees(i.center.lgtd,i.center.lttd);const o=new Cesium.Primitive({geometryInstances:[new Cesium.GeometryInstance({id:i.id,geometry:new Cesium.EllipseGeometry({center:n,semiMajorAxis:i.radius,semiMinorAxis:i.radius,height:i.height})})],appearance:new Cesium.MaterialAppearance({material:new Li(i.style),flat:!1,faceForward:!1,translucent:!0,closed:!1})});t.scene.primitives.add(o)},addWaterAnimation:(t,e)=>{let i=(e.data||[]).flat(),n=e.style||{};n=Object.assign({},Oi,n);let o,r={show:!0,geometryInstances:new Cesium.GeometryInstance({geometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(i)),vertexFormat:Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,extrudedHeight:n.waterHeight||void 0,height:n.height||void 0})}),appearance:new Cesium.EllipsoidSurfaceAppearance({material:new Cesium.Material({fabric:{type:"Water",uniforms:Object.assign({},{normalMap:"/img/waterNormals.jpg",frequency:8e3,animationSpeed:.02,amplitude:10,specularIntensity:.5,baseWaterColor:Cesium.Color.fromCssColorString("#006ab4").withAlpha(.8),blendColor:Cesium.Color.fromCssColorString("#006ab4")},n)}}),fragmentShaderSource:`\n in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n layout(location = 0) out vec4 out_FragColor;\n\n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n out_FragColor.a=${n.alpha};\n #endif\n }`})};o=n.heightReference&&n.heightReference===Cesium.HeightReference.CLAMP_TO_GROUND?new Cesium.GroundPrimitive(r):new Cesium.Primitive(r),t.scene.primitives.add(o)},addParticleSystemRain:(t,e)=>{Zi(t);let i=Object.assign({},zi,e),{scene:n}=t;const o=i.particleSize,r=1e5,s=new Cesium.Cartesian2(.2*o,4*o);let a=new Cesium.Cartesian3;n.primitives.add(new Cesium.ParticleSystem(Object.assign({modelMatrix:new Cesium.Matrix4.fromTranslation(n.camera.position),speed:-1,lifetime:15,emitter:new Cesium.SphereEmitter(r),startScale:1,endScale:0,image:"/img/rain.png",emissionRate:1e4,startColor:Cesium.Color.WHITESMOKE.withAlpha(0),endColor:Cesium.Color.SILVER.withAlpha(1),imageSize:s,updateCallback:(t,e)=>{a=Cesium.Cartesian3.normalize(t.position,a),a=Cesium.Cartesian3.multiplyByScalar(a,-1050,a),t.position=Cesium.Cartesian3.add(t.position,a,t.position);const i=Cesium.Cartesian3.distance(n.camera.position,t.position);t.endColor.alpha=i>r?0:Cesium.Color.SILVER.alpha/(i/r+.1)}},i))),console.log(i),n.skyAtmosphere.hueShift=-.97,n.skyAtmosphere.saturationShift=.25,n.skyAtmosphere.brightnessShift=-.4,n.fog.density=25e-5,n.fog.minimumBrightness=.01},addParticleSystemSnow:(t,e)=>{Zi(t);let i=Object.assign({},Bi,e),{scene:n}=t;const o=1e5,r=new Cesium.Cartesian2(i.particleSize,i.particleSize),s=new Cesium.Cartesian2(2*i.particleSize,2*i.particleSize);let a=new Cesium.Cartesian3;n.primitives.add(new Cesium.ParticleSystem({modelMatrix:new Cesium.Matrix4.fromTranslation(n.camera.position),minimumSpeed:-.2,maximumSpeed:0,lifetime:15,emitter:new Cesium.SphereEmitter(o),startScale:.5,endScale:1,image:"/img/snow.png",emissionRate:5e3,startColor:Cesium.Color.WHITE.withAlpha(0),endColor:Cesium.Color.WHITE.withAlpha(1),minimumImageSize:r,maximumImageSize:s,updateCallback:function(t,e){a=Cesium.Cartesian3.normalize(t.position,a),Cesium.Cartesian3.multiplyByScalar(a,Cesium.Math.randomBetween(-30,-300),a),t.velocity=Cesium.Cartesian3.add(t.velocity,a,t.velocity);const i=Cesium.Cartesian3.distance(n.camera.position,t.position);t.endColor.alpha=i>o?0:1/(i/o+.1)}})),n.skyAtmosphere.hueShift=-.8,n.skyAtmosphere.saturationShift=-.7,n.skyAtmosphere.brightnessShift=-.33,n.fog.density=.001,n.fog.minimumBrightness=.8},addGlslSnow:(t,e)=>{Zi(t);let i=Object.assign({},Ri,e),{scene:n}=t;Di=new Cesium.PostProcessStage({name:"glsl_snow",fragmentShader:"// 下雪\r\nuniform sampler2D colorTexture;\r\nin vec2 v_textureCoordinates;\r\nuniform float snowSpeed;\r\nuniform float snowSize;\r\nout vec4 vFragColor;\r\nfloat snow(vec2 uv, float scale) {\r\n float time = czm_frameNumber / snowSpeed;\r\n float w = smoothstep(1., 0., -uv.y * (scale / 10.));\r\n if (w < .1) return 0.;\r\n uv += time / scale;\r\n uv.y += time * 2. / scale;\r\n uv.x += sin(uv.y + time * .5) / scale;\r\n uv *= scale;\r\n vec2 s = floor(uv), f = fract(uv), p;\r\n float k = 3., d;\r\n p = .5 + .35 * sin(11. * fract(sin((s + p + scale) * mat2(7, 3, 6, 5)) * 5.)) - f;\r\n d = length(p);\r\n k = min(d, k);\r\n k = smoothstep(0., k, sin(f.x + f.y) * snowSize);\r\n return k * w;\r\n}\r\nvoid main(void) {\r\n vec2 resolution = czm_viewport.zw;\r\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\r\n vec3 finalColor = vec3(0);\r\n // float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\r\n float c = 0.;\r\n c += snow(uv, 30.) * .0;\r\n c += snow(uv, 20.) * .0;\r\n c += snow(uv, 15.) * .0;\r\n c += snow(uv, 10.);\r\n c += snow(uv, 8.);\r\n c += snow(uv, 6.);\r\n c += snow(uv, 5.);\r\n finalColor = (vec3(c));\r\n vFragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor, 1), .5);\r\n}",uniforms:{snowSize:()=>i.snowSize,snowSpeed:()=>i.snowSpeed}}),n.postProcessStages.add(Di)},addGlslRain:(t,e)=>{Zi(t);let i=Object.assign({},Ii,e),{scene:n}=t;ki=new Cesium.PostProcessStage({name:"glsl_rain",fragmentShader:"// 下雨\r\nuniform sampler2D colorTexture;\r\nin vec2 v_textureCoordinates;\r\nuniform float tiltAngle;\r\nuniform float rainSize;\r\nuniform float rainSpeed;\r\nout vec4 vFragColor;\r\nfloat hash(float x) { return fract(sin(x * 133.3) * 13.13); }\r\nvoid main(void) {\r\n float time = czm_frameNumber / rainSpeed;\r\n vec2 resolution = czm_viewport.zw;\r\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\r\n vec3 c = vec3(.6, .7, .8);\r\n float a = tiltAngle;\r\n float si = sin(a), co = cos(a);\r\n uv *= mat2(co, -si, si, co);\r\n uv *= length(uv + vec2(0, 4.9)) * rainSize + 1.;\r\n float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);\r\n float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;\r\n c *= v * b;\r\n vFragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), .5);\r\n}",uniforms:{tiltAngle:()=>i.tiltAngle,rainSize:()=>i.rainSize,rainSpeed:()=>i.rainSpeed}}),n.postProcessStages.add(ki)},resetSunnyDay:t=>{let{scene:e}=t;Zi(t),e.skyAtmosphere.hueShift=0,e.skyAtmosphere.saturationShift=0,e.skyAtmosphere.brightnessShift=0,e.fog.density=25e-5,e.fog.minimumBrightness=.01},addGlslFog:(t,e)=>{Zi(t);let i=Object.assign({},Ni,e),{scene:n}=t;Fi=new Cesium.PostProcessStage({name:"glsl_fog",fragmentShader:"// 雾\r\nuniform sampler2D colorTexture;\r\nuniform sampler2D depthTexture;\r\nuniform float visibility;\r\nuniform vec4 fogColor;\r\nin vec2 v_textureCoordinates;\r\nout vec4 vFragColor;\r\nvoid main(void) {\r\n vec4 origcolor = texture(colorTexture, v_textureCoordinates);\r\n float depth = czm_readDepth(depthTexture, v_textureCoordinates);\r\n vec4 depthcolor = texture(depthTexture, v_textureCoordinates);\r\n float f = visibility * (depthcolor.r - 0.3) / 0.2;\r\n if (f < 0.0) f = 0.0;\r\n else if (f > 1.0) f = 1.0;\r\n vFragColor = mix(origcolor, fogColor, f);\r\n}",uniforms:{visibility:()=>i.visibility,fogColor:()=>i.color}}),n.postProcessStages.add(Fi)},createWaterSmoke:(t,e,i)=>{Hi=Object.assign({},Hi,i),console.log("defaultOption",Hi);var n=new Cesium.ParticleSystem({image:"/img/smoke.png",startColor:Cesium.Color.WHITE.withAlpha(0),endColor:Cesium.Color.WHITE.withAlpha(.65),startScale:10,endScale:10,particleLife:5,minimumParticleLife:1.5,maximumParticleLife:1.7,minimumSpeed:1.5,maximumSpeed:2.5,imageSize:new Cesium.Cartesian2(3,3),sizeInMeters:!0,emissionRate:Hi.emissionRate,emitter:new Cesium.CircleEmitter(Hi.width),modelMatrix:ji(e),emitterModelMatrix:Wi(),updateCallback:Vi});t.scene.primitives.add(n)},createFire:(t,e,i)=>{Ui=t,Gi=Object.assign({},Gi,i);var n=new Cesium.ParticleSystem({image:"/img/fire.png",startColor:Cesium.Color.RED.withAlpha(.1),endColor:Cesium.Color.YELLOW.withAlpha(.5),startScale:2*Gi.scale,endScale:Gi.scale,minimumParticleLife:1.5,maximumParticleLife:2,minimumSpeed:29,maximumSpeed:30,imageSize:new Cesium.Cartesian2(1,1),sizeInMeters:!0,emissionRate:Gi.emissionRate,emitter:new Cesium.CircleEmitter(Gi.width),modelMatrix:Yi(e),emitterModelMatrix:Xi(),updateCallback:Gi.isWind?qi:null});Ui.scene.primitives.add(n)},addEntityGif:(t,e)=>{let i=Object.assign({},se,e),n=i.props,o=i.data||[];const r=i.style||{},s=i.text||{},a=void 0===i.show||i.show;let l=new Cesium.CustomDataSource(i.id);t.dataSources.add(l),o.forEach((t=>{let e=t[n.image];if(e&&t[n.lgtd]&&t[n.lttd]){let o=document.createElement("div"),h=document.createElement("img");o.appendChild(h),h.src=e,h.onload=()=>{let e=re({gif:h});e.load((()=>{var o=new Cesium.Entity({name:t.id,show:a,position:Cesium.Cartesian3.fromDegrees(t[n.lgtd],t[n.lttd]),billboard:Object.assign({image:new Cesium.CallbackProperty((()=>e.get_canvas().toDataURL("image/png")),!1),scale:t[n.scale]||i.scale,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.BOTTOM,zIndex:0},r),label:s.show?Object.assign({text:t[n.name],font:"12px Helvetica",fillColor:Cesium.Color.WHITE,outlineColor:Cesium.Color.fromCssColorString("#000000").withAlpha(1),outlineWidth:1,style:Cesium.LabelStyle.FILL_AND_OUTLINE,heightReference:Cesium.HeightReference.CLAMP_TO_GROUND,pixelOffset:new Cesium.Cartesian2(0,5)},s.style):null,description:JSON.stringify(t)});l.entities.add(o)}))}}}))},addCloud:(t,e)=>{let i=Object.assign({},fi,e),n=i.props,o=i.data||[];var r=t.scene.primitives.add(new Cesium.CloudCollection);o.forEach((t=>{console.log("item",t),r.add({position:Cesium.Cartesian3.fromDegrees(t[n.lgtd],t[n.lttd],t.height),scale:new Cesium.Cartesian2(t.scaleX||i.scaleX,t.scaleY||i.scaleY),slice:t.slice||i.slice,maximumSize:new Cesium.Cartesian3(90,15,13),brightness:t.brightness||i.brightness})}))},addGlobalCloud:(t,e={},i=!1)=>{let n;_i=t,vi=Object.assign({},yi,e),console.log("cloudConfig",vi),i&&(n=new pi,n.add(vi,"cloudCover",0,1).name("云量"),n.add(vi,"cloudBase",0,1e4).name("云的底部高度"),n.add(vi,"cloudTop",0,2e4).name("云的顶部高度"),n.add(vi,"cloudThickness",0,8e3).name("云层厚度"),n.add(vi,"windSpeedRatio",0,.01,1e-4).name("风速"));let o=new Cesium.PostProcessStage({fragmentShader:"// 全球体积云\r\nprecision highp float;\r\nuniform float realPlanetRadius; //地球半径\r\nuniform float windSpeedRatio; //风速\r\nuniform float cloudCover; //云量\r\nuniform float cloudBase; //云的底部高度\r\nuniform float cloudTop; //云的顶部高度\r\nuniform vec3 windVector; //方向\r\nuniform float cloudThickness; //云层厚度\r\nuniform float cloudBaseRadius; //云层底部半径\r\nuniform float cloudTopRadius; //云层顶部半径\r\n\r\nconst float PI = 3.14159265359;\r\nconst float TWO_PI = 6.28318530718;\r\nconst float FOUR_PI = 12.5663706144;\r\n\r\n#define CLOUDS_MAX_LOD 1\r\n#define CLOUDS_MARCH_STEP 500.0 //外部每次步进\r\n#define CLOUDS_DENS_MARCH_STEP 100.0 //云内每次步进\r\n#define MAXIMUM_CLOUDS_STEPS 300 //最大步进次数\r\n#define CLOUDS_MAX_VIEWING_DISTANCE 250000.0\r\n\r\n//射线与球体相交 可参考 https://zhuanlan.zhihu.com/p/645281439\r\nvec2 raySphereIntersect(vec3 r0, vec3 rd, float sr) {\r\n float a = dot(rd, rd);\r\n float b = 2.0 * dot(rd, r0);\r\n float c = dot(r0, r0) - (sr * sr);\r\n float d = (b * b) - 4.0 * a * c;\r\n\r\n if (d < 0.0)\r\n return vec2(-1.0, -1.0);\r\n float squaredD = sqrt(d);\r\n\r\n return vec2((-b - squaredD) / (2.0 * a), (-b + squaredD) / (2.0 * a));\r\n}\r\n\r\nfloat saturate(float value) { return clamp(value, 0.0, 1.0); }\r\n\r\nfloat isotropic() {\r\n return 0.07957747154594767; // 1.0 / (4.0 * PI);\r\n}\r\n\r\nfloat rayleigh(float costh) {\r\n return (3.0 / (16.0 * PI)) * (1.0 + pow(costh, 2.0));\r\n}\r\n\r\nfloat Schlick(float k, float costh) {\r\n return (1.0 - k * k) / (FOUR_PI * pow(1.0 - k * costh, 2.0));\r\n}\r\nfloat g = 0.9;\r\n\r\nfloat hash(float p) {\r\n p = fract(p * .1031);\r\n p *= p + 33.33;\r\n p *= p + p;\r\n return fract(p);\r\n}\r\n\r\n//噪声\r\nfloat noise(in vec3 x) {\r\n vec3 p = floor(x);\r\n vec3 f = fract(x);\r\n f = f * f * (3.0 - 2.0 * f);\r\n float n = p.x + p.y * 157.0 + 113.0 * p.z;\r\n return mix(mix(mix(hash(n + 0.0), hash(n + 1.0), f.x),\r\n mix(hash(n + 157.0), hash(n + 158.0), f.x), f.y),\r\n mix(mix(hash(n + 113.0), hash(n + 114.0), f.x),\r\n mix(hash(n + 270.0), hash(n + 271.0), f.x), f.y),\r\n f.z);\r\n}\r\n\r\n//云的密度\r\nfloat cloudDensity(vec3 p, vec3 wind, int lod, inout float heightRatio) {\r\n float finalCoverage = cloudCover;\r\n if (finalCoverage <= 0.1) {\r\n return 0.0;\r\n }\r\n float height = length(p) - realPlanetRadius;\r\n heightRatio = (height - cloudBase) / cloudThickness;\r\n float positionResolution = 0.002;\r\n p = p * positionResolution + wind;\r\n float shape = noise(p * 0.3);\r\n float shapeHeight = noise(p * 0.05);\r\n float bn = 0.50000 * noise(p);\r\n p = p * 2.0;\r\n if (lod >= 1) {\r\n bn += 0.20000 * noise(p);\r\n p = p * 2.11;\r\n }\r\n float cumuloNimbus = saturate((shapeHeight - 0.5) * 2.0);\r\n cumuloNimbus *= saturate(1.0 - pow(heightRatio - 0.5, 2.0) * 4.0);\r\n float cumulus = saturate(1.0 - pow(heightRatio - 0.25, 2.0) * 25.0) * shapeHeight;\r\n float stratoCumulus = saturate(1.0 - pow(heightRatio - 0.12, 2.0) * 60.0) * (1.0 - shapeHeight);\r\n float dens = saturate(stratoCumulus + cumulus + cumuloNimbus) * 2.0 * finalCoverage;\r\n dens -= 1.0 - shape;\r\n dens -= bn;\r\n return clamp(dens, 0.0, 1.0);\r\n}\r\n\r\nprecision highp float;\r\nuniform sampler2D noiseTexture;\r\nin vec2 v_textureCoordinates;\r\nvec3 skyAmbientColor = vec3(0.705, 0.850, 0.952); // 0.219, 0.380, 0.541\r\nvec3 groundAmbientColor = vec3(0.741, 0.898, 0.823); // 0.639, 0.858, 0.721\r\nfloat distanceQualityR = 0.00005; // LOD/quality ratio\r\nfloat minDistance = 10.0; // avoid cloud in cockpit\r\n\r\nvec4 calculate_clouds(vec3 start, vec3 dir, float maxDistance, vec3 light_dir, vec3 wind) {\r\n vec4 cloud = vec4(0.0, 0.0, 0.0, 1.0);\r\n vec2 toTop = raySphereIntersect(start, dir, cloudTopRadius);\r\n vec2 toCloudBase = raySphereIntersect(start, dir, cloudBaseRadius);\r\n float startHeight = length(start) - realPlanetRadius;\r\n float absoluteMaxDistance = CLOUDS_MAX_VIEWING_DISTANCE;\r\n float tmin = minDistance;\r\n float tmax = maxDistance;\r\n\r\n if (startHeight > cloudTop) {\r\n if (toTop.x < 0.0)\r\n return vec4(0.0); // no intersection with cloud layer\r\n tmin = toTop.x;\r\n if (toCloudBase.x > 0.0) {\r\n tmax = min(toCloudBase.x, maxDistance);\r\n } else {\r\n tmax = min(toTop.y, maxDistance);\r\n }\r\n } else if (startHeight < cloudBase) {\r\n tmin = toCloudBase.y;\r\n tmax = min(toTop.y, maxDistance);\r\n } else {\r\n if (toCloudBase.x > 0.0) {\r\n tmax = min(toCloudBase.x, maxDistance);\r\n } else {\r\n tmax = min(toTop.y, maxDistance);\r\n }\r\n }\r\n\r\n tmin = max(tmin, minDistance);\r\n tmax = min(tmax, absoluteMaxDistance);\r\n\r\n if (tmax < tmin)\r\n return vec4(0.0); // object obstruction\r\n\r\n float rayLength = tmax - tmin; //步进总距离\r\n float longMarchStep = rayLength / float(MAXIMUM_CLOUDS_STEPS); //步进距离/步进次数=每次步进的距离\r\n longMarchStep = max(longMarchStep, CLOUDS_MARCH_STEP); //每次步进多少\r\n\r\n float shortMarchStep = CLOUDS_DENS_MARCH_STEP;\r\n float numberApproachSteps = (CLOUDS_MARCH_STEP / CLOUDS_DENS_MARCH_STEP) * 2.0;\r\n float distance = tmin; //\r\n float dens = 0.0;\r\n float marchStep;\r\n\r\n float lastDensity;\r\n float kInScattering = 0.99;\r\n float dotLightRay = dot(dir, light_dir);\r\n float inScattering = Schlick(kInScattering, dotLightRay);\r\n float outScattering = isotropic();\r\n float sunScatteringPhase = mix(outScattering, inScattering, dotLightRay);\r\n float ambientScatteringPhase = isotropic();\r\n bool inCloud = false;\r\n float stepsBeforeExitingCloud = 0.0;\r\n\r\n for (int i = 0; i < MAXIMUM_CLOUDS_STEPS; i++) {\r\n vec3 position = start + dir * distance;\r\n int qualityRatio = int(distance * distanceQualityR);\r\n int lod = CLOUDS_MAX_LOD - qualityRatio;\r\n float heightRatio;\r\n\r\n if (inCloud == true) {\r\n marchStep = shortMarchStep;\r\n } else {\r\n marchStep = longMarchStep;\r\n lod = 0;\r\n }\r\n\r\n dens = cloudDensity(position, wind, lod, heightRatio);\r\n\r\n if (dens > 0.01) {\r\n if (inCloud != true) {\r\n inCloud = true;\r\n stepsBeforeExitingCloud = numberApproachSteps;\r\n distance = clamp(distance - CLOUDS_MARCH_STEP, tmin,tmax); // 第一次进入云 回退一步\r\n continue;\r\n }\r\n\r\n float deltaDens = clamp((dens - lastDensity) * 10.0, -1.0, 1.0);\r\n float lighting = (abs(deltaDens - dotLightRay) / 2.0) * clamp((heightRatio - 0.02) * 20.0, 0.5, 1.0);\r\n lastDensity = dens;\r\n float scatteringCoeff = 0.15 * dens;\r\n float extinctionCoeff = 0.01 * dens;\r\n cloud.a *= exp(-extinctionCoeff * marchStep);\r\n float sunIntensityAtSurface = clamp(0.2 - dens, 0.0, 1.0);\r\n vec3 sunLight = lighting * czm_lightColor * sunIntensityAtSurface * czm_lightColor.z;\r\n vec3 ambientSun = czm_lightColor * sunIntensityAtSurface * czm_lightColor.z * isotropic();\r\n vec3 skyAmbientLight = (skyAmbientColor * czm_lightColor.z + ambientSun);\r\n vec3 groundAmbientLight = (groundAmbientColor * czm_lightColor.z * 0.5 + ambientSun);\r\n vec3 ambientLight = mix(groundAmbientLight, skyAmbientLight, heightRatio);\r\n vec3 stepScattering = scatteringCoeff * marchStep * (sunScatteringPhase * sunLight + ambientScatteringPhase * ambientLight);\r\n cloud.rgb += cloud.a * stepScattering;\r\n\r\n if (cloud.a < 0.01) {\r\n cloud.a = 0.0;\r\n break;\r\n }\r\n } else {\r\n if (stepsBeforeExitingCloud > 0.0) {\r\n stepsBeforeExitingCloud--;\r\n } else {\r\n inCloud = false;\r\n }\r\n }\r\n\r\n distance += marchStep;\r\n\r\n //步进距离超出总的距离 退出\r\n if (distance > tmax) {\r\n break;\r\n }\r\n }\r\n cloud.a = (1.0 - cloud.a);\r\n return cloud;\r\n}\r\n\r\nuniform sampler2D colorTexture;\r\nvoid main() {\r\n vec4 color = texture(colorTexture, v_textureCoordinates);\r\n vec4 rawDepthColor = texture(czm_globeDepthTexture, v_textureCoordinates);\r\n float depth = czm_unpackDepth(rawDepthColor);\r\n if (depth == 0.0) {\r\n depth = 1.0;\r\n }\r\n vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r\n vec4 worldCoordinate = czm_inverseView * positionEC;\r\n vec3 vWorldPosition = worldCoordinate.xyz / worldCoordinate.w;\r\n vec3 posToEye = vWorldPosition - czm_viewerPositionWC;\r\n vec3 direction = normalize(posToEye);\r\n vec3 lightDirection = normalize(czm_sunPositionWC);\r\n float distance = length(posToEye);\r\n\r\n if (depth == 1.0) {\r\n distance = CLOUDS_MAX_VIEWING_DISTANCE;\r\n }\r\n vec3 wind = windVector * czm_frameNumber * windSpeedRatio;\r\n vec4 clouds = calculate_clouds(\r\n czm_viewerPositionWC, // the position of the camera\r\n direction, // the camera vector (ray direction of this pixel)\r\n distance, // max dist, essentially the scene depth\r\n lightDirection, // light direction\r\n wind);\r\n clouds.rgb *= 3.0;\r\n color = mix(color, clouds, clouds.a * clouds.a);\r\n\r\n float exposure = 1.2;\r\n color = vec4(1.0 - exp(-exposure * color));\r\n out_FragColor = color;\r\n}",uniforms:{realPlanetRadius:6378137,windVector:vi.currentWindVectorWC,cloudCover:vi.cloudCover,cloudBase:vi.cloudBase,cloudTop:vi.cloudTop,cloudThickness:vi.cloudThickness,cloudBaseRadius:vi.cloudBaseRadius,cloudTopRadius:vi.cloudTopRadius,windSpeedRatio:vi.windSpeedRatio}});return _i.scene.postProcessStages.add(o),gi=o,setInterval((()=>{!function(){if(!_i.scene.context._us.globeDepthTexture)return;gi.uniforms.windVector=vi.currentWindVectorWC,gi.uniforms.cloudCover=vi.cloudCover,gi.uniforms.windSpeedRatio=vi.windSpeedRatio;let t=_i.camera.positionCartographic;t=_i.scene.globe.ellipsoid.cartographicToCartesian(new Cesium.Cartographic(t.longitude,t.latitude,0),new Cesium.Cartesian3);let e=Cesium.Cartesian3.magnitude(t),i=vi.cloudTop-vi.cloudBase,n=e+vi.cloudBase,o=n+i;gi.uniforms.realPlanetRadius=e,gi.uniforms.cloudBase=vi.cloudBase,gi.uniforms.cloudTop=vi.cloudTop,gi.uniforms.cloudThickness=i,gi.uniforms.cloudBaseRadius=n,gi.uniforms.cloudTopRadius=o}()}),1e3),n}},On={loadTile3d:(t,e,i=!0,n,o)=>new Promise((r=>{const s=Object.assign({maximumScreenSpaceError:10,maximumNumberOfLoadedTiles:1e3,maximumMemoryUsage:512,loadSiblings:!0},n);Cesium.Cesium3DTileset.fromUrl(e,s).then((e=>{if(o){const t=Cesium.Cartographic.fromCartesian(e.boundingSphere.center),i=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,0),n=Cesium.Cartesian3.fromRadians(t.longitude,t.latitude,o),r=Cesium.Cartesian3.subtract(n,i,new Cesium.Cartesian3);e.modelMatrix=Cesium.Matrix4.fromTranslation(r)}t.scene.primitives.add(e),r(e),i&&t.flyTo(e)}))})),createModel:(t,e,i={},n={},o=!0)=>{console.log("opt",n);const r=Cesium.Cartesian3.fromDegrees(i.lng||0,i.lat||0,i.height||0),s=Cesium.Math.toRadians(i.heading||135),a=Cesium.Math.toRadians(i.pitch||0),l=Cesium.Math.toRadians(i.roll||0),h=new Cesium.HeadingPitchRoll(s,a,l),u=Cesium.Transforms.headingPitchRollQuaternion(r,h);console.log("opt",n);let c=new Cesium.CustomShader({lightingModel:null==n.lightingModel?Cesium.LightingModel.PBR:n.lightingModel});return new Promise((i=>{const s=t.entities.add({name:e,position:r,orientation:u,model:Object.assign({},{uri:e,customShader:c},n)});o&&(t.trackedEntity=s),i(s)}))}},zn={initFluidViewer:(t,e={},i={},n={},o=!0,r=!1)=>{un=Object.assign({},un,e),cn=Object.assign({},cn,i),mn=Object.assign({},dn,n),console.log("boxInfo, centerInfo",un,cn);let s=tn({boxInfo:un,center:cn});if(o){let e=s.entity;t.entities.add(e),t.flyTo(e)}ln=s.geometry,hn=s.modelMatrix;const a=((t,e)=>{const i=t.attributes.position.values,n=[];for(let r=0;r<i.length;r+=3){const t=new Cesium.Cartesian3(i[r],i[r+1],i[r+2]),o=Cesium.Matrix4.multiplyByPoint(e,t,new Cesium.Cartesian3);n.push(o)}const o=n.map((function(t){return Cesium.Cartographic.fromCartesian(t)}));return console.log("cartographicPositions",o),Cesium.Rectangle.fromCartographicArray(o)})(ln,hn);if(an=new Cesium.Camera(t.scene),an.frustum.near=.1,an.setView({destination:a}),r){const t=new pi;return t.addColor(mn,"color",0,1).name("水体颜色"),t.add(mn,"distance",1,8e3).name("水颜色融合度"),t.add(mn,"highStrength",0,5).name("水高光颜色强度"),t.add(mn,"fminX",0,800).name("喷水位置 x起点"),t.add(mn,"fmaxX",0,800).name("喷水位置 x终点"),t.add(mn,"fminY",0,800).name("喷水位置 y起点"),t.add(mn,"fmaxY",0,800).name("喷水位置 y终点"),t.add(mn,"fHeight",0,100).name("喷水高度"),t.add(mn,"strenght",0,1).name("水强度"),t.add(mn,"attenuation",.9,1,.001).name("水衰减"),t.add(mn,"initialWaterLevel",0,10).name("初始水位"),t.add(mn,"textureSize",500,1500).name("深度图大小"),t}},startFluid:(t,e=[])=>{const{positions:i}=$i(t,an,un.w,un.h,mn.textureSize);0==e.length&&(e=i.map((t=>Cesium.Cartographic.fromCartesian(t).height))),console.log("positionHeights",e);const n=new Float32Array(mn.textureSize*mn.textureSize*4);for(let u=0;u<mn.textureSize*mn.textureSize;u++){const t=e[u],i=en(t,un.h);n[4*u]=i[0],n[4*u+1]=i[1],n[4*u+2]=i[2],n[4*u+3]=i[3]}console.log("hightMap",n);const o=t.scene,r=o.context,s=new Cesium.Texture({context:r,pixelFormat:Cesium.PixelFormat.RGBA,pixelDataType:Cesium.PixelDatatype.FLOAT,source:{arrayBufferView:n,width:mn.textureSize,height:mn.textureSize},sampler:new Cesium.Sampler({minificationFilter:Cesium.TextureMinificationFilter.LINEAR,magnificationFilter:Cesium.TextureMagnificationFilter.LINEAR})}),a=new sn(r,s,ln,hn,un.h,mn);o.primitives.add(a.primitives.bufferA),o.primitives.add(a.primitives.bufferB),o.primitives.add(a.primitives.bufferC),o.primitives.add(a.primitives.bufferD);const l=Cesium.Matrix4.inverse(hn,new Cesium.Matrix4);let h=new Cesium.PostProcessStage({fragmentShader:"uniform sampler2D colorTexture;\r\nuniform sampler2D depthTexture;\r\nin vec2 v_textureCoordinates;\r\nuniform mat4 inverse;\r\nuniform sampler2D bufferC;\r\nuniform float height;\r\nuniform float baseSize; //深度图大小\r\nuniform vec3 waterColor; // 水颜色\r\nuniform float waterDistance; // 水颜色距离\r\nuniform float highStrength; // 水高光颜色强度\r\n\r\nconst vec3 light = vec3(0., 4., 2.);\r\n\r\n//将输入的三维坐标转换为纹理坐标,然后从纹理中读取高度值\r\nvec2 getHeight(in vec3 p, bool real) {\r\n p = ((p / baseSize) + 1.0) * 0.5;\r\n vec2 h = texture(bufferC, p.xz).xy;\r\n h.y += h.x;\r\n return h - baseSize;\r\n}\r\n//根据距离计算雾的强度,并将雾色与原始颜色混合,生成最终的颜色值\r\nvec3 applyFog(in vec3 rgb, vec3 fogColor, in float distance) {\r\n float fogAmount = exp(-distance);\r\n return mix(fogColor, rgb, fogAmount);\r\n}\r\n//计算给定点 p 处的法线向量\r\nvec3 getNormal(in vec3 p, int comp) {\r\n float d = 1.;\r\n float base = baseSize;\r\n float size = 1.0 / float(baseSize);\r\n float hMid = getHeight(p, false)[comp] / base;\r\n float hRight = getHeight(p + vec3(d, 0, 0), false)[comp] / base;\r\n float hTop = getHeight(p + vec3(0, 0, d), false)[comp] / base;\r\n return normalize(\r\n cross(vec3(0, hTop - hMid, size), vec3(size, hRight - hMid, 0)));\r\n}\r\n\r\n// ro 光线的起始点(原点) rd: 光线的方向向量 rad:\r\n// 边界框的半径(实际上是指边界框的大小的一半) oN:\r\n// 输出参数,表示光线与边界框相交点处的法线向量\r\nvec2 boxIntersection(in vec3 ro, in vec3 rd, in vec3 rad, out vec3 oN) {\r\n vec3 m = 1.0 / rd;\r\n vec3 n = m * ro;\r\n vec3 k = abs(m) * rad;\r\n vec3 t1 = -n - k;\r\n vec3 t2 = -n + k;\r\n\r\n float tN = max(max(t1.x, t1.y), t1.z);\r\n float tF = min(min(t2.x, t2.y), t2.z);\r\n\r\n if (tN > tF || tF < 0.0)\r\n return vec2(-1.0); // no intersection\r\n\r\n oN = -sign(rd) * step(t1.yzx, t1.xyz) * step(t1.zxy, t1.xyz);\r\n\r\n return vec2(tN, tF);\r\n}\r\n\r\nvoid main() {\r\n // colorTexture: 颜色纹理图,即场景渲染的结果,或者上一个后处理的结果\r\n // v_textureCoordinates: 纹理坐标,纹理坐标的范围为(0,0)-(1,1)\r\n out_FragColor = texture(colorTexture, v_textureCoordinates);\r\n vec4 rawDepthColor = texture(czm_globeDepthTexture, v_textureCoordinates);\r\n //从深度图中获取深度\r\n float depth = czm_unpackDepth(rawDepthColor);\r\n if (depth == 0.0) {\r\n depth = 1.0;\r\n }\r\n //根据深度和纹理坐标获取像素在相机坐标系的值\r\n vec4 eyeCoordinate4 = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth);\r\n vec3 eyeCoordinate3 = eyeCoordinate4.xyz / eyeCoordinate4.w;\r\n //将相机坐标系的值转为世界坐标系的值\r\n vec4 worldCoordinate4 = czm_inverseView * vec4(eyeCoordinate3, 1.);\r\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\r\n vec4 worldPos = inverse * vec4(worldCoordinate, 1.);\r\n vec4 cameraPos = inverse * vec4(czm_viewerPositionWC, 1.);\r\n vec3 vDirection = worldPos.xyz - cameraPos.xyz; //方向\r\n vec3 rayDir = normalize(vDirection);\r\n vec3 dim = vec3(height); //盒子长宽高\r\n vec3 box_min = vec3(0.) - dim / 2.;\r\n vec3 box_max = vec3(0.) + dim / 2.;\r\n vec3 n;\r\n vec3 ro = cameraPos.xyz;\r\n vec3 rd = rayDir;\r\n vec2 ret = boxIntersection(ro, rd, dim / 2., n);\r\n\r\n //除掉那些不与光线相交的物体 该代码会导致移动至水面时,水面会被隐藏掉\r\n // if (ret.x > 0.0) {\r\n vec3 pi = ro + rd * ret.x; // 获取当前点\r\n // Find Terrain\r\n vec3 tc;\r\n vec3 tn;\r\n float tt = ret.x;\r\n vec2 h = getHeight(pi, true); // 获取当前点的高度\r\n float spec;\r\n bool flag = false;\r\n vec3 currentColor = texture(colorTexture, v_textureCoordinates).rgb;\r\n if (pi.y < h.x) // 如果当前点高度低于采样到的地形高度\r\n {\r\n tn = n;\r\n tc = currentColor; // 获取当前点颜色\r\n flag = true;\r\n } else {\r\n // 使用ray marching算法获取地形高度\r\n for (int i = 0; i < 80; i++) {\r\n vec3 p = ro + rd * tt; // 获取当前点\r\n float h = p.y - getHeight(p, true).x; // 获取当前点高度和地形高度的差值\r\n if (h < 0.0002 ||\r\n tt > ret.y) // 如果差值小于0.0002或者当前点高度大于最大高度\r\n break;\r\n tt += h * 0.4; // 更新当前点高度\r\n }\r\n tc = currentColor; // 获取当前点颜色\r\n }\r\n\r\n if (tt > ret.y) // 如果当前点高度大于最大高度\r\n {\r\n tc = currentColor; // 获取当前点颜色\r\n flag = true;\r\n }\r\n\r\n // Find Water\r\n float wt = ret.x;\r\n h = getHeight(pi, true); // 获取当前点的高度\r\n vec3 waterNormal; // 水法线\r\n if (pi.y < h.y) // 如果当前点高度低于采样到的水高度\r\n {\r\n waterNormal = n; // 获取水法线\r\n } else {\r\n // 使用ray marching算法获取水高度\r\n for (int i = 0; i < 80; i++) {\r\n vec3 p = ro + rd * wt; // 获取当前点\r\n float h = p.y - getHeight(p, true).y; // 获取当前点高度和水高度的差值\r\n if (h < 0.0002 || wt > min(tt, ret.y)) // 如果差值小于0.0002或者当前点高度大于最大高度\r\n break;\r\n wt += h * 0.4; // 更新当前点高度\r\n }\r\n waterNormal = getNormal(ro + rd * wt, 1); // 获取当前点法线\r\n }\r\n\r\n if (wt < ret.y) {\r\n float dist = (min(tt, ret.y) - wt); // 获取水深\r\n vec3 p = waterNormal;\r\n vec3 lightDir = normalize(light - (ro + rd * wt) / 1000.); // 光线方向\r\n\r\n //控制水流颜色\r\n vec3 wColor = waterColor == vec3(0.0) ? vec3(0, 0, 0.6) : waterColor; //若没有设置颜色,则默认为蓝色\r\n float distance = waterDistance == 0.0 ? 1000.0 : waterDistance; // 若没有设置距离,则默认为1000.0\r\n\r\n tc = applyFog(tc, pow(wColor, vec3(1. / 2.2)), dist * 15. / distance); // 雾效果\r\n\r\n float spec = pow(max(0., dot(lightDir, reflect(rd, waterNormal))), 20.0); // 高光\r\n tc += highStrength * spec * smoothstep(0.0, 0.1, dist); // 高光颜色\r\n }\r\n\r\n if (flag) {\r\n return;\r\n }\r\n out_FragColor = vec4(tc, 1.0); // 输出颜色\r\n // }\r\n}",uniforms:{inverse:l,bufferC:a.textures.nextBufferAColor,height:un.h,baseSize:un.h/2,waterColor:()=>(t=>{const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?new Cesium.Color(parseInt(e[1],16)/255,parseInt(e[2],16)/255,parseInt(e[3],16)/255):null})(mn.color),waterDistance:()=>mn.distance,highStrength:()=>mn.highStrength}});t.scene.postProcessStages.add(h)}},kn=Cesium;t.Cesium=kn,t.Popup=class{constructor(t){this.options=t,this.viewer=t.viewer,this.className=t.className,this.html=t.html||null,this.type=t.type||1,this.animate=t.animate||!1,this.isClose=null==t.isClose||t.isClose,this.onClose=t.onClose||null,this.onCloseAll=t.onCloseAll||null,this.id=0,this.ctnList={},t.position&&(t.html||t.content)&&this.add(t)}add(t){var e=t.position,i="popup_"+(65536*(1+Math.random())|0).toString(16)+this.id,n=document.createElement("div");let o=this.className||t.className;return n.className="cesium-popup-container"+(o?" "+o:""),n.id=i,n.addEventListener("click",this.handleFloatingClick),document.getElementById(this.viewer.container.id).appendChild(n),n.innerHTML=this.createHtml(t.html,t.content,t.type,t.animate),this.ctnList[i]=[e,n],this.render(),this.eventListener||(this.eventListener=()=>this.render(),this.viewer.clock.onTick.addEventListener(this.eventListener)),this.isClose&&n.getElementsByClassName("bx-popup-close")&&n.getElementsByClassName("bx-popup-close").length>0&&(n.getElementsByClassName("bx-popup-close")[0].onclick=()=>{this.close(n)}),n}render(){for(var t in this.ctnList){var e=Cesium.SceneTransforms.worldToWindowCoordinates(this.viewer.scene,this.ctnList[t][0]);e&&e.x&&e.y&&(Math.abs(e.x)>2*window.innerWidth||Math.abs(e.y)>2*window.innerHeight?this.ctnList[t][1].style.display="none":(this.ctnList[t][1].style.display="",this.ctnList[t][1].style.left=e.x+"px",this.ctnList[t][1].style.top=e.y+"px"))}}handleFloatingClick(t){console.log("Floating div clicked!"),t.stopPropagation()}createHtml(t,e,i,n){if(t=t||this.html)return t;if(e){i=i||this.type;let o=(n=n||this.animate)?" moveAnimate":"";return t=1==i?`\n ${!1===this.isClose?"":'<div class="bx-popup-close"><span class="iconfont_DEU icon-guanbi">×</span></div>'}\n <div class="popup-wrap ${o}">\n <div class="popup-border">\n <div class="popup-center">\n <div class="bx-popup-header-ctn">\n ${e.header}\n </div>\n <div class="bx-popup-content-ctn" >\n <div class="bx-popup-content" >\n ${e.content}\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="directional"></div>\n `:2==i?`<div class="popup-bg2 ${o}"><div> ${e}</div></div>`:3==i?`<div class="popup-bg3 ${o}"><div> ${e}</div></div>`:4==i?`<div class="popup-bg4 ${o}"><div> ${e}</div></div>`:5==i?`<div class="popup-bg5 ${o}"><div> ${e}</div></div>`:`<div class="popup-bg6 ${o}"><div> ${e}</div></div>`}}close(t){t.remove(),t.removeEventListener("click",this.handleFloatingClick),"function"==typeof this.onClose&&this.onClose(t),delete this.ctnList[t.id],0==Object.keys(this.ctnList).length&&(this.eventListener&&this.viewer.clock.onTick.removeEventListener(this.eventListener),this.eventListener=null)}closeAll(){for(var t in this.ctnList)this.ctnList[t][1].remove(),this.ctnList[t][1].removeEventListener("click",this.handleFloatingClick);this.ctnList={},this.eventListener&&this.viewer.clock.onTick.removeEventListener(this.eventListener),this.eventListener=null,"function"==typeof this.onCloseAll&&this.onCloseAll()}},t.cesiumMap=_t,t.fluidUtils=zn,t.mapDraw=An,t.mapLayers=En,t.mapPopup=Cn,t.mapUtils=Mn,t.miniMap=vn,t.modelUtils=On,t.pageLoad=Ln,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));