UNPKG

454 kBJavaScriptView Raw
1/*!
2 * author: sakitam-fdd <smilefdd@gmail.com>
3 * @sakitam-gis/react-map v0.0.2
4 * build-time: 2018-7-22 20:12
5 * LICENSE: BSD-3-Clause
6 * (c) 2018-2018 https://sakitam-gis.github.io/react-map/
7 */
8!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.ReactMap=e(require("react")):t.ReactMap=e(t.React)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=24)}([function(t,e,i){var r=i(14),n="object"==typeof self&&self&&self.Object===Object&&self,o=r||n||Function("return this")();t.exports=o},function(t,e,i){var r=i(38),n=i(43);t.exports=function(t,e){var i=n(t,e);return r(i)?i:void 0}},function(t,e,i){var r=i(28),n=i(29),o=i(30),s=i(31),a=i(32);function h(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}h.prototype.clear=r,h.prototype.delete=n,h.prototype.get=o,h.prototype.has=s,h.prototype.set=a,t.exports=h},function(t,e,i){var r=i(12);t.exports=function(t,e){for(var i=t.length;i--;)if(r(t[i][0],e))return i;return-1}},function(t,e,i){var r=i(9),n=i(39),o=i(40),s="[object Null]",a="[object Undefined]",h=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?a:s:h&&h in Object(t)?n(t):o(t)}},function(t,e,i){var r=i(1)(Object,"create");t.exports=r},function(t,e,i){var r=i(52);t.exports=function(t,e){var i=t.__data__;return r(e)?i["string"==typeof e?"string":"hash"]:i.map}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,i){var r=i(1)(i(0),"Map");t.exports=r},function(t,e,i){var r=i(0).Symbol;t.exports=r},function(t,e){var i=Array.isArray;t.exports=i},function(t,e,i){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,i){var r=i(4),n=i(16),o="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",h="[object Proxy]";t.exports=function(t){if(!n(t))return!1;var e=r(t);return e==s||e==a||e==o||e==h}},function(t,e,i){(function(e){var i="object"==typeof e&&e&&e.Object===Object&&e;t.exports=i}).call(e,i(15))},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){var i=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return i.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,i){var r=i(44),n=i(51),o=i(53),s=i(54),a=i(55);function h(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}h.prototype.clear=r,h.prototype.delete=n,h.prototype.get=o,h.prototype.has=s,h.prototype.set=a,t.exports=h},function(t,e,i){var r=i(56),n=i(59),o=i(60),s=1,a=2;t.exports=function(t,e,i,h,u,l){var p=i&s,c=t.length,f=e.length;if(c!=f&&!(p&&f>c))return!1;var d=l.get(t);if(d&&l.get(e))return d==e;var y=-1,g=!0,m=i&a?new r:void 0;for(l.set(t,e),l.set(e,t);++y<c;){var _=t[y],v=e[y];if(h)var x=p?h(v,_,y,e,t,l):h(_,v,y,t,e,l);if(void 0!==x){if(x)continue;g=!1;break}if(m){if(!n(e,function(t,e){if(!o(m,e)&&(_===t||u(_,t,i,h,l)))return m.push(e)})){g=!1;break}}else if(_!==v&&!u(_,v,i,h,l)){g=!1;break}}return l.delete(t),l.delete(e),g}},function(t,e,i){(function(t){var r=i(0),n=i(77),o="object"==typeof e&&e&&!e.nodeType&&e,s=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===o?r.Buffer:void 0,h=(a?a.isBuffer:void 0)||n;t.exports=h}).call(e,i(21)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,i){var r=i(79),n=i(80),o=i(81),s=o&&o.isTypedArray,a=s?n(s):r;t.exports=a},function(t,e){var i=9007199254740991;t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});i(97);var r=i(98),n=i.n(r),o=i(99),s=i.n(o),a=i(100),h=i.n(a),u=i(101),l=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var p=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.setRef=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;i.container=t},i.state={isLoad:!1,isMounted:!1},i.map=null,i.container=null,i.events={},i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,n.a.Component),l(e,[{key:"getChildContext",value:function(){return{map:this.map}}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.center,r=e.zoom,n=e.spatialReference,o=e.cursor,a=e.maxExtent,h=e.maxZoom,u=e.minZoom,l=e.pitch,p=e.bearing,c=e.fov;return this.map?(s()(t.center,i)&&s()(t.zoom,r)||(!s()(t.center,i)&&s()(t.zoom,r)&&this.map.setCenter(t.center),s()(t.center,i)&&!s()(t.zoom,r)&&this.map.setZoom(t.zoom),s()(t.center,i)||s()(t.zoom,r)||this.map.setCenterAndZoom(t.center,t.zoom)),s()(t.spatialReference,n)||this.map.setSpatialReference(t.zoom),s()(t.cursor,o)||this.map.setCursor(t.cursor),s()(t.maxExtent,a)||this.map.setMaxExtent(t.maxExtent),s()(t.maxZoom,h)||this.map.setMaxZoom(t.maxZoom),s()(t.minZoom,u)||this.map.setMinZoom(t.minZoom),s()(t.fov,c)||this.map.setFov(t.fov),s()(t.bearing,p)||this.map.setBearing(t.bearing),s()(t.pitch,l)||this.map.setPitch(t.pitch),null):null}},{key:"setBaseLayer",value:function(t){if(!this.map)return null;t&&t.length>0&&this.map.setBaseLayer()}},{key:"setLayers",value:function(t){if(!this.map)return null;t&&t.length}},{key:"componentDidMount",value:function(){var t=this.props,e=t.center,i=t.zoom,r=t.events,n=t.fov,o=t.bearing,s=t.pitch,a={zoom:i,center:e,fov:Math.max(.01,Math.min(59,n)),bearing:o,pitch:s};if(this.map=new u.e(this.container,a),this.map.isLoaded())for(var h in this.setState({isLoad:!0}),r)"onload"===h?r[h](this.map,this):this.map.on(h,r[h],this);this.setState({isMounted:!0})}},{key:"componentWillUnmount",value:function(){this.map&&(this.map=null,this.setState({isMounted:!1}))}},{key:"render",value:function(){var t=this.state,e=t.isMounted,i=t.isLoad,r=this.props,o=r.className,s=r.children;return n.a.createElement("div",{ref:this.setRef,className:o},e&&i?s:null)}}]),e}();p.defaultProps={},p.childContextTypes={map:h.a.instanceOf(u.e)};var c=p,f=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var d=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.layer=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,n.a.Component),f(e,[{key:"render",value:function(){return null}},{key:"createLayer",value:function(t){if(t){var e=this.context.map;if(!e)return;this.layer&&e.removeLayer(this.layer);var i=t.id;this.layer=new u.c(i,t),e.addLayer(this.layer)}}},{key:"componentDidMount",value:function(){this.createLayer(this.props)}},{key:"componentWillReceiveProps",value:function(t){return this.createLayer(t),null}},{key:"componentWillUnmount",value:function(){var t=this.context.map;t&&this.layer&&t.removeLayer(this.layer)}}]),e}();d.defaultProps={attribution:null,minZoom:null,maxZoom:null,visible:!0,opacity:1,globalCompositeOperation:null,renderer:"canvas",debugOutline:"#0f0",cssFilter:null,forceRenderOnMoving:!1,forceRenderOnZooming:!1,forceRenderOnRotating:!1},d.contextTypes={map:h.a.instanceOf(u.e)};var y=d,g=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var m=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.state={isAdd:!1},r.layer=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,y),g(e,[{key:"createLayer",value:function(t){var e=this;if(t){var i=this.context.map;if(!i)return;this.layer&&i.removeLayer(this.layer);var r=t.id;this.layer=new u.l(r,t),this.layer.on("add",function(){e.setState({isAdd:!0})}),i.addLayer(this.layer)}}}]),e}();m.defaultProps={subdomains:null,repeatWorld:!0,background:!0,backgroundZoomDiff:6,loadingLimitOnInteracting:3,placeholder:!1,crossOrigin:null,tileSize:[256,256],offset:[0,0],tileSystem:null,fadeAnimation:!0,debug:!1,spatialReference:null,maxCacheSize:256,clipByPitch:!0,maxAvailableZoom:null,cascadeTiles:!0,minPitchToCascade:35},m.propTypes={urlTemplate:h.a.oneOfType([h.a.string,h.a.func]).isRequired,subdomains:h.a.oneOfType([h.a.arrayOf(h.a.string),h.a.arrayOf(h.a.number)]),repeatWorld:h.a.bool,background:h.a.bool,backgroundZoomDiff:h.a.number,loadingLimitOnInteracting:h.a.number,placeholder:h.a.bool,crossOrigin:h.a.string,tileSize:h.a.arrayOf(h.a.number),offset:h.a.arrayOf(h.a.number),tileSystem:h.a.arrayOf(h.a.number),fadeAnimation:h.a.bool,debug:h.a.bool,spatialReference:h.a.object,maxCacheSize:h.a.number,clipByPitch:h.a.bool,maxAvailableZoom:h.a.number,cascadeTiles:h.a.bool,minPitchToCascade:h.a.number};var _=m,v=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var x=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.layer=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,y),v(e,[{key:"createLayer",value:function(t){if(t){var e=this.context.map;if(!e)return;this.layer&&e.removeLayer(this.layer);var i=t.id,r=t.geometries;this.layer=new u.j(i,r,t),e.addLayer(this.layer)}}}]),e}();x.defaultProps={drawImmediate:!1},x.propTypes={drawImmediate:h.a.bool};var w=x,b=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var C=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.layer=null,r.state={isAdd:!1},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,w),b(e,[{key:"createLayer",value:function(t){var e=this;if(t){var i=this.context.map;if(!i)return;this.layer&&i.removeLayer(this.layer);var r=t.id,n=t.geometries;this.layer=new u.m(r,n,t),this.layer.on("add",function(){e.setState({isAdd:!0})}),i.addLayer(this.layer)}}},{key:"componentWillReceiveProps",value:function(t){this.createLayer(t)}},{key:"getChildContext",value:function(){return{layer:this.layer}}},{key:"render",value:function(){var t=this.state.isAdd;console.log(t);var e=this.props.children;return t?e:null}}]),e}();C.defaultProps={cursor:"default",enableSimplify:!0,geometryEvents:!0,defaultIconSize:[20,20],cacheVectorOnCanvas:!0,cacheSvgOnCanvas:!0,enableAltitude:!1,altitudeProperty:"altitude",drawAltitude:!1},C.propTypes={cursor:h.a.string,enableSimplify:h.a.bool,geometryEvents:h.a.bool,defaultIconSize:h.a.arrayOf(h.a.number),cacheVectorOnCanvas:h.a.bool,cacheSvgOnCanvas:h.a.bool,enableAltitude:h.a.bool,altitudeProperty:h.a.string,drawAltitude:h.a.bool},C.childContextTypes={layer:h.a.instanceOf(u.c)};var P=C,M=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var T=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,n.a.Component),M(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;this.geometry=new u.b,e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){return this.createGeometry(t),null}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();T.contextTypes={layer:h.a.instanceOf(u.c)};var S=T,O=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var E=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),O(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.coordinates,n=t.options;this.geometry=new u.f(r,n),this.geometry.setId(i),this.geometry.setProperties(n),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.id,r=e.coordinates,n=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.coordinates,r)||this.geometry.setCoordinates(t.coordinates),s()(t.options,n)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();E.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,coordinates:h.a.arrayOf(h.a.number),options:h.a.any},E.contextTypes={layer:h.a.instanceOf(u.c)};var k=E,L=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var A=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),L(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.coordinates,n=t.options;this.geometry=new u.d(r,n),this.geometry.setId(i),this.geometry.setProperties(n),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.id,r=e.coordinates,n=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.coordinates,r)||this.geometry.setCoordinates(t.coordinates),s()(t.options,n)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();A.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,coordinates:h.a.arrayOf(h.a.any),options:h.a.any},A.contextTypes={layer:h.a.instanceOf(u.c)};var R=A,j=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var D=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),j(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.coordinates,n=t.options;this.geometry=new u.k(r,n),this.geometry.setId(i),this.geometry.setProperties(n),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.id,r=e.coordinates,n=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.coordinates,r)||this.geometry.setCoordinates(t.coordinates),s()(t.options,n)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();D.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,coordinates:h.a.arrayOf(h.a.array),options:h.a.any},D.contextTypes={layer:h.a.instanceOf(u.c)};var I=D,z=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var H=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),z(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.coordinates,n=t.options;this.geometry=new u.h(r,n),this.geometry.setId(i),this.geometry.setProperties(n),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.id,r=e.coordinates,n=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.coordinates,r)||this.geometry.setCoordinates(t.coordinates),s()(t.options,n)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();H.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,coordinates:h.a.arrayOf(h.a.arrayOf(h.a.number)),options:h.a.any},H.contextTypes={layer:h.a.instanceOf(u.c)};var Z=H,G=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var F=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),G(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.coordinates,n=t.options;this.geometry=new u.g(r,n),this.geometry.setId(i),this.geometry.setProperties(n),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.id,r=e.coordinates,n=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.coordinates,r)||this.geometry.setCoordinates(t.coordinates),s()(t.options,n)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();F.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,coordinates:h.a.arrayOf(h.a.arrayOf(h.a.arrayOf(h.a.number))),options:h.a.any},F.contextTypes={layer:h.a.instanceOf(u.c)};var W=F,N=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var B=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),N(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.coordinates,n=t.options;this.geometry=new u.i(r,n),this.geometry.setId(i),this.geometry.setProperties(n),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){var e=this.props,i=e.id,r=e.coordinates,n=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.coordinates,r)||this.geometry.setCoordinates(t.coordinates),s()(t.options,n)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();B.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,coordinates:h.a.arrayOf(h.a.array),options:h.a.any},B.contextTypes={layer:h.a.instanceOf(u.c)};var V=B,U=function(){function t(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,i,r){return i&&t(e.prototype,i),r&&t(e,r),e}}();var J=function(t){function e(t,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,i));return r.geometry=null,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,S),U(e,[{key:"createGeometry",value:function(t){if(t){var e=this.context.layer;if(!e)return;var i=t.id,r=t.center,n=t.radius,o=t.options;this.geometry=new u.a(r,n,o),this.geometry.setId(i),this.geometry.setProperties(o),e.addGeometry(this.geometry)}}},{key:"componentDidMount",value:function(){this.createGeometry(this.props)}},{key:"componentWillReceiveProps",value:function(t){console.log(t);var e=this.props,i=e.id,r=e.center,n=e.radius,o=e.options;if(!this.geometry)return null;s()(t.id,i)||this.geometry.setId(t.id),s()(t.center,r)||this.geometry.setCoordinates(t.center),s()(t.radius,n)||this.geometry.setRadius(t.radius),s()(t.options,o)||this.geometry.setProperties(t.options)}},{key:"componentWillUnmount",value:function(){var t=this.context.layer;t&&t.removeGeometry(this.geometry)}},{key:"render",value:function(){return null}}]),e}();J.propTypes={id:h.a.oneOfType([h.a.number,h.a.string]).isRequired,center:h.a.arrayOf(h.a.number),radius:h.a.number,options:h.a.any},J.contextTypes={layer:h.a.instanceOf(u.c)};var q=J;i.d(e,"Map",function(){return c}),i.d(e,"TileLayer",function(){return _}),i.d(e,"OverlayLayer",function(){return w}),i.d(e,"VectorLayer",function(){return P}),i.d(e,"Circle",function(){return q}),i.d(e,"Geometry",function(){return S}),i.d(e,"LineString",function(){return R}),i.d(e,"Marker",function(){return k}),i.d(e,"MultiLineString",function(){return W}),i.d(e,"MultiPoint",function(){return Z}),i.d(e,"MultiPolygon",function(){return V}),i.d(e,"Polygon",function(){return I});e.default={Map:c,TileLayer:_,OverlayLayer:w,VectorLayer:P,Circle:q,Geometry:S,LineString:R,Marker:k,MultiLineString:W,MultiPoint:Z,MultiPolygon:V,Polygon:I}},function(t,e,i){var r=i(26),n=i(7);t.exports=function t(e,i,o,s,a){return e===i||(null==e||null==i||!n(e)&&!n(i)?e!=e&&i!=i:r(e,i,o,s,t,a))}},function(t,e,i){var r=i(27),n=i(19),o=i(61),s=i(65),a=i(87),h=i(10),u=i(20),l=i(22),p=1,c="[object Arguments]",f="[object Array]",d="[object Object]",y=Object.prototype.hasOwnProperty;t.exports=function(t,e,i,g,m,_){var v=h(t),x=h(e),w=v?f:a(t),b=x?f:a(e),C=(w=w==c?d:w)==d,P=(b=b==c?d:b)==d,M=w==b;if(M&&u(t)){if(!u(e))return!1;v=!0,C=!1}if(M&&!C)return _||(_=new r),v||l(t)?n(t,e,i,g,m,_):o(t,e,w,i,g,m,_);if(!(i&p)){var T=C&&y.call(t,"__wrapped__"),S=P&&y.call(e,"__wrapped__");if(T||S){var O=T?t.value():t,E=S?e.value():e;return _||(_=new r),m(O,E,i,g,_)}}return!!M&&(_||(_=new r),s(t,e,i,g,m,_))}},function(t,e,i){var r=i(2),n=i(33),o=i(34),s=i(35),a=i(36),h=i(37);function u(t){var e=this.__data__=new r(t);this.size=e.size}u.prototype.clear=n,u.prototype.delete=o,u.prototype.get=s,u.prototype.has=a,u.prototype.set=h,t.exports=u},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,i){var r=i(3),n=Array.prototype.splice;t.exports=function(t){var e=this.__data__,i=r(e,t);return!(i<0||(i==e.length-1?e.pop():n.call(e,i,1),--this.size,0))}},function(t,e,i){var r=i(3);t.exports=function(t){var e=this.__data__,i=r(e,t);return i<0?void 0:e[i][1]}},function(t,e,i){var r=i(3);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,i){var r=i(3);t.exports=function(t,e){var i=this.__data__,n=r(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this}},function(t,e,i){var r=i(2);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,i){var r=i(2),n=i(8),o=i(18),s=200;t.exports=function(t,e){var i=this.__data__;if(i instanceof r){var a=i.__data__;if(!n||a.length<s-1)return a.push([t,e]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(t,e),this.size=i.size,this}},function(t,e,i){var r=i(13),n=i(41),o=i(16),s=i(17),a=/^\[object .+?Constructor\]$/,h=Function.prototype,u=Object.prototype,l=h.toString,p=u.hasOwnProperty,c=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||n(t))&&(r(t)?c:a).test(s(t))}},function(t,e,i){var r=i(9),n=Object.prototype,o=n.hasOwnProperty,s=n.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),i=t[a];try{t[a]=void 0;var r=!0}catch(t){}var n=s.call(t);return r&&(e?t[a]=i:delete t[a]),n}},function(t,e){var i=Object.prototype.toString;t.exports=function(t){return i.call(t)}},function(t,e,i){var r,n=i(42),o=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,i){var r=i(0)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,i){var r=i(45),n=i(2),o=i(8);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||n),string:new r}}},function(t,e,i){var r=i(46),n=i(47),o=i(48),s=i(49),a=i(50);function h(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}h.prototype.clear=r,h.prototype.delete=n,h.prototype.get=o,h.prototype.has=s,h.prototype.set=a,t.exports=h},function(t,e,i){var r=i(5);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,i){var r=i(5),n="__lodash_hash_undefined__",o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var i=e[t];return i===n?void 0:i}return o.call(e,t)?e[t]:void 0}},function(t,e,i){var r=i(5),n=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:n.call(e,t)}},function(t,e,i){var r=i(5),n="__lodash_hash_undefined__";t.exports=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=r&&void 0===e?n:e,this}},function(t,e,i){var r=i(6);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,i){var r=i(6);t.exports=function(t){return r(this,t).get(t)}},function(t,e,i){var r=i(6);t.exports=function(t){return r(this,t).has(t)}},function(t,e,i){var r=i(6);t.exports=function(t,e){var i=r(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this}},function(t,e,i){var r=i(18),n=i(57),o=i(58);function s(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new r;++e<i;)this.add(t[e])}s.prototype.add=s.prototype.push=n,s.prototype.has=o,t.exports=s},function(t,e){var i="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,i),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var i=-1,r=null==t?0:t.length;++i<r;)if(e(t[i],i,t))return!0;return!1}},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,i){var r=i(9),n=i(62),o=i(12),s=i(19),a=i(63),h=i(64),u=1,l=2,p="[object Boolean]",c="[object Date]",f="[object Error]",d="[object Map]",y="[object Number]",g="[object RegExp]",m="[object Set]",_="[object String]",v="[object Symbol]",x="[object ArrayBuffer]",w="[object DataView]",b=r?r.prototype:void 0,C=b?b.valueOf:void 0;t.exports=function(t,e,i,r,b,P,M){switch(i){case w:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case x:return!(t.byteLength!=e.byteLength||!P(new n(t),new n(e)));case p:case c:case y:return o(+t,+e);case f:return t.name==e.name&&t.message==e.message;case g:case _:return t==e+"";case d:var T=a;case m:var S=r&u;if(T||(T=h),t.size!=e.size&&!S)return!1;var O=M.get(t);if(O)return O==e;r|=l,M.set(t,e);var E=s(T(t),T(e),r,b,P,M);return M.delete(t),E;case v:if(C)return C.call(t)==C.call(e)}return!1}},function(t,e,i){var r=i(0).Uint8Array;t.exports=r},function(t,e){t.exports=function(t){var e=-1,i=Array(t.size);return t.forEach(function(t,r){i[++e]=[r,t]}),i}},function(t,e){t.exports=function(t){var e=-1,i=Array(t.size);return t.forEach(function(t){i[++e]=t}),i}},function(t,e,i){var r=i(66),n=1,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,i,s,a,h){var u=i&n,l=r(t),p=l.length;if(p!=r(e).length&&!u)return!1;for(var c=p;c--;){var f=l[c];if(!(u?f in e:o.call(e,f)))return!1}var d=h.get(t);if(d&&h.get(e))return d==e;var y=!0;h.set(t,e),h.set(e,t);for(var g=u;++c<p;){var m=t[f=l[c]],_=e[f];if(s)var v=u?s(_,m,f,e,t,h):s(m,_,f,t,e,h);if(!(void 0===v?m===_||a(m,_,i,s,h):v)){y=!1;break}g||(g="constructor"==f)}if(y&&!g){var x=t.constructor,w=e.constructor;x!=w&&"constructor"in t&&"constructor"in e&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(y=!1)}return h.delete(t),h.delete(e),y}},function(t,e,i){var r=i(67),n=i(69),o=i(72);t.exports=function(t){return r(t,o,n)}},function(t,e,i){var r=i(68),n=i(10);t.exports=function(t,e,i){var o=e(t);return n(t)?o:r(o,i(t))}},function(t,e){t.exports=function(t,e){for(var i=-1,r=e.length,n=t.length;++i<r;)t[n+i]=e[i];return t}},function(t,e,i){var r=i(70),n=i(71),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(t){return null==t?[]:(t=Object(t),r(s(t),function(e){return o.call(t,e)}))}:n;t.exports=a},function(t,e){t.exports=function(t,e){for(var i=-1,r=null==t?0:t.length,n=0,o=[];++i<r;){var s=t[i];e(s,i,t)&&(o[n++]=s)}return o}},function(t,e){t.exports=function(){return[]}},function(t,e,i){var r=i(73),n=i(82),o=i(86);t.exports=function(t){return o(t)?r(t):n(t)}},function(t,e,i){var r=i(74),n=i(75),o=i(10),s=i(20),a=i(78),h=i(22),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var i=o(t),l=!i&&n(t),p=!i&&!l&&s(t),c=!i&&!l&&!p&&h(t),f=i||l||p||c,d=f?r(t.length,String):[],y=d.length;for(var g in t)!e&&!u.call(t,g)||f&&("length"==g||p&&("offset"==g||"parent"==g)||c&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,y))||d.push(g);return d}},function(t,e){t.exports=function(t,e){for(var i=-1,r=Array(t);++i<t;)r[i]=e(i);return r}},function(t,e,i){var r=i(76),n=i(7),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,h=r(function(){return arguments}())?r:function(t){return n(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=h},function(t,e,i){var r=i(4),n=i(7),o="[object Arguments]";t.exports=function(t){return n(t)&&r(t)==o}},function(t,e){t.exports=function(){return!1}},function(t,e){var i=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?i:e)&&("number"==n||"symbol"!=n&&r.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,i){var r=i(4),n=i(23),o=i(7),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&n(t.length)&&!!s[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,i){(function(t){var r=i(14),n="object"==typeof e&&e&&!e.nodeType&&e,o=n&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===n&&r.process,a=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=a}).call(e,i(21)(t))},function(t,e,i){var r=i(83),n=i(84),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return n(t);var e=[];for(var i in Object(t))o.call(t,i)&&"constructor"!=i&&e.push(i);return e}},function(t,e){var i=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||i)}},function(t,e,i){var r=i(85)(Object.keys,Object);t.exports=r},function(t,e){t.exports=function(t,e){return function(i){return t(e(i))}}},function(t,e,i){var r=i(13),n=i(23);t.exports=function(t){return null!=t&&n(t.length)&&!r(t)}},function(t,e,i){var r=i(88),n=i(8),o=i(89),s=i(90),a=i(91),h=i(4),u=i(17),l=u(r),p=u(n),c=u(o),f=u(s),d=u(a),y=h;(r&&"[object DataView]"!=y(new r(new ArrayBuffer(1)))||n&&"[object Map]"!=y(new n)||o&&"[object Promise]"!=y(o.resolve())||s&&"[object Set]"!=y(new s)||a&&"[object WeakMap]"!=y(new a))&&(y=function(t){var e=h(t),i="[object Object]"==e?t.constructor:void 0,r=i?u(i):"";if(r)switch(r){case l:return"[object DataView]";case p:return"[object Map]";case c:return"[object Promise]";case f:return"[object Set]";case d:return"[object WeakMap]"}return e}),t.exports=y},function(t,e,i){var r=i(1)(i(0),"DataView");t.exports=r},function(t,e,i){var r=i(1)(i(0),"Promise");t.exports=r},function(t,e,i){var r=i(1)(i(0),"Set");t.exports=r},function(t,e,i){var r=i(1)(i(0),"WeakMap");t.exports=r},function(t,e,i){"use strict";var r=i(93),n=i(11),o=i(94),s=function(){};function a(){return null}"production"!=="production".NODE_ENV&&(s=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(t){}}),t.exports=function(t,e){var i="function"==typeof Symbol&&Symbol.iterator,h="@@iterator";var u="<<anonymous>>",l={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:f(a),arrayOf:function(t){return f(function(e,i,r,o,s){if("function"!=typeof t)return new c("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=e[i];if(!Array.isArray(a)){var h=g(a);return new c("Invalid "+o+" `"+s+"` of type `"+h+"` supplied to `"+r+"`, expected an array.")}for(var u=0;u<a.length;u++){var l=t(a,u,r,o,s+"["+u+"]",n);if(l instanceof Error)return l}return null})},element:function(){return f(function(e,i,r,n,o){var s=e[i];if(!t(s)){var a=g(s);return new c("Invalid "+n+" `"+o+"` of type `"+a+"` supplied to `"+r+"`, expected a single ReactElement.")}return null})}(),instanceOf:function(t){return f(function(e,i,r,n,o){if(!(e[i]instanceof t)){var s=t.name||u,a=function(t){if(!t.constructor||!t.constructor.name)return u;return t.constructor.name}(e[i]);return new c("Invalid "+n+" `"+o+"` of type `"+a+"` supplied to `"+r+"`, expected instance of `"+s+"`.")}return null})},node:function(){return f(function(t,e,i,r,n){if(!y(t[e]))return new c("Invalid "+r+" `"+n+"` supplied to `"+i+"`, expected a ReactNode.");return null})}(),objectOf:function(t){return f(function(e,i,r,o,s){if("function"!=typeof t)return new c("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[i],h=g(a);if("object"!==h)return new c("Invalid "+o+" `"+s+"` of type `"+h+"` supplied to `"+r+"`, expected an object.");for(var u in a)if(a.hasOwnProperty(u)){var l=t(a,u,r,o,s+"."+u,n);if(l instanceof Error)return l}return null})},oneOf:function(t){if(!Array.isArray(t))return"production"!=="production".NODE_ENV&&s("Invalid argument supplied to oneOf, expected an instance of array."),a;return f(function(e,i,r,n,o){for(var s=e[i],a=0;a<t.length;a++)if(p(s,t[a]))return null;var h=JSON.stringify(t);return new c("Invalid "+n+" `"+o+"` of value `"+s+"` supplied to `"+r+"`, expected one of "+h+".")})},oneOfType:function(t){if(!Array.isArray(t))return"production"!=="production".NODE_ENV&&s("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var e=0;e<t.length;e++){var i=t[e];if("function"!=typeof i)return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+_(i)+" at index "+e+"."),a}return f(function(e,i,r,o,s){for(var a=0;a<t.length;a++){var h=t[a];if(null==h(e,i,r,o,s,n))return null}return new c("Invalid "+o+" `"+s+"` supplied to `"+r+"`.")})},shape:function(t){return f(function(e,i,r,o,s){var a=e[i],h=g(a);if("object"!==h)return new c("Invalid "+o+" `"+s+"` of type `"+h+"` supplied to `"+r+"`, expected `object`.");for(var u in t){var l=t[u];if(l){var p=l(a,u,r,o,s+"."+u,n);if(p)return p}}return null})},exact:function(t){return f(function(e,i,o,s,a){var h=e[i],u=g(h);if("object"!==u)return new c("Invalid "+s+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");var l=r({},e[i],t);for(var p in l){var f=t[p];if(!f)return new c("Invalid "+s+" `"+a+"` key `"+p+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(e[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(t),null," "));var d=f(h,p,o,s,a+"."+p,n);if(d)return d}return null})}};function p(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function c(t){this.message=t,this.stack=""}function f(t){if("production"!=="production".NODE_ENV)var i={},r=0;function o(o,a,h,l,p,f,d){if(l=l||u,f=f||h,d!==n){if(e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}if("production"!=="production".NODE_ENV&&"undefined"!=typeof console){var g=l+":"+h;!i[g]&&r<3&&(s("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),i[g]=!0,r++)}}return null==a[h]?o?null===a[h]?new c("The "+p+" `"+f+"` is marked as required in `"+l+"`, but its value is `null`."):new c("The "+p+" `"+f+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:t(a,h,l,p,f)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function d(t){return f(function(e,i,r,n,o,s){var a=e[i];return g(a)!==t?new c("Invalid "+n+" `"+o+"` of type `"+m(a)+"` supplied to `"+r+"`, expected `"+t+"`."):null})}function y(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(y);if(null===e||t(e))return!0;var r=function(t){var e=t&&(i&&t[i]||t[h]);if("function"==typeof e)return e}(e);if(!r)return!1;var n,o=r.call(e);if(r!==e.entries){for(;!(n=o.next()).done;)if(!y(n.value))return!1}else for(;!(n=o.next()).done;){var s=n.value;if(s&&!y(s[1]))return!1}return!0;default:return!1}}function g(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":function(t,e){return"symbol"===t||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}(e,t)?"symbol":e}function m(t){if(void 0===t||null===t)return""+t;var e=g(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function _(t){var e=m(t);switch(e){case"array":case"object":return"an "+e;case"boolean":case"date":case"regexp":return"a "+e;default:return e}}return c.prototype=Error.prototype,l.checkPropTypes=o,l.PropTypes=l,l}},function(t,e,i){"use strict";
9/*
10object-assign
11(c) Sindre Sorhus
12@license MIT
13*/var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var i,s,a=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),h=1;h<arguments.length;h++){for(var u in i=Object(arguments[h]))n.call(i,u)&&(a[u]=i[u]);if(r){s=r(i);for(var l=0;l<s.length;l++)o.call(i,s[l])&&(a[s[l]]=i[s[l]])}}return a}},function(t,e,i){"use strict";var r=function(){};if("production"!=="production".NODE_ENV){var n=i(11),o={};r=function(t){var e="Warning: "+t;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(t){}}}t.exports=function(t,e,i,s,a){if("production"!=="production".NODE_ENV)for(var h in t)if(t.hasOwnProperty(h)){var u;try{if("function"!=typeof t[h]){var l=Error((s||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[h]+"`.");throw l.name="Invariant Violation",l}u=t[h](e,h,s,i,null,n)}catch(t){u=t}if(!u||u instanceof Error||r((s||"React class")+": type specification of "+i+" `"+h+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in o)){o[u.message]=!0;var p=a?a():"";r("Failed "+i+" type: "+u.message+(null!=p?p:""))}}}},function(t,e,i){"use strict";var r=i(11);function n(){}t.exports=function(){function t(t,e,i,n,o,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var i={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return i.checkPropTypes=n,i.PropTypes=i,i}},function(t,e){var i,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:o}catch(t){i=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var h,u=[],l=!1,p=-1;function c(){l&&h&&(l=!1,h.length?u=h.concat(u):p=-1,u.length&&f())}function f(){if(!l){var t=a(c);l=!0;for(var e=u.length;e;){for(h=u,u=[];++p<e;)h&&h[p].run();p=-1,e=u.length}h=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function y(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];u.push(new d(t,e)),1!==u.length||l||a(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e){},function(e,i){e.exports=t},function(t,e,i){var r=i(25);t.exports=function(t,e){return r(t,e)}},function(t,e,i){if("production"!=="production".NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=i(92)(function(t){return"object"==typeof t&&null!==t&&t.$$typeof===r},!0)}else t.exports=i(95)()},function(t,e,i){"use strict";(function(t,r){i.d(e,"e",function(){return Xi}),i.d(e,"c",function(){return Vi}),i.d(e,"l",function(){return wo}),i.d(e,"j",function(){return pn}),i.d(e,"m",function(){return fn}),i.d(e,"a",function(){return Jr}),i.d(e,"b",function(){return br}),i.d(e,"d",function(){return zr}),i.d(e,"f",function(){return Dr}),i.d(e,"g",function(){return Nr}),i.d(e,"h",function(){return Fr}),i.d(e,"i",function(){return Br}),i.d(e,"k",function(){return Rr});
14/*!
15 * maptalks v0.40.5
16 * LICENSE : BSD-3-Clause
17 * (c) 2016-2018 maptalks.org
18 */
19var n=["MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"],o=["FeatureCollection","Feature","Point","LineString","Polygon"].concat(n),s=["markerFile","polygonPatternFile","linePatternFile","markerFillPatternFile","markerLinePatternFile"],a=[["markerWidth","markerHeight"],[],[null,"lineWidth"],[],[null,"markerLineWidth"]],h={lineWidth:1,lineOpacity:1,lineDx:1,lineDy:1,polygonOpacity:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerOpacity:1,markerFillOpacity:1,markerLineWidth:1,markerLineOpacity:1,textSize:1,textOpacity:1,textHaloRadius:1,textWrapWidth:1,textLineSpacing:1,textDx:1,textDy:1},u=["lineColor","polygonFill","markerFill","markerLineColor","textFill"];var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},c=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):function(t,e){for(var i=Object.getOwnPropertyNames(e),r=0;r<i.length;r++){var n=i[r],o=Object.getOwnPropertyDescriptor(e,n);o&&o.configurable&&void 0===t[n]&&Object.defineProperty(t,n,o)}}(t,e))},f=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e};function d(){return Date.now()}function y(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)t[r]=i[r]}return t}function g(t){return null==t}function m(t){return"number"==typeof t&&!isNaN(t)}function _(t){return(0|t)===t}function v(t){return"object"===(void 0===t?"undefined":l(t))&&!!t}function x(t){return!g(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function w(t){return!g(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}var b=Object.prototype.hasOwnProperty;function C(t,e){return b.call(t,e)}var P=Math.PI/180;function M(t){return t*P}function T(t){return t/P}var S="[object process]"===Object.prototype.toString.call(void 0!==t?t:0)&&!t.versions.electron&&!t.versions.nw&&!t.versions["node-webkit"],O=void 0,E=void 0;function k(t){return t.length>4&&".svg"===t.slice(-4)?1:"data:image/svg+xml"===t.slice(0,"data:image/svg+xml".length)?2:0}function L(t,e){S&&L.node?L.node(t,e):t.src=e[0]}!function(){if(S)return O=function(t){return setTimeout(t,16)},void(E=clearTimeout);var t=void 0,e=void 0,i=1e3/30;function r(t){return setTimeout(t,i)}function n(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}"undefined"!=typeof window?(t=window.requestAnimationFrame||n("RequestAnimationFrame")||r,e=window.cancelAnimationFrame||n("CancelAnimationFrame")||n("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)}):(t=r,e=clearTimeout),O=function(e){return t(e)},E=function(t){t&&e(t)}}();var A=0;function R(){return A++}var j=R;function D(t){return t&&x(t)?JSON.parse(t):t}function I(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];if(i)for(var r=0,n=i.length;r<n;r++)t.push(i[r])}return t.length}function z(t,e){var i=e.indexOf(t);i>-1&&e.splice(i,1)}function H(t,e,i){if(!Array.isArray(t))return i?e.call(i,t):e(t);for(var r=[],n=void 0,o=void 0,s=0,a=t.length;s<a;s++)g(n=t[s])?r.push(null):Array.isArray(n)?r.push(H(n,e,i)):(o=i?e.call(i,n):e(n),r.push(o));return r}function Z(t,e){return void 0===t?e:t}function G(t){return Math.sign?Math.sign(t):0===(t=+t)||isNaN(t)?Number(t):t>0?1:-1}function F(t){if(Math.log2)return Math.log2(t);var e=Math.log(t)*Math.LOG2E,i=Math.round(e);return Math.abs(i-e)<1e-14?i:e}function W(t,e,i){return t*(1-i)+e*i}function N(t,e,i){if(t===i||t===e)return t;var r=i-e;return((t-e)%r+r)%r+e}function B(t,e,i){return Math.min(i,Math.max(e,t))}function V(t){return Array.isArray(t)&&t.length>0}function U(t){if(!t)return!1;var e=t.slice(0,6);return"http:/"===e||"https:"===e||"file:/"===e}var J=/^url\((['"])(.+)\1\)$/i,q=/^url\(([^'"].*[^'"])\)$/i;function Y(t){if(!x(t))return 0;var e=t.slice(0,6);return"http:/"===e||"https:"===e?3:q.test(t)?1:J.test(t)?2:0}function X(t){var e=Y(t);return 3===e?t:1===e?q.exec(t)[1]:2===e?J.exec(t)[2]:t}var K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Q(t){if("undefined"!=typeof window&&window.btoa)return window.btoa(t);for(var e,i,r=String(t),n="",o=0,s=K;r.charAt(0|o)||(s="=",o%1);n+=s.charAt(63&e>>8-o%1*8)){if((i=r.charCodeAt(o+=.75))>255)throw new Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");e=e<<8|i}return n}function $(t,e){for(var i=atob(t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=255&i.charCodeAt(o);return new Blob([r],{type:e})}function tt(t,e,i,r){var n=i-t,o=r-e;return Math.atan2(o,n)}var et="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";function it(t,e){if(!t&&!e)return!0;if(!t||!e)return!1;for(var i in t)if("center"===i){if(!e[i]||!rt(t[i][0],e[i][0])||!rt(t[i][1],e[i][1]))return!1}else if(t[i]!==e[i])return!1;return!0}function rt(t,e,i){return null==i&&(i=1e-6),t>=e-i&&t<=e+i}function nt(t,e,i,r){t||(t=100),e||(e=4);var n=this;return e*=2,this._flashTimeout&&clearTimeout(this._flashTimeout),this._flashTimeout=setTimeout(function o(){if(0===e)return n.show(),void(i&&(r?i.call(r):i()));e%2==0?n.hide():n.show(),e--,n._flashTimeout=setTimeout(o,t)},t),this}var ot=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function st(t){return new Function("f","var p = (f && f.properties || {}); return "+at(t))}function at(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===e?ut(t[1],t[2],"===",!1):"!="===e?ut(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?ut(t[1],t[2],e,!0):"any"===e?lt(t.slice(1),"||"):"all"===e?lt(t.slice(1),"&&"):"none"===e?ft(lt(t.slice(1),"||")):"in"===e?pt(t[1],t.slice(2)):"!in"===e?ft(pt(t[1],t.slice(2))):"has"===e?ct(t[1]):"!has"===e?ft(ct(t[1])):"true")+")"}function ht(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function ut(t,e,i,r){var n=ht(t),o="$type"===t?ot.indexOf(e):JSON.stringify(e);return(r?"typeof "+n+"=== typeof "+o+"&&":"")+n+i+o}function lt(t,e){return t.map(at).join(e)}function pt(t,e){"$type"===t&&(e=e.map(function(t){return ot.indexOf(t)}));var i=JSON.stringify(e.sort(dt)),r=ht(t);return e.length<=200?i+".indexOf("+r+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+r+", "+i+",0,"+(e.length-1)+")"}function ct(t){return"$id"===t?'"id" in f':JSON.stringify(t)+" in p"}function ft(t){return"!("+t+")"}function dt(t,e){return t<e?-1:t>e?1:0}function yt(t){var e=t._toJSON(),i=e.feature;return i.type=ot.indexOf(i.geometry.type),i.subType=e.subType,i}function gt(t){if(!Array.isArray(t))return gt([t]);for(var e=[],i=0;i<t.length;i++){var r=void 0;r=!0===t[i].filter?function(){return!0}:st(t[i].filter),e.push(y({},t[i],{filter:r}))}return e}function mt(t,e){var i;if(Ct(t)){var r,n=t.stops&&"object"===l(t.stops[0][0]),o=n||void 0!==t.property,s=n||!o,a=t.type||e||"exponential";if("exponential"===a)r=xt;else if("interval"===a)r=vt;else if("categorical"===a)r=_t;else{if("identity"!==a)throw new Error('Unknown function type "'+a+'"');r=wt}if(n){for(var h={},u=[],p=0;p<t.stops.length;p++){var c=t.stops[p];void 0===h[c[0].zoom]&&(h[c[0].zoom]={zoom:c[0].zoom,type:t.type,property:t.property,stops:[]}),h[c[0].zoom].stops.push([c[0].value,c[1]])}for(var f in h)u.push([h[f].zoom,mt(h[f])]);(i=function(e,i){return xt({stops:u,base:t.base},e)(e,i)}).isFeatureConstant=!1,i.isZoomConstant=!1}else s?((i=function(e){return r(t,e)}).isFeatureConstant=!0,i.isZoomConstant=!1):((i=function(e,i){return r(t,i[t.property])}).isFeatureConstant=!1,i.isZoomConstant=!0)}else(i=function(){return t}).isFeatureConstant=!0,i.isZoomConstant=!0;return i}function _t(t,e){for(var i=0;i<t.stops.length;i++)if(e===t.stops[i][0])return t.stops[i][1];return t.stops[0][1]}function vt(t,e){for(var i=0;i<t.stops.length&&!(e<t.stops[i][0]);i++);return t.stops[Math.max(i-1,0)][1]}function xt(t,e){for(var i=void 0!==t.base?t.base:1,r=0;!(r>=t.stops.length||e<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:function t(e,i,r,n,o,s){return"function"==typeof o?function(){var a=o.apply(void 0,arguments),h=s.apply(void 0,arguments);return t(e,i,r,n,a,h)}:o.length?function(t,e,i,r,n,o){for(var s=[],a=0;a<n.length;a++)s[a]=bt(t,e,i,r,n[a],o[a]);return s}(e,i,r,n,o,s):bt(e,i,r,n,o,s)}(e,i,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}function wt(t,e){return e}function bt(t,e,i,r,n,o){var s,a=r-i,h=t-i;return n*(1-(s=1===e?h/a:(Math.pow(e,h)-1)/(Math.pow(e,a)-1)))+o*s}function Ct(t){return t&&"object"===(void 0===t?"undefined":l(t))&&(t.stops||t.property&&"identity"===t.type)}function Pt(t){for(var e in t)if(Ct(t[e]))return!0;return!1}function Mt(t){return mt(t,"exponential")}function Tt(t,e){if(!t)return null;var i=!1;if(Array.isArray(t)){for(var r,n=[],o=0;o<t.length;o++)(r=Tt(t[o],e))?(n.push(r),i=!0):n.push(t[o]);return i?n:t}var s,a={__fn_types_loaded:!0},h=[];for(s in t)t.hasOwnProperty(s)&&h.push(s);for(var u=0,l=h.length;u<l;u++)Ct(t[s=h[u]])?(i=!0,a["_"+s]=t[s],function(t){Object.defineProperty(a,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=Mt(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})}(s)):a[s]=t[s];return i?a:t}function St(t){if(!t||!t.stops)return[];for(var e=[],i=0,r=t.stops.length;i<r;i++)e.push(t.stops[i][1]);return e}Object.freeze({createFilter:st,getFilterFeature:yt,compileStyle:gt,isFunctionDefinition:Ct,hasFunctionDefinition:Pt,interpolated:Mt,piecewiseConstant:function(t){return mt(t,"interval")},loadFunctionTypes:Tt,getFunctionTypeResources:St});function Ot(t){var e={stroke:{stroke:t.markerLineColor,"stroke-width":t.markerLineWidth,"stroke-opacity":t.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:t.markerFill,"fill-opacity":t.markerFillOpacity}};return"butt"===e.stroke["stroke-linecap"]&&oe.vml&&(e.stroke["stroke-linecap"]="flat"),0===e.stroke["stroke-width"]&&(e.stroke["stroke-opacity"]=0),e}function Et(t,e,i){if(!t.markerPath)return null;var r=1,n=Ot(t);m(t.markerOpacity)&&(r=t.markerOpacity),m(t.opacity)&&(r*=t.opacity);var o={};if(n){for(var s in n.stroke)n.stroke.hasOwnProperty(s)&&(g(n.stroke[s])||(o[s]=n.stroke[s]));for(var a in n.fill)n.fill.hasOwnProperty(a)&&(g(n.fill[a])||(o[a]=n.fill[a]))}for(var h=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath],u=void 0,l=[],p=0;p<h.length;p++)(u=y({},u=x(h[p])?{path:h[p]}:h[p],o)).d=u.path,delete u.path,l.push(u);var c=['<svg version="1.1"','xmlns="http://www.w3.org/2000/svg"'];r<1&&c.push('opacity="'+r+'"'),t.markerPathWidth&&t.markerPathHeight&&c.push('viewBox="0 0 '+t.markerPathWidth+" "+t.markerPathHeight+'"'),c.push('preserveAspectRatio="none"'),e&&c.push('width="'+e+'"'),i&&c.push('height="'+i+'"'),c.push("><defs></defs>");for(var f=0;f<l.length;f++){var d="<path ";for(var _ in l[f])l[f].hasOwnProperty(_)&&(d+=" "+_+'="'+l[f][_]+'"');d+="></path>",c.push(d)}return c.push("</svg>"),"data:image/svg+xml;base64,"+Q(c.join(" "))}function kt(t,e){if(!t)return[];var i=t;Array.isArray(t)||(i=[t]);for(var r=[],n=s,o=void 0,h=void 0,u=void 0,l=void 0,p=i.length-1;p>=0;p--)if(t=i[p]){e&&(t=Lt(t));for(var c=0;c<n.length;c++)if(Ct(o=t[n[c]])&&(o=St(o)),o){Array.isArray(o)||(o=[o]);for(var f=0;f<o.length;f++)"url("===o[f].slice(0,4)&&(o[f]=X(o[f])),h=a[c],r.push([o[f],t[h[0]],t[h[1]]])}if("path"===t.markerType&&t.markerPath)if(u=Ct(t.markerWidth)?200:t.markerWidth,l=Ct(t.markerHeight)?200:t.markerHeight,Ct(t.markerPath)){o=St(t.markerPath);for(var d=t.markerPath,y=0;y<o.length;y++)t.markerPath=o[y],r.push([Et(t),u,l]);t.markerPath=d}else r.push([Et(t),u,l])}return r}function Lt(t){if(!t)return null;var e=t;if(S)return e;for(var i=s,r=void 0,n=0,o=i.length;n<o;n++)(r=e[i[n]])&&(e[i[n]]=At(r));return e}function At(t){if(Ct(t)){for(var e=t.stops,i=0;i<e.length;i++)e[i][1]=At(e[i][1]);return t}return"url("===t.slice(0,4)&&(t=X(t)),!U(t)&&(t.length<="data:".length||"data:"!==t.substring(0,"data:".length))&&(t=function(t,e){var i=t.split("/"),r=e.split("/");if(0===e.slice(0,1))return i.slice(0,3).join("/")+e;i.pop();for(var n=0;n<r.length;n++)"."!==r[n]&&(".."===r[n]?i.pop():i.push(r[n]));return i.join("/")}(location.href,t)),t}function Rt(t){return t&&t.colorStops}function jt(t){var e=[t.type];if(t.places&&e.push(t.places.join()),t.colorStops){for(var i=[],r=t.colorStops.length-1;r>=0;r--)i.push(t.colorStops[r].join());e.push(i.join(","))}return e.join("_")}function Dt(t,e){function i(t,e){g(t.opacity)?t.opacity=e:t.opacity*=e}var r=void 0;if(Array.isArray(t)){r=[];for(var n=0;n<t.length;n++){var o=y({},t[n]);i(o,e),r.push(o)}}else i(r=y({},t),e);return r}function It(t){var e=Array.prototype.slice.call(arguments,1);if(e&&e.length||(e=[{}]),Array.isArray(t)){for(var i=void 0,r=void 0,n=[],o=0,s=t.length;o<s;o++){i=t[o],r={};for(var a=0,h=e.length;a<h;a++)Array.isArray(e[a])?g(e[a][o])?y(r,i||{}):y(r,i,e[a][o]):y(r,i,e[a]?e[a]:{});n.push(r)}return n}var u=[{},t];return u.push.apply(u,e),y.apply(this,u)}Object.freeze({now:d,extend:y,isNil:g,isNumber:m,isInteger:_,isObject:v,isString:x,isFunction:w,hasOwn:C,join:function(t,e){return t.join?t.join(e||","):Array.prototype.join.call(t,e||",")},toRadian:M,toDegree:T,IS_NODE:S,get requestAnimFrame(){return O},get cancelAnimFrame(){return E},isSVG:k,loadImage:L,UID:R,GUID:j,parseJSON:D,pushIn:I,removeFromArray:z,forEachCoord:H,getValueOrDefault:Z,sign:G,log2:F,interpolate:W,wrap:N,clamp:B,isArrayHasData:V,isURL:U,isCssUrl:Y,extractCssUrl:X,btoa:Q,b64toBlob:$,computeDegree:tt,emptyImageUrl:et,equalMapView:it,flash:nt,translateToSVGStyles:Ot,getMarkerPathBase64:Et,getExternalResources:kt,convertResourceUrl:Lt,isGradient:Rt,getGradientStamp:jt,getSymbolStamp:function t(e){var i=[];if(Array.isArray(e)){for(var r=0;r<e.length;r++)i.push(t(e[r]));return"[ "+i.join(" , ")+" ]"}for(var n in e)C(e,n)&&(w(e[n])||(Rt(e[n])?i.push(n+"="+jt(e[n])):i.push(n+"="+e[n])));return i.join(";")},lowerSymbolOpacity:Dt,extendSymbol:It});var zt={};if(!S){var Ht=navigator.userAgent.toLowerCase(),Zt=document.documentElement,Gt="ActiveXObject"in window,Ft=-1!==Ht.indexOf("webkit"),Wt=-1!==Ht.indexOf("phantom"),Nt=-1!==Ht.search("android [23]"),Bt=-1!==Ht.indexOf("chrome"),Vt=-1!==Ht.indexOf("gecko")&&!Ft&&!window.opera&&!Gt,Ut="undefined"!=typeof orientation||-1!==Ht.indexOf("mobile"),Jt=!window.PointerEvent&&window.MSPointerEvent,qt=window.PointerEvent&&navigator.pointerEnabled||Jt,Yt=Gt&&"transition"in Zt.style,Xt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!Nt,Kt="MozPerspective"in Zt.style,Qt="OTransition"in Zt.style,$t=(Yt||Xt||Kt)&&!Qt&&!Wt,te=0;Bt&&(te=Ht.match(/chrome\/([\d.]+)/)[1]);var ee=!Wt&&(qt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),ie=void 0;try{var re=document.createElement("canvas"),ne=re.getContext("webgl")||re.getContext("experimental-webgl");ie=ne&&ne instanceof WebGLRenderingContext}catch(t){ie=!1}zt={ie:Gt,ielt9:Gt&&!document.addEventListener,edge:"msLaunchUri"in navigator&&!("documentMode"in document),webkit:Ft,gecko:Vt,android:-1!==Ht.indexOf("android"),android23:Nt,chrome:Bt,chromeVersion:te,safari:!Bt&&-1!==Ht.indexOf("safari"),phantomjs:Wt,ie3d:Yt,webkit3d:Xt,gecko3d:Kt,opera12:Qt,any3d:$t,mobile:Ut,mobileWebkit:Ut&&Ft,mobileWebkit3d:Ut&&Xt,mobileOpera:Ut&&window.opera,mobileGecko:Ut&&Vt,touch:!!ee,msPointer:!!Jt,pointer:!!qt,retina:(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,language:navigator.browserLanguage?navigator.browserLanguage:navigator.language,ie9:Gt&&9===document.documentMode,ie10:Gt&&10===document.documentMode,webgl:ie}}var oe=zt,se=function(){function t(e,i){if(p(this,t),g(e)||g(i)?g(e.x)||g(e.y)?Array.isArray(e)&&(this.x=+e[0],this.y=+e[1]):(this.x=+e.x,this.y=+e.y):(this.x=+e,this.y=+i),this._isNaN())throw new Error("Position is NaN")}return t.prototype.abs=function(){return new this.constructor(Math.abs(this.x),Math.abs(this.y))},t.prototype._abs=function(){return this.x=Math.abs(this.x),this.y=Math.abs(this.y),this},t.prototype._round=function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},t.prototype.round=function(){return new this.constructor(Math.round(this.x),Math.round(this.y))},t.prototype._ceil=function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},t.prototype.ceil=function(){return new this.constructor(Math.ceil(this.x),Math.ceil(this.y))},t.prototype._floor=function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},t.prototype.floor=function(){return new this.constructor(Math.floor(this.x),Math.floor(this.y))},t.prototype.copy=function(){return new this.constructor(this.x,this.y)},t.prototype._add=function(t,e){return g(t.x)?g(t[0])?(this.x+=t,this.y+=e):(this.x+=t[0],this.y+=t[1]):(this.x+=t.x,this.y+=t.y),this},t.prototype.add=function(t,e){var i=void 0,r=void 0;return g(t.x)?g(t[0])?(i=this.x+t,r=this.y+e):(i=this.x+t[0],r=this.y+t[1]):(i=this.x+t.x,r=this.y+t.y),new this.constructor(i,r)},t.prototype._sub=function(t,e){return g(t.x)?g(t[0])?(this.x-=t,this.y-=e):(this.x-=t[0],this.y-=t[1]):(this.x-=t.x,this.y-=t.y),this},t.prototype._substract=function(){return this._sub.apply(this,arguments)},t.prototype.sub=function(t,e){var i=void 0,r=void 0;return g(t.x)?g(t[0])?(i=this.x-t,r=this.y-e):(i=this.x-t[0],r=this.y-t[1]):(i=this.x-t.x,r=this.y-t.y),new this.constructor(i,r)},t.prototype.substract=function(){return this.sub.apply(this,arguments)},t.prototype.multi=function(t){return new this.constructor(this.x*t,this.y*t)},t.prototype._multi=function(t){return this.x*=t,this.y*=t,this},t.prototype.div=function(t){return this.multi(1/t)},t.prototype._div=function(t){return this._multi(1/t)},t.prototype.equals=function(t){return t instanceof this.constructor&&(this.x===t.x&&this.y===t.y)},t.prototype._isNaN=function(){return isNaN(this.x)||isNaN(this.y)},t.prototype.isZero=function(){return 0===this.x&&0===this.y},t.prototype.toArray=function(){return[this.x,this.y]},t.prototype.toFixed=function(t){return new this.constructor(this.x.toFixed(t),this.y.toFixed(t))},t.prototype.toJSON=function(){return{x:this.x,y:this.y}},t}(),ae=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.closeTo=function(t,e){return e||(e=0),this.x>=t.x-e&&this.x<=t.x+e&&this.y>=t.y-e&&this.y<=t.y+e},e.prototype.distanceTo=function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},e.prototype.mag=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.unit=function(){return this.copy()._unit()},e.prototype._unit=function(){return this._div(this.mag()),this},e.prototype.perp=function(){return this.copy()._perp()},e.prototype._perp=function(){var t=this.y;return this.y=this.x,this.x=-t,this},e.prototype.angleWith=function(t){return this.angleWithSep(t.x,t.y)},e.prototype.angleWithSep=function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},e.prototype._rotate=function(t){var e=Math.cos(t),i=Math.sin(t),r=e*this.x-i*this.y,n=i*this.x+e*this.y;return this.x=r,this.y=n,this},e.prototype.rotate=function(t){return this.copy()._rotate(t)},e}(se),he=function(){function t(e,i){p(this,t),m(e)&&m(i)?(this.width=e,this.height=i):m(e.width)?(this.width=e.width,this.height=e.height):Array.isArray(e)&&(this.width=e[0],this.height=e[1])}return t.prototype.copy=function(){return new t(this.width,this.height)},t.prototype.add=function(e,i){var r=void 0,n=void 0;return e instanceof t?(r=this.width+e.width,n=this.height+e.height):(r=this.width+e,n=this.height+i),new t(r,n)},t.prototype.equals=function(t){return this.width===t.width&&this.height===t.height},t.prototype.multi=function(e){return new t(this.width*e,this.height*e)},t.prototype._multi=function(t){return this.width*=t,this.height*=t,this},t.prototype._round=function(){return this.width=Math.round(this.width),this.height=Math.round(this.height),this},t.prototype.toPoint=function(){return new ae(this.width,this.height)},t.prototype.toArray=function(){return[this.width,this.height]},t.prototype.toJSON=function(){return{width:this.width,height:this.height}},t}();function ue(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}var le=/[\b\t\r\v\f]/gim;function pe(t){return x(t)?t.replace(le,""):t}function ce(t){return ue(t).split(/\s+/)}var fe="undefined"!=typeof document?document.createElement("canvas").getContext("2d"):null;function de(t,e){return de.node?de.node(t,e):(fe.font=e,fe.measureText(t).width)}var ye={};function ge(t,e){if(ge.node)return ge.node(t,e);var i=de(t,e);return e||(e="_default_"),ye[e]||(ye[e]=me(e)),new he(i,ye[e])}function me(t){var e=Ye();"_default_"!==t&&(e.style.font=t),e.innerHTML="秦";var i=e.clientHeight;return Le(e),i}function _e(t,e,i,r){if(!t||0===t.length)return[{text:"",width:0}];var n=g(r)?de(t,e):r,o=n/t.length,s=Math.floor(i/o/2);if(o>=i||s<=0)return[{text:"",width:i}];if(n<=i)return[{text:t,width:n}];for(var a=[],h=t.substring(0,s),u=o*s,l=s,p=t.length;l<p;l++){var c=t[l],f=de(h+c);f>=i?(a.push({text:h,width:u}),h=t.substring(l,s+l),l+=s-1,u=o*s):(h+=c,u=f),l>=p-1&&(u=de(h),a.push({text:h,width:u}))}return a}var ve=/\{([\w_]+)\}/g;function xe(t,e){return x(t)?t.replace(ve,function(t,i){if(!e)return"";var r=e[i];return g(r)?"":Array.isArray(r)?r.join():r}):t}function we(t,e,i){var r=t.width,n=t.height;return new ae("left"===e?-r:"right"===e?0:-r/2,"top"===i?-n:"bottom"===i?0:-n/2)}function be(t){return t.textFont?t.textFont:(t.textStyle&&"normal"!==t.textStyle?t.textStyle+" ":"")+(t.textWeight&&"normal"!==t.textWeight?t.textWeight+" ":"")+t.textSize+"px "+('"'===t.textFaceName[0]?t.textFaceName:'"'+t.textFaceName+'"')}function Ce(t,e){var i=be(e),r=e.textLineSpacing||0,n=ge(t,i),o=n.width,s=n.height,a=e.textWrapCharacter,h=[],u=e.textWrapWidth;(!u||u>o)&&(u=o),x(t)||(t+="");var l=0;if(a&&t.indexOf(a)>=0)for(var p=t.split(a),c=0,f=p.length;c<f;c++){var d=p[c],y=de(d,i);if(y>u)for(var g=_e(d,i,u,y),m=0,_=g.length;m<_;m++){var v=g[m].width;v>l&&(l=v),h.push({text:g[m].text,size:new he(v,s)})}else y>l&&(l=y),h.push({text:d,size:new he(y,s)})}else if(o>u)for(var w=_e(t,i,u,o),b=0;b<w.length;b++){var C=w[b].width;C>l&&(l=C),h.push({text:w[b].text,size:new he(C,s)})}else o>l&&(l=o),h.push({text:t,size:n});var P=h.length;return{total:P,size:new he(l,s*P+r*(P-1)),rows:h,rawSize:n}}Object.freeze({trim:ue,escapeSpecialChars:pe,splitWords:ce,stringWidth:de,stringLength:ge,getFontHeight:me,splitContent:_e,replaceVariable:xe,getAlignPoint:we,getFont:be,splitTextToRow:Ce});var Pe=S?function(t){return t[0]}:function(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1},Me=Pe(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),Te=Pe(["transformOrigin","WebkitTransformOrigin","OTransformOrigin","MozTransformOrigin","msTransformOrigin"]),Se=Pe(["transition","WebkitTransition","OTransition","MozTransition","msTransition"]),Oe=Pe(["filter","WebkitFilter","OFilter","MozFilter","msFilter"]);function Ee(t,e){var i=document.createElement(t);return e&&Be(i,e),i}function ke(t,e,i){var r=Ee(t);return e&&Fe(r,e),i&&i.appendChild(r),r}function Le(t){if(!t)return this;if(oe.ielt9||oe.ie9){var e=Ee("div");e.appendChild(t),e.innerHTML="",e=null}else t.parentNode&&t.parentNode.removeChild(t);return this}function Ae(t,e,i,r){if(!(t&&t.addEventListener&&e&&i))return this;for(var n=function(e){e||(e=window.event),i.call(r||t,e)},o=e.split(" "),s=o.length-1;s>=0;s--){var a=o[s];if(a)t["Z__"+a]||(t["Z__"+a]=[]),je(t,a,i)>=0&&Re(t,a,i),t["Z__"+a].push({callback:n,src:i}),"mousewheel"===a&&oe.gecko&&(a="DOMMouseScroll"),t.addEventListener(a,n,!1)}return this}function Re(t,e,i){function r(e,i){"mousewheel"===e&&oe.gecko&&(e="DOMMouseScroll"),t.removeEventListener(e,i,!1)}if(!t||!t.removeEventListener||!e)return this;for(var n=e.split(" "),o=n.length-1;o>=0;o--){var s=n[o];if(s){if(!i&&t["Z__"+s]){for(var a=t["Z__"+s],h=0,u=a.length;h<u;h++)r(a[h].callback);return delete t["Z__"+s],this}var l=je(t,s,i);if(l<0)return this;r(s,t["Z__"+s][l].callback),t["Z__"+s].splice(l,1)}}return this}function je(t,e,i){if(!t||!t["Z__"+e]||!i)return-1;for(var r=t["Z__"+e],n=0,o=r.length;n<o;n++)if(r[n].src===i)return n;return-1}function De(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ie(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,this}function ze(t){return t.onselectstart=function(){return!1},t.ondragstart=function(){return!1},t.setAttribute("unselectable","on"),this}function He(t,e){return t?(oe.any3d?Ue(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px"),e):null}function Ze(t){var e=window.getComputedStyle(t),i=[parseInt(e["padding-left"]),parseInt(e["padding-top"])],r=t.getBoundingClientRect(),n=t.offsetWidth,o=t.offsetHeight,s=n?r.width/n:1,a=o?r.height/o:1;return t.__position=[r.left+i[0],r.top+i[1],s,a],t.__position}function Ge(t,e){t||(t=window.event);var i=e.__position;return i||(i=Ze(e)),new ae(t.clientX/i[2]-i[0]-e.clientLeft,t.clientY/i[3]-i[1]-e.clientTop)}function Fe(t,e){var i,r,n,o=t.style.cssText;return r=";",(n=(i=o).length-r.length)>=0&&i.indexOf(r,n)===n||(o+=";"),t.style.cssText=o+e,this}function We(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=Ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function Ne(t,e){if(void 0===t.classList||We(t,e)){var i=Ve(t);Be(t,(i?i+" ":"")+e)}else for(var r=ce(e),n=0,o=r.length;n<o;n++)t.classList.add(r[n]);return this}function Be(t,e){return g(t.className.baseVal)?t.className=e:t.className.baseVal=e,this}function Ve(t){return g(t.className.baseVal)?t.className:t.className.baseVal}function Ue(t,e){var i=e||new ae(0,0);return t.style[Me]=oe.any3d?"translate3d("+i.x+"px,"+i.y+"px,0px)":"translate("+i.x+"px,"+i.y+"px)",this}function Je(t){return/<[a-z\][\s\S]*>/i.test(t)}function qe(t,e){var i=Ye(t);x(e)?i.innerHTML=e:i.appendChild(e);var r=new he(i.clientWidth,i.clientHeight);return Le(i),r}function Ye(t){var e=document.createElement(t);return e.style.cssText="position:absolute;left:-10000px;top:-10000px;",document.body.appendChild(e),e}var Xe=Ae,Ke=Re,Qe=(Object.freeze({TRANSFORM:Me,TRANSFORMORIGIN:Te,TRANSITION:Se,CSSFILTER:Oe,createEl:Ee,createElOn:ke,removeDomNode:Le,addDomEvent:Ae,removeDomEvent:Re,listensDomEvent:je,preventDefault:De,stopPropagation:Ie,preventSelection:ze,offsetDom:He,computeDomPosition:Ze,getEventContainerPoint:Ge,setStyle:Fe,hasClass:We,addClass:Ne,setClass:Be,getClass:Ve,setOpacity:function(t,e){return t.style.opacity=e,this},setTransform:Ue,setTransformMatrix:function(t,e){var i="matrix("+(x(e)?e:e.join())+")";return t.style[Me]!==i&&(t.style[Me]=i),this},removeTransform:function(t){return t.style[Me]&&(t.style[Me]=""),this},isHTML:Je,measureDom:qe,getDomRuler:Ye,on:Xe,off:Ke}),{jsonp:function(t,e){var i="_maptalks_jsonp_"+R();t.match(/\?/)?t+="&callback="+i:t+="?callback="+i;var r=document.createElement("script");return r.type="text/javascript",r.src=t,window[i]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[i]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,e,i){if(w(e)){var r=i;i=e,e=r}if(S&&Qe.get.node)return Qe.get.node(t,i,e);var n=Qe._getClient(i);if(n.open("GET",t,!0),e){for(var o in e.headers)n.setRequestHeader(o,e.headers[o]);n.withCredentials="include"===e.credentials,e.responseType&&(n.responseType=e.responseType)}return n.send(null),n},post:function(t,e,i){var r=void 0;if(x(t)){if(w(e)){var n=i;i=e,e=n}r=(e=e||{}).postData}else{var o=i;r=e,t=(e=t).url,i=o}if(S&&Qe.post.node)return e.url=t,Qe.post.node(e,r,i);var s=Qe._getClient(i);if(s.open("POST",e.url,!0),e.headers||(e.headers={}),e.headers["Content-Type"]||(e.headers["Content-Type"]="application/x-www-form-urlencoded"),"setRequestHeader"in s)for(var a in e.headers)e.headers.hasOwnProperty(a)&&s.setRequestHeader(a,e.headers[a]);return x(r)||(r=JSON.stringify(r)),s.send(r),s},_wrapCallback:function(t,e){return function(){4===t.readyState&&(200===t.status?"arraybuffer"===t.responseType?0===t.response.byteLength?e(new Error("http status 200 returned without content.")):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")}):e(null,t.responseText):e(new Error(t.statusText+","+t.status)))}},_getClient:function(t){var e=void 0;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=Qe._wrapCallback(e,t),e},getArrayBuffer:function(t,e,i){if(w(e)){var r=i;i=e,e=r}return e||(e={}),e.responseType="arraybuffer",Qe.get(t,e,i)},getImage:function(t,e,i){return Qe.getArrayBuffer(e,i,function(e,i){if(e)t.onerror&&t.onerror(e);else if(i){var r=window.URL||window.webkitURL,n=t.onload;t.onload=function(){n&&n(),r.revokeObjectURL(t.src)};var o=new Blob([new Uint8Array(i.data)],{type:i.contentType});t.cacheControl=i.cacheControl,t.expires=i.expires,t.src=i.data.byteLength?r.createObjectURL(o):et}})},getJSON:function(t,e,i){if(w(e)){var r=i;i=e,e=r}var n=function(t,e){var r=e?D(e):null;i(t,r)};return e&&e.jsonp?Qe.jsonp(t,n):Qe.get(t,e,n)}}),$e=!1,ti={setHitTesting:function(t){$e=t},createCanvas:function(t,e,i){var r=void 0;return S?r=new i(t,e):((r=Ee("canvas")).width=t,r.height=e),r},prepareCanvasFont:function(t,e){t.textBaseline="top",t.font=be(e);var i=e.textFill;i||(i="#000"),t.fillStyle=ti.getRgba(i,e.textOpacity)},prepareCanvas:function(t,e,i,r){if(e){var n=e.lineWidth;g(n)||t.lineWidth===n||(t.lineWidth=n);var o=e.linePatternFile||e.lineColor||"#000";if(r)t.strokeStyle="#000";else if(ri(o)&&i){var s=void 0;(e.linePatternDx||e.linePatternDy)&&(s=[e.linePatternDx,e.linePatternDy]),ti._setStrokePattern(t,o,n,s,i),e.lineDasharray=[]}else Rt(o)?e.lineGradientExtent?t.strokeStyle=ti._createGradient(t,o,e.lineGradientExtent):t.strokeStyle="#000":t.strokeStyle=o;e.lineJoin&&(t.lineJoin=e.lineJoin),e.lineCap&&(t.lineCap=e.lineCap),t.setLineDash&&V(e.lineDasharray)&&t.setLineDash(e.lineDasharray);var a=e.polygonPatternFile||e.polygonFill||"rgba(255,255,255,0)";if(r)t.fillStyle="#000";else if(ri(a)&&i){var h=ni(a),u=i.getImage([h,null,null]);if(u||(u=i.getImage([h+"-texture",null,n])),k(h)&&u instanceof Image&&(oe.edge||oe.ie)){var l=u.width||20,p=u.height||20,c=ti.createCanvas(l,p);ti.image(c.getContext("2d"),u,0,0,l,p),u=c}u?(t.fillStyle=t.createPattern(u,"repeat"),(e.polygonPatternDx||e.polygonPatternDy)&&(t.fillStyle.polygonPatternOffset=[e.polygonPatternDx,e.polygonPatternDy])):"undefined"!=typeof console&&console.warn("img not found for",h)}else Rt(a)?e.polygonGradientExtent?t.fillStyle=ti._createGradient(t,a,e.polygonGradientExtent):t.fillStyle="rgba(255,255,255,0)":t.fillStyle=a}},_createGradient:function(t,e,i){var r=null,n=e.places,o=i.getMin(),s=i.getMax(),a=i.getWidth(),h=i.getHeight();if(e.type&&"linear"!==e.type){if("radial"===e.type){if(n){if(6!==n.length)throw new Error("A radial gradient's places should have 6 numbers.");n=[o.x+n[0]*a,o.y+n[1]*h,a*n[2],o.x+n[3]*a,o.y+n[4]*h,a*n[5]]}else{var u=i.getCenter()._round();n=[u.x,u.y,Math.abs(u.x-o.x),u.x,u.y,0]}r=t.createRadialGradient.apply(t,n)}}else{if(n){if(4!==n.length)throw new Error("A linear gradient's places should have 4 numbers.");n=[o.x+n[0]*a,o.y+n[1]*h,o.x+n[2]*a,o.y+n[3]*h]}else n=[o.x,o.y,s.x,o.y];r=t.createLinearGradient.apply(t,n)}return e.colorStops.forEach(function(t){r.addColorStop.apply(r,t)}),r},_setStrokePattern:function(t,e,i,r,n){var o=ni(e),s=void 0;if(S)s=n.getImage([o,null,i]);else{var a=o+"-texture-"+i;if(!(s=n.getImage(a))){var h=n.getImage([o,null,null]);if(h){var u=void 0;u=h.width&&h.height?Math.round(h.width*i/h.height):i;var l=ti.createCanvas(u,i,t.canvas.constructor);ti.image(l.getContext("2d"),h,0,0,u,i),n.addResource([a,null,i],l),s=l}}}s?(t.strokeStyle=t.createPattern(s,"repeat"),t.strokeStyle.linePatternOffset=r):"undefined"!=typeof console&&console.warn("img not found for",o)},clearRect:function(t,e,i,r,n){t.canvas._drawn=!1,t.clearRect(e,i,r,n)},fillCanvas:function(t,e,i,r){if($e&&(e=1),t.canvas._drawn=!0,0!==e){var n=ti._isPattern(t.fillStyle),o=t.fillStyle&&t.fillStyle.polygonPatternOffset,s=o?o[0]:0,a=o?o[1]:0;g(e)&&(e=1);var h=void 0;e<1&&(h=t.globalAlpha,t.globalAlpha*=e),n&&(i=i||0,r=r||0,t.translate(i+s,r+a)),t.fill(),n&&t.translate(-i-s,-r-a),e<1&&(t.globalAlpha=h)}},getRgba:function(t,e){if(g(e)&&(e=1),"#"!==t[0])return t;var i=void 0,r=void 0,n=void 0;return 7===t.length?(i=parseInt(t.substring(1,3),16),r=parseInt(t.substring(3,5),16),n=parseInt(t.substring(5,7),16)):(i=17*parseInt(t.substring(1,2),16),r=17*parseInt(t.substring(2,3),16),n=17*parseInt(t.substring(3,4),16)),"rgba("+i+","+r+","+n+","+e+")"},image:function(t,e,i,r,n,o){t.canvas._drawn=!0;try{m(n)&&m(o)?t.drawImage(e,i,r,n,o):t.drawImage(e,i,r)}catch(t){console&&(console.warn("error when drawing image on canvas:",t),console.warn(e))}},text:function(t,e,i,r,n){ti._textOnMultiRow(t,n.rows,r,i,n.size,n.rawSize)},_textOnMultiRow:function(t,e,i,r,n,o){for(var s=we(n,i.textHorizontalAlignment,i.textVerticalAlignment),a=o.height+i.textLineSpacing,h=r.add(0,s.y),u=i.textMaxHeight,l=void 0,p=void 0,c=0,f=0,d=e.length;f<d&&(l=e[f].text,p=we(e[f].size,i.textHorizontalAlignment,i.textVerticalAlignment),ti._textOnLine(t,l,h.add(p.x,f*a),i.textHaloRadius,i.textHaloFill,i.textHaloOpacity),!(u>0&&(c+=a)+o.height>=u));f++);},_textOnLine:function(t,e,i,r,n,o){$e&&(o=1);var s=0!==o&&0!==r;t.textBaseline="top";var a=void 0,h=void 0,u=t.shadowBlur,l=t.shadowOffsetX,p=t.shadowOffsetY;if(s){var c=t.globalAlpha;t.globalAlpha*=o,t.miterLimit=2,t.lineJoin="round",t.lineCap="round",t.lineWidth=2*r,t.strokeStyle=n,t.strokeText(e,Math.round(i.x),Math.round(i.y)),t.miterLimit=10,t.globalAlpha=c,a=t.globalCompositeOperation,t.globalCompositeOperation="destination-out",h=t.fillStyle,t.fillStyle="#000"}u&&s&&(t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0),ti.fillText(t,e,i),a&&(t.globalCompositeOperation=a,ti.fillText(t,e,i,h),u&&(t.shadowBlur=u,t.shadowOffsetX=l,t.shadowOffsetY=p))},fillText:function(t,e,i,r){t.canvas._drawn=!0,r&&(t.fillStyle=r),t.fillText(e,Math.round(i.x),Math.round(i.y))},_stroke:function(t,e,i,r){if($e&&(e=1),t.canvas._drawn=!0,0!==e){var n=t.strokeStyle&&t.strokeStyle.linePatternOffset,o=n?n[0]:0,s=n?n[1]:0,a=ti._isPattern(t.strokeStyle)&&(!g(i)&&!g(r)||!g(o)&&!g(s));g(e)&&(e=1);var h=void 0;e<1&&(h=t.globalAlpha,t.globalAlpha*=e),a&&(i=i||0,r=r||0,t.translate(i+o,r+s)),t.stroke(),a&&t.translate(-i-o,-r-s),e<1&&(t.globalAlpha=h)}},_path:function(t,e,i,r,n){if(V(e))for(var o,s,a,h=V(i),u=!0!==n&&ti._isPattern(t.strokeStyle),l=void 0,p=void 0,c=void 0,f=0,d=e.length;f<d;f++)if(l=e[f],!h||t.setLineDash)t.lineTo(l.x,l.y),u&&f>0&&(p=e[f-1],s=l,void 0,a=tt((o=p).x,o.y,s.x,s.y),t.save(),t.translate(o.x,o.y-t.lineWidth/2/Math.cos(a)),t.rotate(a),ti._stroke(t,r),t.restore(),t.beginPath(),t.moveTo(l.x,l.y));else if(h){if(f===d-1)break;c=e[f+1],ei(t,l,c,i)}},path:function(t,e,i,r,n){V(e)&&(t.beginPath(),t.moveTo(e[0].x,e[0].y),ti._path(t,e,n,i),ti._stroke(t,i))},polygon:function(t,e,i,r,n,o){if(V(e)){var s=ti._isPattern(t.strokeStyle),a=V(n)&&!t.setLineDash||s&&!o;V(e[0])||(e=[e]);var h=void 0,u=void 0,l=void 0;if(a){for(t.save(),u=0,l=e.length;u<l;u++)V(e[u])&&(ti._ring(t,e[u],null,0,!0),h=r,u>0&&(t.globalCompositeOperation="destination-out",h=1),p(e,u,h),u>0?t.globalCompositeOperation="source-over":l>1&&(t.fillStyle="#fff"),ti._stroke(t,0));t.restore()}for(u=0,l=e.length;u<l;u++)V(e[u])&&(o?(ti.paintSmoothLine(t,e[u],i,o,!0),t.closePath()):ti._ring(t,e[u],n,i),a||(h=r,u>0&&(t.globalCompositeOperation="destination-out",h=1),p(e,u,h),u>0?t.globalCompositeOperation="source-over":l>1&&(t.fillStyle="#fff")),ti._stroke(t,i))}function p(e,i,r){ti.fillCanvas(t,r,e[i][0].x,e[i][0].y)}},_ring:function(t,e,i,r,n){var o=ti._isPattern(t.strokeStyle);n||!o||e[0].equals(e[e.length-1])||(e=e.concat([e[0]])),t.beginPath(),t.moveTo(e[0].x,e[0].y),ti._path(t,e,i,r,n),o||t.closePath()},paintSmoothLine:function(t,e,i,r,n,o,s){if(e)if(e.length<=2||!r)ti.path(t,e,i);else{var a=e.length,h=n?a:a-1;t.beginPath(),t.moveTo(e[0].x,e[0].y),void 0!==s&&(h-=Math.max(h-o-1,0));for(var u=void 0,l=0;l<h;l++){var p=e[l].x,c=e[l].y,f=void 0,d=void 0,y=void 0,g=void 0,m=void 0,_=void 0;l-1<0?n?(f=e[h-1].x,d=e[h-1].y):(f=e[l+1].x,d=e[l+1].y):(f=e[l-1].x,d=e[l-1].y),l+1<a?(y=e[l+1].x,g=e[l+1].y):(y=e[l+1-a].x,g=e[l+1-a].y),l+2<a?(m=e[l+2].x,_=e[l+2].y):n?(m=e[l+2-a].x,_=e[l+2-a].y):(m=e[l].x,_=e[l].y);var v=w(f,d,p,c,y,g,m,_,r,l===h-1?s:1);if(l===h-1&&s>=0&&s<1){t.bezierCurveTo(v[0],v[1],v[2],v[3],v[4],v[5]),e.splice(h-1,a-(h-1)-1);var x=new ae(v[4],v[5]);x.prevCtrlPoint=new ae(v[2],v[3]),e.push(x),a=e.length}else t.bezierCurveTo(v[0],v[1],v[2],v[3],y,g);e[l].nextCtrlPoint=v.slice(0,2),e[l].prevCtrlPoint=u?u.slice(2):null,u=v}!n&&e[1].prevCtrlPoint&&(e[0].nextCtrlPoint=e[1].prevCtrlPoint,delete e[0].prevCtrlPoint),e[a-1].prevCtrlPoint||(e[a-1].prevCtrlPoint=e[a-2].nextCtrlPoint),ti._stroke(t,i)}function w(t,e,i,r,n,o,s,a,h,u){var l=(t+i)/2,p=(e+r)/2,c=(i+n)/2,f=(r+o)/2,d=(n+s)/2,y=(o+a)/2,g=Math.sqrt((i-t)*(i-t)+(r-e)*(r-e)),m=Math.sqrt((n-i)*(n-i)+(o-r)*(o-r)),_=g/(g+m),v=m/(m+Math.sqrt((s-n)*(s-n)+(a-o)*(a-o))),x=l+(c-l)*_,w=p+(f-p)*_,b=c+(d-c)*v,C=f+(y-f)*v,P=x+(c-x)*h+i-x,M=w+(f-w)*h+r-w,T=b+(c-b)*h+n-b,S=C+(f-C)*h+o-C,O=[P,M,T,S];return u<1?function(t,e,i,r,n,o,s,a,h,u){var l=1-t,p=1-e,c=i*p*p+2*n*e*p+s*e*e,f=n*p*p+2*s*e*p+h*e*e,d=r*p*p+2*o*e*p+a*e*e,y=o*p*p+2*a*e*p+u*e*e;return[(i*l*l+2*n*t*l+s*t*t)*p+(n*l*l+2*s*t*l+h*t*t)*e,(r*l*l+2*o*t*l+a*t*t)*p+(o*l*l+2*a*t*l+u*t*t)*e,c*l+f*t,d*l+y*t,c*p+f*e,d*p+y*e]}(0,u,i,r,P,M,T,S,n,o):O}},_arcBetween:function(t,e,i,r){var n=r,o=e.distanceTo(i),s=o/2/Math.sin(n/2),a=Math.asin((i.y-e.y)/o);e.x>i.x&&(a=Math.PI-a);var h=a-(90*Math.PI/180-n/2),u=Math.cos(h)*s,l=Math.sin(h)*s,p=e.x+u,c=e.y+l,f=Math.asin((i.y-c)/s);p>i.x&&(f=Math.PI-f);var d=f+n;return t.beginPath(),t.arc(p,c,s,f,d),[p,c]},_lineTo:function(t,e){t.lineTo(e.x,e.y)},bezierCurveAndFill:function(t,e,i,r){t.beginPath();var n=e[0];t.moveTo(n.x,n.y);var o=[t];o.push.apply(o,e.splice(1)),ti._bezierCurveTo.apply(ti,o),ti.fillCanvas(t,r),ti._stroke(t,i)},_bezierCurveTo:function(t,e,i,r){t.bezierCurveTo(e.x,e.y,i.x,i.y,r.x,r.y)},ellipse:function(t,e,i,r,n,o){var s,a,h,u,l,p,c;t.beginPath(),i===r?t.arc(e.x,e.y,i,0,2*Math.PI):t.ellipse?t.ellipse(e.x,e.y,i,r,0,0,Math.PI/180*360):(s=e.x,a=e.y,p=(h=i)*(l=.5522848),c=(u=r)*l,t.moveTo(s-h,a),t.bezierCurveTo(s-h,a-c,s-p,a-u,s,a-u),t.bezierCurveTo(s+p,a-u,s+h,a-c,s+h,a),t.bezierCurveTo(s+h,a+c,s+p,a+u,s,a+u),t.bezierCurveTo(s-p,a+u,s-h,a+c,s-h,a),t.closePath()),ti.fillCanvas(t,o,e.x-i,e.y-r),ti._stroke(t,n,e.x-i,e.y-r)},rectangle:function(t,e,i,r,n){t.beginPath(),t.rect(e.x,e.y,i.width,i.height),ti.fillCanvas(t,n,e.x,e.y),ti._stroke(t,r,e.x,e.y)},sector:function(t,e,i,r,n,o){var s=Math.PI/180,a=r[0],h=r[1];function u(t,e,i,r,a,h){var u=s*-h,l=s*-a;t.beginPath(),t.moveTo(e,i),t.arc(e,i,r,u,l),t.lineTo(e,i),ti.fillCanvas(t,o,e-r,i-r),ti._stroke(t,n,e-r,i-r)}u(t,e.x,e.y,i,a,h)},_isPattern:function(t){return!(x(t)||"addColorStop"in t)},drawCross:function(t,e,i,r){t.canvas._drawn=!0,t.strokeStyle=r,t.lineWidth=i,t.beginPath(),t.moveTo(e.x-5,e.y),t.lineTo(e.x+5,e.y),t.moveTo(e.x,e.y-5),t.lineTo(e.x,e.y+5),t.stroke()},copy:function(t,e){var i=e||Ee("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(t,0,0),i}};function ei(t,e,i,r){var n=e.x,o=e.y,s=i.x,a=i.y,h=r,u=function(t,e){return t<=e},l=function(t,e){return t>=e},p=function(t,e){return Math.min(t,e)},c=function(t,e){return Math.max(t,e)},f={thereYet:l,cap:p},d={thereYet:l,cap:p};o-a>0&&(d.thereYet=u,d.cap=c),n-s>0&&(f.thereYet=u,f.cap=c),t.moveTo(n,o);for(var y=n,g=o,m=0,_=!0,v=void 0,x=void 0;!f.thereYet(y,s)||!d.thereYet(g,a);)v=Math.atan2(a-o,s-n),x=h[m],y=f.cap(s,y+Math.cos(v)*x),g=d.cap(a,g+Math.sin(v)*x),_?t.lineTo(y,g):t.moveTo(y,g),m=(m+1)%h.length,_=!_}var ii="data:image/";function ri(t){return t.length>ii.length&&t.substring(0,ii.length)===ii||Y(t)}function ni(t){return t.substring(0,ii.length)===ii?t:X(t)}var oi=function(t){return function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.on=function(t,e,i){if(!t)return this;if(!x(t))return this._switch("on",t,e);if(!e)return this;this._eventMap||(this._eventMap={});var r=t.toLowerCase().split(" "),n=void 0;i||(i=this);for(var o=void 0,s=0,a=r.length;s<a;s++){n=r[s],(o=this._eventMap[n])||(o=[],this._eventMap[n]=o);var h=o.length;if(h>0)for(var u=0;u<h;u++)if(e===o[u].handler&&o[u].context===i)return this;o.push({handler:e,context:i})}return this},e.prototype.addEventListener=function(){return this.on.apply(this,arguments)},e.prototype.once=function(t,e,i){if(!x(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=this._wrapOnceHandler(n,t[n],i));return this._switch("on",r)}for(var o=t.split(" "),s=0,a=o.length;s<a;s++)this.on(o[s],this._wrapOnceHandler(o[s],e,i));return this},e.prototype.off=function(t,e,i){if(!this._eventMap||!t)return this;if(!x(t))return this._switch("off",t,e);if(!e)return this;var r=t.split(" "),n=void 0,o=void 0,s=void 0;i||(i=this);for(var a=0,h=r.length;a<h;a++){if(s="Z__"+(n=r[a].toLowerCase()),!(o=this._eventMap[n]))return this;for(var u=o.length-1;u>=0;u--){var l=o[u];e!==l.handler&&e!==l.handler[s]||l.context!==i||(delete l.handler[s],o.splice(u,1))}}return this},e.prototype.removeEventListener=function(){return this.off.apply(this,arguments)},e.prototype.listens=function(t,e,i){if(!this._eventMap||!x(t))return 0;var r=this._eventMap[t.toLowerCase()];if(!r||!r.length)return 0;for(var n=0,o=0,s=r.length;o<s;o++)if(e){if(e===r[o].handler&&(g(i)||r[o].context===i))return 1}else n++;return n},e.prototype.copyEventListeners=function(t){var e=t._eventMap;if(!e)return this;var i=void 0;for(var r in e)for(var n=0,o=(i=e[r]).length;n<o;n++)this.on(r,i[n].handler,i[n].context);return this},e.prototype.fire=function(){return this._eventParent?this._eventParent.fire.apply(this._eventParent,arguments):this._fire.apply(this,arguments)},e.prototype._wrapOnceHandler=function(t,e,i){var r=this,n="Z__"+t,o=!1,s=function a(){o||(delete s[n],o=!0,i?e.apply(i,arguments):e.apply(this,arguments),r.off(t,a,this))};return s[n]=e,s},e.prototype._switch=function(t,e,i){for(var r in e)e.hasOwnProperty(r)&&this[t](r,e[r],i);return this},e.prototype._clearListeners=function(t){this._eventMap&&x(t)&&(this._eventMap[t.toLowerCase()]&&(this._eventMap[t]=null))},e.prototype._clearAllListeners=function(){this._eventMap=null},e.prototype._setEventParent=function(t){return this._eventParent=t,this},e.prototype._fire=function(t,e){if(!this._eventMap)return this;var i=this._eventMap[t.toLowerCase()];if(!i)return this;e||(e={}),e.type=t,e.target=this;for(var r=i.slice(0),n=void 0,o=void 0,s=0,a=r.length;s<a;s++)r[s]&&(n=r[s].context,!0,o=y({},e),!1===(n?r[s].handler.call(n,o):r[s].handler(o))&&e.domEvent&&Ie(e.domEvent));return this},e}(t)},si=oi(function(){function t(e){p(this,t),this.target=e}return t.prototype.enable=function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},t.prototype.disable=function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},t.prototype.enabled=function(){return!!this._enabled},t.prototype.remove=function(){this.disable(),delete this.target,delete this.dom},t}()),ai=function(){function t(e){if(p(this,t),!this||!this.setOptions)throw new Error('Class instance is being created without "new" operator.');this.setOptions(e),this.callInitHooks()}return t.prototype.callInitHooks=function(){var t=Object.getPrototypeOf(this);return this._visitInitHooks(t),this},t.prototype.setOptions=function(t){if(this.hasOwnProperty("options")||(this.options=this.options?Object.create(this.options):{}),!t)return this;for(var e in t)this.options[e]=t[e];return this},t.prototype.config=function(t){if(!t){var e={};for(var i in this.options)this.options.hasOwnProperty(i)&&(e[i]=this.options[i]);return e}if(2===arguments.length){var r={};r[t]=arguments[1],t=r}for(var n in t)this.options[n]=t[n],this[n]&&this[n]instanceof si&&(t[n]?this[n].enable():this[n].disable());return this.onConfig(t),this},t.prototype.onConfig=function(){},t.prototype._visitInitHooks=function(t){if(!this._initHooksCalled){var e=Object.getPrototypeOf(t);e._visitInitHooks&&e._visitInitHooks.call(this,e),this._initHooksCalled=!0;var i=t._initHooks;if(i&&i!==e._initHooks)for(var r=0;r<i.length;r++)i[r].call(this)}},t.addInitHook=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];var n="function"==typeof t?t:function(){this[t].apply(this,i)},o=this.prototype,s=Object.getPrototypeOf(o);return o._initHooks&&o._initHooks!==s._initHooks||(o._initHooks=[]),o._initHooks.push(n),this},t.include=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];for(var r=0;r<e.length;r++)y(this.prototype,e[r]);return this},t.mergeOptions=function(t){var e=this.prototype,i=Object.getPrototypeOf(e);return e.options&&e.options!==i.options||(e.options=e.options?Object.create(e.options):{}),y(e.options,t),this},t}(),hi={},ui=function(t){return function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.registerJSONType=function(t){return t?(hi[t]=this,this):this},e.getJSONClass=function(t){return t?hi[t]:null},e.prototype.getJSONType=function(){if(void 0===this._jsonType){var t=Object.getPrototypeOf(this).constructor;for(var e in hi)if(hi[e]===t){this._jsonType=e;break}}if(!this._jsonType)throw new Error("Found an unregistered geometry class!");return this._jsonType},e}(t)},li=function(t){return function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addHandler=function(t,e){if(!e)return this;if(this._handlers||(this._handlers=[]),this[t])return this[t].enable(),this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},e.prototype.removeHandler=function(t){if(!t)return this;var e=this[t];if(e){var i=this._handlers.indexOf(e);i>=0&&this._handlers.splice(i,1),this[t].remove(),delete this[t]}return this},e.prototype._clearHandlers=function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].remove();this._handlers=[]},e}(t)},pi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ci={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},fi=function(t){function e(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,e);var n=f(this,t.call(this,null));return n.dom=i,n.options=r,n}return c(e,t),e.prototype.enable=function(){return this.dom?(this._onMouseDown=function(t){return this.onMouseDown(t)},Xe(this.dom,"touchstart mousedown",this._onMouseDown,this),this):this},e.prototype.disable=function(){return this.dom?(this._offEvents(),Ke(this.dom,"touchstart mousedown",this._onMouseDown),delete this._onMouseDown,this):this},e.prototype.onMouseDown=function(t){if((this.options.rightclick||2!==t.button)&&!(t.touches&&t.touches.length>1||this.options.cancelOn&&!0===this.options.cancelOn(t))){var e=this.dom;e.setCapture?e.setCapture():window.captureEvents&&window.captureEvents(window.Event.MOUSEMOVE|window.Event.MOUSEUP),e.ondragstart=function(){return!1},delete this.moved;var i=t.touches?t.touches[0]:t;this.startPos=new ae(i.clientX,i.clientY),Xe(document,pi[t.type],this.onMouseMove,this),Xe(document,ci[t.type],this.onMouseUp,this),this.options.ignoreMouseleave||Xe(this.dom,"mouseleave",this.onMouseUp,this),this.fire("mousedown",{domEvent:t,mousePos:new ae(i.clientX,i.clientY)})}},e.prototype.onMouseMove=function(t){if(t.touches&&t.touches.length>1)this.moved&&(this.interupted=!0,this.onMouseUp(t));else{var e=t.touches?t.touches[0]:t,i=new ae(e.clientX,e.clientY).sub(this.startPos);(i.x||i.y)&&(this.moved?this.fire("dragging",{domEvent:t,mousePos:new ae(e.clientX,e.clientY)}):(this.fire("dragstart",{domEvent:t,mousePos:this.startPos.copy()}),this.moved=!0))}},e.prototype.onMouseUp=function(t){var e=t.changedTouches?t.changedTouches[0]:t;this._offEvents();var i={domEvent:t};m(e.clientX)&&(i.mousePos=new ae(parseInt(e.clientX,0),parseInt(e.clientY,0))),this.moved&&(i.interupted=this.interupted,this.fire("dragend",i),delete this.interupted,delete this.moved),this.fire("mouseup",i)},e.prototype._offEvents=function(){var t=this.dom;if(Ke(t,"mouseleave",this.onMouseUp,this),"undefined"!=typeof document&&"undefined"!=typeof window){for(var e in pi)Ke(document,pi[e],this.onMouseMove,this),Ke(document,ci[e],this.onMouseUp,this);t.releaseCapture?t.releaseCapture():window.captureEvents&&window.captureEvents(window.Event.MOUSEMOVE|window.Event.MOUSEUP)}},e}(si),di=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.toNumberArrays=function(t){return Array.isArray(t)?H(t,function(t){return[t.x,t.y]}):[t.x,t.y]},e.toCoordinates=function(t){if(m(t[0])&&m(t[1]))return new e(t);for(var i=[],r=0,n=t.length;r<n;r++){var o=t[r];Array.isArray(o)?m(o[0])?i.push(new e(o)):i.push(e.toCoordinates(o)):i.push(new e(o))}return i},e}(se),yi=function(){function t(e,i){p(this,t),this.type=e,this.properties=i}return t.createProj4=function(e){return new t("proj4",{proj:e})},t.fromProjectionCode=function(e){return e&&t[e=e.toUpperCase().replace(":","")]||null},t}();yi.WGS84=yi.createProj4("+proj=longlat +datum=WGS84 +no_defs"),yi.EPSG4326=yi.WGS84,yi.EPSG3857=yi.createProj4("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"),yi.IDENTITY=yi.createProj4("+proj=identity +no_defs"),yi.CGCS2000=yi.createProj4("+proj=longlat +datum=CGCS2000"),yi.EPSG4490=yi.CGCS2000,yi.BD09LL=yi.createProj4("+proj=longlat +datum=BD09"),yi.GCJ02=yi.createProj4("+proj=longlat +datum=GCJ02");var gi,mi=function(){function t(e,i,r,n){p(this,t),this._clazz=di;var o=arguments.length,s=o>0?arguments[o-1]:null;s&&s.unproject&&(this.projection=arguments[o-1]),this._dirty=!0,this._initialize(e,i,r,n)}return t.prototype._initialize=function(t,e,i,r){if(this.xmin=null,this.xmax=null,this.ymin=null,this.ymax=null,!g(t)){var n=this.projection;m(t)&&m(e)&&m(i)&&m(r)?n?(this.xmin=t,this.ymin=e,this.xmax=i,this.ymax=r):(this.xmin=Math.min(t,i),this.ymin=Math.min(e,r),this.xmax=Math.max(t,i),this.ymax=Math.max(e,r)):Array.isArray(t)?n?(this.xmin=t[0],this.ymin=t[1],this.xmax=t[2],this.ymax=t[3]):(this.xmin=Math.min(t[0],t[2]),this.ymin=Math.min(t[1],t[3]),this.xmax=Math.max(t[0],t[2]),this.ymax=Math.max(t[1],t[3])):m(t.x)&&m(e.x)&&m(t.y)&&m(e.y)?n?(this.xmin=t.x,this.ymin=t.y,this.xmax=e.x,this.ymax=e.y):(t.x>e.x?(this.xmin=e.x,this.xmax=t.x):(this.xmin=t.x,this.xmax=e.x),t.y>e.y?(this.ymin=e.y,this.ymax=t.y):(this.ymin=t.y,this.ymax=e.y)):m(t.xmin)&&m(t.xmax)&&m(t.ymin)&&m(t.ymax)&&(this.xmin=t.xmin,this.ymin=t.ymin,this.xmax=t.xmax,this.ymax=t.ymax)}},t.prototype._add=function(t){return this._dirty=!0,g(t.x)?g(t.xmin)?g(t[0])||(this.xmin+=t[0],this.ymin+=t[1],this.xmax+=t[0],this.ymax+=t[1]):(this.xmin+=t.xmin,this.ymin+=t.ymin,this.xmax+=t.xmax,this.ymax+=t.ymax):(this.xmin+=t.x,this.ymin+=t.y,this.xmax+=t.x,this.ymax+=t.y),this},t.prototype.add=function(){var t=new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection);return t._add.apply(t,arguments)},t.prototype._sub=function(t){return this._dirty=!0,g(t.x)?g(t.xmin)?g(t[0])||(this.xmin-=t[0],this.ymin-=t[1],this.xmax-=t[0],this.ymax-=t[1]):(this.xmin-=t.xmin,this.ymin-=t.ymin,this.xmax-=t.xmax,this.ymax-=t.ymax):(this.xmin-=t.x,this.ymin-=t.y,this.xmax-=t.x,this.ymax-=t.y),this},t.prototype._substract=function(){return this._sub.apply(this,arguments)},t.prototype.sub=function(){var t=new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection);return t._sub.apply(t,arguments)},t.prototype.substract=function(){return this.sub.apply(this,arguments)},t.prototype.round=function(){return new this.constructor(Math.round(this.xmin),Math.round(this.ymin),Math.round(this.xmax),Math.round(this.ymax),this.projection)},t.prototype._round=function(){return this._dirty=!0,this.xmin=Math.round(this.xmin),this.ymin=Math.round(this.ymin),this.xmax=Math.round(this.xmax),this.ymax=Math.round(this.ymax),this},t.prototype.getMin=function(){return new this._clazz(this.xmin,this.ymin)},t.prototype.getMax=function(){return new this._clazz(this.xmax,this.ymax)},t.prototype.getCenter=function(){return new this._clazz((this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)},t.prototype.isValid=function(){return m(this.xmin)&&m(this.ymin)&&m(this.xmax)&&m(this.ymax)},t.prototype.equals=function(t){return this.xmin===t.xmin&&this.xmax===t.xmax&&this.ymin===t.ymin&&this.ymax===t.ymax},t.prototype.intersects=function(t){this._project(this),this._project(t);var e=Math.max(this.pxmin,t.pxmin),i=Math.max(this.pymin,t.pymin),r=Math.min(this.pxmax,t.pxmax),n=Math.min(this.pymax,t.pymax),o=!(e>r||i>n);return o},t.prototype.within=function(t){return this._project(this),this._project(t),this.pxmin>=t.pxmin&&this.pxmax<=t.pxmax&&this.pymin>=t.pymin&&this.pymax<=t.pymax},t.prototype.contains=function(t){if(!t)return!1;this._project(this);var e=this.projection;return Array.isArray(t)&&(t=new this._clazz(t)),e&&(t=e.project(t)),t.x>=this.pxmin&&t.x<=this.pxmax&&t.y>=this.pymin&&t.y<=this.pymax},t.prototype.getWidth=function(){return Math.abs(this.xmax-this.xmin)},t.prototype.getHeight=function(){return Math.abs(this.ymax-this.ymin)},t.prototype.getSize=function(){return new he(this.getWidth(),this.getHeight())},t.prototype.__combine=function(t){t instanceof this.constructor||(t=new this.constructor(t,t)),this._project(t),this._project(this);var e=this.pxmin;m(e)?m(t.pxmin)&&e>t.pxmin&&(e=t.pxmin):e=t.pxmin;var i=this.pxmax;m(i)?m(t.pxmax)&&i<t.pxmax&&(i=t.pxmax):i=t.pxmax;var r=this.pymin;m(r)?m(t.pymin)&&r>t.pymin&&(r=t.pymin):r=t.pymin;var n=this.pymax;m(n)?m(t.pymax)&&n<t.pymax&&(n=t.pymax):n=t.pymax;var o=this.projection;if(o){var s=o.unproject(new this._clazz(e,r)),a=o.unproject(new this._clazz(i,n));e=s.x,r=s.y,i=a.x,n=a.y}return[e,r,i,n]},t.prototype._combine=function(t){if(!t)return this;var e=this.__combine(t);return this.xmin=e[0],this.ymin=e[1],this.xmax=e[2],this.ymax=e[3],this._dirty=!0,this},t.prototype.combine=function(t){if(!t)return this;var e=this.__combine(t);return new this.constructor(e[0],e[1],e[2],e[3],this.projection)},t.prototype.intersection=function(t){if(!this.intersects(t))return null;var e=new this._clazz(Math.max(this.pxmin,t.pxmin),Math.max(this.pymin,t.pymin)),i=new this._clazz(Math.min(this.pxmax,t.pxmax),Math.min(this.pymax,t.pymax)),r=this.projection;return r&&(e=r.unproject(e),i=r.unproject(i)),new this.constructor(e,i,r)},t.prototype.expand=function(t){var e=void 0,i=void 0;return m(t)?e=i=t:(e=t.width||t.x||t[0]||0,i=t.height||t.y||t[1]||0),new this.constructor(this.xmin-e,this.ymin-i,this.xmax+e,this.ymax+i,this.projection)},t.prototype._expand=function(t){var e=void 0,i=void 0;return m(t)?e=i=t:(e=t.width||t.x||t[0]||0,i=t.height||t.y||t[1]||0),this.xmin-=e,this.ymin-=i,this.xmax+=e,this.ymax+=i,this._dirty=!0,this},t.prototype.toJSON=function(){return{xmin:this.xmin,ymin:this.ymin,xmax:this.xmax,ymax:this.ymax}},t.prototype.toArray=function(){var t=this.xmin,e=this.ymin,i=this.xmax,r=this.ymax;return[new this._clazz([t,r]),new this._clazz([i,r]),new this._clazz([i,e]),new this._clazz([t,e]),new this._clazz([t,r])]},t.prototype.toString=function(){return this.xmin+","+this.ymin+","+this.xmax+","+this.ymax},t.prototype.copy=function(){return new this.constructor(this.xmin,this.ymin,this.xmax,this.ymax,this.projection)},t.prototype.convertTo=function(t){if(!this.isValid())return null;var e=new this.constructor,i=new this._clazz(this.xmin,this.ymax);return e._combine(t(i)),i.x=this.xmax,e._combine(t(i)),i.y=this.ymin,e._combine(t(i)),i.x=this.xmin,e._combine(t(i)),e},t.prototype._project=function(t){if(t&&t.isValid()){var e=this.projection;if(e){if(t._dirty){var i=[t.getMin(),t.getMax()],r=(i=e.projectCoords(i))[0],n=i[1];t.pxmin=Math.min(r.x,n.x),t.pymin=Math.min(r.y,n.y),t.pxmax=Math.max(r.x,n.x),t.pymax=Math.max(r.y,n.y)}delete t._dirty}else t.pxmin=t.xmin,t.pxmax=t.xmax,t.pymin=t.ymin,t.pymax=t.ymax}},t}(),_i=function(t){function e(i,r,n,o){p(this,e);var s=f(this,t.call(this,i,r,n,o));return s._clazz=ae,s}return c(e,t),e}(mi),vi=function(){function t(e){p(this,t),this.matrix=e}return t.prototype.transform=function(t,e){return new ae(this.matrix[0]*(t.x-this.matrix[2])/e,this.matrix[1]*(t.y-this.matrix[3])/e)},t.prototype.untransform=function(t,e){return new di(t.x*e/this.matrix[0]+this.matrix[2],t.y*e/this.matrix[1]+this.matrix[3])},t}(),xi={project:function(){},unproject:function(){},projectCoords:function(t){var e=this;if(!t)return[];if(!Array.isArray(t))return this.project(t);if(0===t.length)return[];if(!this.isSphere())return H(t,this.project,this);if(Array.isArray(t[0]))return t.map(function(t){return e.projectCoords(t)});for(var i=this.getCircum(),r=this.getSphereExtent(),n=r.sx,o=r.sy,s=void 0,a=void 0,h=t[0],u=void 0,l=void 0,p=void 0,c=void 0,f=[this.project(h)],d=1,y=t.length;d<y;d++)l=(u=t[d]).x-h.x,p=u.y-h.y,c=this.project(u),Math.abs(l)>180&&(void 0===s&&(s=u.x<h.x),s&&(c._add(-i.x*G(l)*n,0),u._add(-360*G(l),0))),Math.abs(p)>90&&(void 0===a&&(a=u.y<h.y),a&&(c._add(0,-i.y*G(p)*o),u._add(0,-180*G(p)))),h=u,f.push(c);return f},unprojectCoords:function(t){return t?Array.isArray(t)?H(t,this.unproject,this):this.unproject(t):[]},isSphere:function(){return!!this.sphere},isOutSphere:function(t){return!!this.isSphere()&&!this.getSphereExtent().contains(t)},wrapCoord:function(t){if(!this.isSphere())return t;var e=this.getSphereExtent(),i=new di(t);return e.contains(i)||(i.x=N(t.x,e.xmin,e.xmax),i.y=N(t.y,e.ymin,e.ymax)),i},getCircum:function(){if(!this.circum&&this.isSphere()){var t=this.getSphereExtent();this.circum={x:t.getWidth(),y:t.getHeight()}}return this.circum},getSphereExtent:function(){if(!this.extent&&this.isSphere()){var t=this.project(new di(180,90)),e=this.project(new di(-180,-90));this.extent=new mi(e,t,this),this.extent.sx=t.x>e.x?1:-1,this.extent.sy=t.y>e.y?1:-1}return this.extent}},wi={measureLength:function(t,e){if(!Array.isArray(t))return this.measureLenBetween(t,e);for(var i=0,r=0,n=t.length;r<n-1;r++)i+=this.measureLenBetween(t[r],t[r+1]);return i}},bi=y({measure:"IDENTITY",measureLenBetween:function(t,e){if(!t||!e)return 0;try{return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}catch(t){return 0}},measureArea:function(t){if(!Array.isArray(t))return 0;for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i],o=null;o=i===r-1?t[0]:t[i+1],e+=n.x*o.y-n.y*o.x}return Math.abs(e/2)},locate:function(t,e,i){return t=new di(t.x,t.y),this._locate(t,e,i)},_locate:function(t,e,i){return t?(e||(e=0),i||(i=0),e||i?(t.x=t.x+e,t.y=t.y+i,t):t):null},rotate:function(t,e,i){return t=new di(t.x,t.y),this._rotate(t,e,i)},_rotate:(gi=new ae(0,0),function(t,e,i){return gi.x=t.x-e.x,gi.y=t.y-e.y,gi._rotate(i*Math.PI/180),t._add(gi.x,gi.y)})},wi),Ci=function(){function t(e){p(this,t),this.radius=e}return t.prototype.measureLenBetween=function(t,e){if(!t||!e)return 0;var i=M(t.y),r=M(e.y),n=i-r,o=M(t.x)-M(e.x);return i=2*Math.asin(Math.sqrt(Math.pow(Math.sin(n/2),2)+Math.cos(i)*Math.cos(r)*Math.pow(Math.sin(o/2),2))),i*=this.radius,Math.round(1e5*i)/1e5},t.prototype.measureArea=function(t){var e=M(this.radius),i=0,r=t,n=r.length;if(n<3)return 0;var o=void 0;for(o=0;o<n-1;o++){var s=r[o],a=r[o+1];i+=s.x*e*Math.cos(M(s.y))*a.y*e-a.x*e*Math.cos(M(a.y))*s.y*e}return n=r[o],r=r[0],i+=n.x*e*Math.cos(M(n.y))*r.y*e-r.x*e*Math.cos(M(r.y))*n.y*e,.5*Math.abs(i)},t.prototype.locate=function(t,e,i){return t=new di(t.x,t.y),this._locate(t,e,i)},t.prototype._locate=function(t,e,i){if(!t)return null;if(e||(e=0),i||(i=0),!e&&!i)return t;var r=void 0,n=void 0,o=M(t.y);if(0!==i){var s=Math.abs(i);n=N(180*(o+=2*Math.sin(s/(2*this.radius))*(i>0?1:-1))/Math.PI,-90,90)}else n=t.y;if(0!==e){var a=Math.abs(e),h=M(t.x);r=N(180*(h+=2*Math.sqrt(Math.pow(Math.sin(a/(2*this.radius)),2)/Math.pow(Math.cos(o),2))*(e>0?1:-1))/Math.PI,-180,180)}else r=t.x;return t.x=r,t.y=n,t},t.prototype.rotate=function(t,e,i){return t=new di(t),this._rotate(t,e,i)},t.prototype._rotate=function(t,e,i){var r=function(t,e){var i=void 0;i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).final?Pi(e,t):Pi(t,e);return i>180?-(360-i):i}(e,t)-i,n=this.measureLenBetween(e,t);return t.x=e.x,t.y=e.y,function(t,e,i,r){var n=e/r,o=t.x*Math.PI/180,s=M(t.y),a=M(i),h=n*Math.cos(a),u=s+h;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var l=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(s/2+Math.PI/4)),p=Math.abs(l)>1e-11?h/l:Math.cos(s),c=n*Math.sin(a)/p,f=o+c;return t.x=(180*f/Math.PI+540)%360-180,t.y=180*u/Math.PI,t}(t,n,r,this.radius)},t}();function Pi(t,e){var i=M(t.y),r=M(e.y),n=M(e.x-t.x);n>Math.PI&&(n-=2*Math.PI),n<-Math.PI&&(n+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(i/2+Math.PI/4));return(T(Math.atan2(n,o))+360)%360}var Mi=y({measure:"EPSG:4326",sphere:new Ci(6378137),measureLenBetween:function(){return this.sphere.measureLenBetween.apply(this.sphere,arguments)},measureArea:function(){return this.sphere.measureArea.apply(this.sphere,arguments)},_locate:function(){return this.sphere._locate.apply(this.sphere,arguments)},locate:function(){return this.sphere.locate.apply(this.sphere,arguments)},_rotate:function(){return this.sphere._rotate.apply(this.sphere,arguments)},rotate:function(){return this.sphere.rotate.apply(this.sphere,arguments)}},wi),Ti=y({measure:"BAIDU",sphere:new Ci(6370996.81),measureLenBetween:function(){return this.sphere.measureLenBetween.apply(this.sphere,arguments)},measureArea:function(){return this.sphere.measureArea.apply(this.sphere,arguments)},_locate:function(){return this.sphere._locate.apply(this.sphere,arguments)},locate:function(){return this.sphere.locate.apply(this.sphere,arguments)},_rotate:function(){return this.sphere._rotate.apply(this.sphere,arguments)},rotate:function(){return this.sphere.rotate.apply(this.sphere,arguments)}},wi),Si=Mi,Oi={};function Ei(t){Oi[t.measure]=t}Ei(bi),Ei(Mi),Ei(Ti);var ki={getInstance:function(t){if(!t)return Si;for(var e in Oi)if(C(Oi,e)){var i=Oi[e].measure;if(!i)continue;if(t.toLowerCase()===i.toLowerCase())return Oi[e]}return null}},Li=(Object.freeze({Identity:bi,DEFAULT:Si,Measurer:ki,WGS84Sphere:Mi,BaiduSphere:Ti}),y({},xi,{code:"EPSG:3857",rad:Math.PI/180,metersPerDegree:6378137*Math.PI/180,maxLatitude:85.0511287798,project:function(t){var e=this.rad,i=this.metersPerDegree,r=this.maxLatitude,n=t.x,o=Math.max(Math.min(r,t.y),-r),s=void 0;return s=0===o?0:Math.log(Math.tan((90+o)*e/2))/e,new di(n*i,s*i)},unproject:function(t){var e=t.x,i=t.y,r=this.rad,n=this.metersPerDegree,o=void 0;return 0===i?o=0:(o=i/n,o=(2*Math.atan(Math.exp(o*r))-Math.PI/2)/r),new di(N(e/n,-180,180),N(o,-this.maxLatitude,this.maxLatitude))}},Mi)),Ai=y({},xi,{code:"EPSG:4326",project:function(t){return new di(t)},unproject:function(t){return new di(t)}},Mi),Ri=y({},Ai,{code:"EPSG:4490"}),ji=y({},xi,{code:"BAIDU",project:function(t){return this.convertLL2MC(t)},unproject:function(t){return this.convertMC2LL(t)}},Ti,{EARTHRADIUS:6370996.81,MCBAND:[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],LLBAND:[75,60,45,30,15,0],MC2LL:[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],LL2MC:[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],convertMC2LL:function(t){Math.abs(t.x);for(var e=Math.abs(t.y),i=void 0,r=0,n=this.MCBAND.length;r<n;r++)if(e>=this.MCBAND[r]){i=this.MC2LL[r];break}var o=this.convertor(t,i);return new di(o.x,o.y)},convertLL2MC:function(t){var e,i=void 0,r=void 0;t.x=this.getLoop(t.x,-180,180),t.y=this.getRange(t.y,-74,74);var n=new di(t.x,t.y);for(r=0,e=this.LLBAND.length;r<e;r++)if(n.y>=this.LLBAND[r]){i=this.LL2MC[r];break}if(!i)for(r=this.LLBAND.length-1;r>=0;r--)if(n.y<=-this.LLBAND[r]){i=this.LL2MC[r];break}var o=this.convertor(t,i);return new di(o.x,o.y)},convertor:function(t,e){if(!t||!e)return null;var i=e[0]+e[1]*Math.abs(t.x),r=Math.abs(t.y)/e[9],n=e[2]+e[3]*r+e[4]*r*r+e[5]*r*r*r+e[6]*r*r*r*r+e[7]*r*r*r*r*r+e[8]*r*r*r*r*r*r;return i*=t.x<0?-1:1,n*=t.y<0?-1:1,new di(i,n)},toRadians:function(t){return Math.PI*t/180},toDegrees:function(t){return 180*t/Math.PI},getRange:function(t,e,i){return null!=e&&(t=Math.max(t,e)),null!=i&&(t=Math.min(t,i)),t},getLoop:function(t,e,i){for(;t>i;)t-=i-e;for(;t<e;)t+=i-e;return t}}),Di=y({},xi,{code:"IDENTITY",project:function(t){return t.copy()},unproject:function(t){return t.copy()}},bi),Ii=Li,zi=Object.freeze({EPSG3857:Li,DEFAULT:Ii,EPSG4326:Ai,EPSG4490:Ri,BAIDU:ji,IDENTITY:Di,Common:xi}),Hi=function(t){return function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.registerRenderer=function(t,e){var i=this.prototype,r=Object.getPrototypeOf(i);return i._rendererClasses&&i._rendererClasses!==r._rendererClasses||(i._rendererClasses=i._rendererClasses?Object.create(i._rendererClasses):{}),i._rendererClasses[t.toLowerCase()]=e,this},e.getRendererClass=function(t){var e=this.prototype;return e._rendererClasses?e._rendererClasses[t.toLowerCase()]:null},e}(t)},Zi="undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:{};function Gi(t,e){return t(e={exports:{}},e.exports),e.exports}var Fi=Gi(function(t){!function(e){function i(t){if(t){var e=this;t(function(t){e.resolve(t)},function(t){e.reject(t)})}}function r(t,e){if("function"==typeof t.y)try{var i=t.y.call(s,e);t.p.resolve(i)}catch(e){t.p.reject(e)}else t.p.resolve(e)}function n(t,e){if("function"==typeof t.n)try{var i=t.n.call(s,e);t.p.resolve(i)}catch(e){t.p.reject(e)}else t.p.reject(e)}var o,s,a="fulfilled",h="undefined",u=function(){function t(){for(;i.length-r;){try{i[r]()}catch(t){e.console&&e.console.error(t)}i[r++]=s,r==n&&(i.splice(0,n),r=0)}}var i=[],r=0,n=1024,o=function(){if(("undefined"==typeof MutationObserver?"undefined":l(MutationObserver))!==h){var e=document.createElement("div");return new MutationObserver(t).observe(e,{attributes:!0}),function(){e.setAttribute("a",0)}}return("undefined"==typeof setImmediate?"undefined":l(setImmediate))!==h?function(){setImmediate(t)}:function(){setTimeout(t,0)}}();return function(t){i.push(t),i.length-r==1&&o()}}();i.prototype={resolve:function(t){if(this.state===o){if(t===this)return this.reject(new TypeError("Attempt to resolve promise with self"));var e=this;if(t&&("function"==typeof t||"object"==(void 0===t?"undefined":l(t))))try{var i=!0,n=t.then;if("function"==typeof n)return void n.call(t,function(t){i&&(i=!1,e.resolve(t))},function(t){i&&(i=!1,e.reject(t))})}catch(t){return void(i&&this.reject(t))}this.state=a,this.v=t,e.c&&u(function(){for(var i=0,n=e.c.length;n>i;i++)r(e.c[i],t)})}},reject:function(t){if(this.state===o){this.state="rejected",this.v=t;var r=this.c;r?u(function(){for(var e=0,i=r.length;i>e;e++)n(r[e],t)}):!i.suppressUncaughtRejectionError&&e.console&&e.console.log("You upset Zousan. Please catch rejections: ",t,t?t.stack:null)}},then:function(t,e){var s=new i,h={y:t,n:e,p:s};if(this.state===o)this.c?this.c.push(h):this.c=[h];else{var l=this.state,p=this.v;u(function(){l===a?r(h,p):n(h,p)})}return s},catch:function(t){return this.then(null,t)},finally:function(t){return this.then(t,t)},timeout:function(t,e){e=e||"Timeout";var r=this;return new i(function(i,n){setTimeout(function(){n(Error(e))},t),r.then(function(t){i(t)},function(t){n(t)})})}},i.resolve=function(t){var e=new i;return e.resolve(t),e},i.reject=function(t){var e=new i;return e.reject(t),e},i.all=function(t){function e(e,s){e&&"function"==typeof e.then||(e=i.resolve(e)),e.then(function(e){r[s]=e,++n==t.length&&o.resolve(r)},function(t){o.reject(t)})}for(var r=[],n=0,o=new i,s=0;s<t.length;s++)e(t[s],s);return t.length||o.resolve(r),o},t.exports&&(t.exports=i),e.define&&e.define.amd&&e.define([],function(){return i}),e.Zousan=i,i.soon=u}(Zi)}),Wi="undefined"!=typeof Promise?Promise:Fi,Ni=function(t){function e(i){p(this,e);var r=f(this,t.call(this));return r.layer=i,r._painted=!1,r._drawTime=0,r.setToRedraw(),r}return c(e,t),e.prototype.render=function(t){var e=this;if(this.prepareRender(),this.getMap()&&this.layer.isVisible())if(this.resources||(this.resources=new Bi),this.checkResources){var i=this.checkResources();i.length>0?(this._loadingResource=!0,this.loadResources(i).then(function(){e._loadingResource=!1,e.layer&&(e.layer.fire("resourceload"),e.setToRedraw())})):this._tryToDraw(t)}else this._tryToDraw(t)},e.prototype.testIfNeedRedraw=function(){var t=this.getMap();return!this._loadingResource&&(!!this._toRedraw||!(t.isInteracting()&&!this.drawOnInteracting)&&!!this.needToRedraw())},e.prototype.needToRedraw=function(){var t=this.getMap();return!!t.isInteracting()&&!(!t.getPitch()&&t.isMoving()&&!t.isZooming()&&!t.isRotating()&&!this.layer.options.forceRenderOnMoving)},e.prototype.onSkipDrawOnInteracting=function(){},e.prototype.isRenderComplete=function(){return!!this._renderComplete},e.prototype.mustRenderOnInteracting=function(){return!this._painted||this.checkResources&&this.checkResources().length>0},e.prototype.setToRedraw=function(){return this._toRedraw=!0,this},e.prototype.setCanvasUpdated=function(){return this._canvasUpdated=!0,this},e.prototype.isCanvasUpdated=function(){return!!this._canvasUpdated},e.prototype.remove=function(){this.onRemove(),delete this._loadingResource,delete this.southWest,delete this.canvas,delete this.context,delete this.canvasExtent2D,delete this._extent2D,delete this.resources,delete this.layer},e.prototype.onRemove=function(){},e.prototype.onAdd=function(){},e.prototype.getMap=function(){return this.layer?this.layer.getMap():null},e.prototype.getCanvasImage=function(){var t=this.getMap();if(this._canvasUpdated=!1,this._renderZoom!==t.getZoom()||!this.canvas||!this._extent2D)return null;if(this.isBlank())return null;if(this.layer.isEmpty&&this.layer.isEmpty())return null;var e=t._pointToContainerPoint(this.southWest)._add(0,-t.height);return{image:this.canvas,layer:this.layer,point:e}},e.prototype.clear=function(){this.clearCanvas()},e.prototype.isBlank=function(){return!this._painted},e.prototype.show=function(){this.setToRedraw()},e.prototype.hide=function(){this.clear(),this.setToRedraw()},e.prototype.setZIndex=function(){this.setToRedraw()},e.prototype.hitDetect=function(t){if(!this.context||this.layer.isEmpty&&this.layer.isEmpty()||this.isBlank()||this._errorThrown)return!1;var e=this.getMap(),i=oe.retina?2:1,r=e.getSize();if(t.x<0||t.x>r.width*i||t.y<0||t.y>r.height*i)return!1;try{if(this.context.getImageData(i*t.x,i*t.y,1,1).data[3]>0)return!0}catch(t){return this._errorThrown||(console&&console.warn("hit detect failed with tainted canvas, some geometries have external resources in another domain:\n",t),this._errorThrown=!0),!1}return!1},e.prototype.loadResources=function(t){this.resources||(this.resources=new Bi);var e=this.resources,i=[];if(V(t))for(var r={},n=t.length-1;n>=0;n--){var o=t[n];o&&o.length&&!r[o.join("-")]&&(r[o.join("-")]=1,e.isResourceLoaded(o,!0)||i.push(new Wi(this._promiseResource(o))))}return Wi.all(i)},e.prototype.prepareRender=function(){delete this._renderComplete;var t=this.getMap();this._renderZoom=t.getZoom(),this.canvasExtent2D=this._extent2D=t._get2DExtent(),this.southWest=t._containerPointToPoint(new ae(0,t.height))},e.prototype.createCanvas=function(){if(!this.canvas){var t=this.getMap(),e=t.getSize(),i=oe.retina?2:1,r=i*e.width,n=i*e.height;if(this.layer._canvas){var o=this.layer._canvas;o.width=r,o.height=n,o.style&&(o.style.width=e.width+"px",o.style.height=e.height+"px"),this.canvas=this.layer._canvas}else this.canvas=ti.createCanvas(r,n,t.CanvasClass);this.onCanvasCreate()}},e.prototype.onCanvasCreate=function(){},e.prototype.createContext=function(){if(!(this.gl&&this.gl.canvas===this.canvas||this.context)&&(this.context=this.canvas.getContext("2d"),this.layer.options.globalCompositeOperation&&(this.context.globalCompositeOperation=this.layer.options.globalCompositeOperation),oe.retina)){this.context.scale(2,2)}},e.prototype.resetCanvasTransform=function(){if(this.context){var t=oe.retina?2:1;this.context.setTransform(t,0,0,t,0,0)}},e.prototype.resizeCanvas=function(t){var e=this.canvas;if(e){var i=t||this.getMap().getSize(),r=oe.retina?2:1;e.width===r*i.width&&e.height===r*i.height||(e.height=r*i.height,e.width=r*i.width,oe.retina&&this.context&&this.context.scale(r,r),this.layer._canvas&&e.style&&(e.style.width=i.width+"px",e.style.height=i.height+"px"))}},e.prototype.clearCanvas=function(){this.context&&ti.clearRect(this.context,0,0,this.canvas.width,this.canvas.height)},e.prototype.prepareCanvas=function(){this.canvas?(this.clearCanvas(),this.resizeCanvas(),this.resetCanvasTransform()):(this.createCanvas(),this.createContext(),this.layer.fire("canvascreate",{context:this.context,gl:this.gl})),delete this._maskExtent;var t=this.layer.getMask();if(!t)return this.layer.fire("renderstart",{context:this.context,gl:this.gl}),null;var e=this._maskExtent=t._getPainter().get2DExtent();return e.intersects(this._extent2D),this.layer.fire("renderstart",{context:this.context,gl:this.gl}),e},e.prototype.clipCanvas=function(t){var e=this.layer.getMask();if(!e)return!1;var i=this.southWest,r=this.getMap();return this.southWest=r._containerPointToPoint(new ae(0,r.height)),t.save(),oe.retina&&(t.save(),t.scale(2,2)),e._getPainter().paint(null,t),oe.retina&&t.restore(),t.clip(),this.southWest=i,!0},e.prototype.getViewExtent=function(){return{extent:this._extent2D,maskExtent:this._maskExtent,zoom:this._renderZoom,southWest:this.southWest}},e.prototype.completeRender=function(){this.getMap()&&(this._renderComplete=!0,this.layer.fire("renderend",{context:this.context,gl:this.gl}),this.setCanvasUpdated())},e.prototype.getEvents=function(){return{_zoomstart:this.onZoomStart,_zooming:this.onZooming,_zoomend:this.onZoomEnd,_resize:this.onResize,_movestart:this.onMoveStart,_moving:this.onMoving,_moveend:this.onMoveEnd,_dragrotatestart:this.onDragRotateStart,_dragrotating:this.onDragRotating,_dragrotateend:this.onDragRotateEnd,_spatialreferencechange:this.onSpatialReferenceChange}},e.prototype.onZoomStart=function(){},e.prototype.onZoomEnd=function(){this.setToRedraw()},e.prototype.onZooming=function(){},e.prototype.onMoveStart=function(){},e.prototype.onMoving=function(){},e.prototype.onMoveEnd=function(){this.setToRedraw()},e.prototype.onResize=function(){delete this._extent2D,this.resizeCanvas(),this.setToRedraw()},e.prototype.onDragRotateStart=function(){},e.prototype.onDragRotating=function(){},e.prototype.onDragRotateEnd=function(){this.setToRedraw()},e.prototype.onSpatialReferenceChange=function(){},e.prototype.getDrawTime=function(){return this._drawTime},e.prototype._tryToDraw=function(t){this._toRedraw=!1,!this.canvas&&this.layer.isEmpty&&this.layer.isEmpty()?this._renderComplete=!0:this._drawAndRecord(t)},e.prototype._drawAndRecord=function(t){if(this.getMap()){var e=this._painted;this._painted=!0;var i=d();this.draw(t),i=d()-i,this._drawTime=e?i:i/2,e&&this.layer.options.logDrawTime&&console.log(this.layer.getId(),"frameTimeStamp:",t,"drawTime:",this._drawTime)}},e.prototype._promiseResource=function(t){var e=this,i=this.resources,r=this.layer.options.crossOrigin;return function(n){if(i.isResourceLoaded(t,!0))n(t);else{var o=new Image;g(r)||(o.crossOrigin=r),k(t[0])&&!S&&(t[1]&&(t[1]*=2),t[2]&&(t[2]*=2)),o.onload=function(){e._cacheResource(t,o),n(t)},o.onabort=function(e){console&&console.warn("image loading aborted: "+t[0]),e&&console&&console.warn(e),n(t)},o.onerror=function(e){e&&"undefined"!=typeof console&&console.warn(e),i.markErrorResource(t),n(t)},L(o,t)}}},e.prototype._cacheResource=function(t,e){if(this.layer&&this.resources){var i=t[1],r=t[2];if(this.layer.options.cacheSvgOnCanvas&&1===k(t[0])&&(oe.edge||oe.ie)){g(i)&&(i=e.width||this.layer.options.defaultIconSize[0]),g(r)&&(r=e.height||this.layer.options.defaultIconSize[1]);var n=ti.createCanvas(i,r);ti.image(n.getContext("2d"),e,0,0,i,r),e=n}this.resources.addResource(t,e)}},e}(ai),Bi=function(){function t(){p(this,t),this.resources={},this._errors={}}return t.prototype.addResource=function(t,e){this.resources[t[0]]={image:e,width:+t[1],height:+t[2]}},t.prototype.isResourceLoaded=function(t,e){if(!t)return!1;var i=this._getImgUrl(t);if(this._errors[i])return!0;var r=this.resources[i];return!!r&&!(e&&k(t[0])&&(+t[1]>r.width||+t[2]>r.height))},t.prototype.getImage=function(t){var e=this._getImgUrl(t);return!this.isResourceLoaded(t)||this._errors[e]?null:this.resources[e].image},t.prototype.markErrorResource=function(t){this._errors[this._getImgUrl(t)]=1},t.prototype.merge=function(t){if(!t)return this;for(var e in t.resources){var i=t.resources[e];this.addResource([e,i.width,i.height],i.image)}return this},t.prototype.forEach=function(t){if(!this.resources)return this;for(var e in this.resources)C(this.resources,e)&&t(e,this.resources[e]);return this},t.prototype._getImgUrl=function(t){return Array.isArray(t)?t[0]:t},t}(),Vi=function(t){function e(i,r){p(this,e);var n=void 0;r&&(n=r.canvas,delete r.canvas);var o=f(this,t.call(this,r));return n&&(o._canvas=n),o.setId(i),r&&o.setZIndex(r.zIndex),o}return c(e,t),e.prototype.load=function(){if(!this.getMap())return this;if(this.onLoad()){this._initRenderer();var t=this.getZIndex();g(t)||(this._renderer.setZIndex(t),this.isCanvasRender()||this._renderer.render()),this.onLoadEnd()}return this},e.prototype.getId=function(){return this._id},e.prototype.setId=function(t){var e=this._id;return g(t)||(t+=""),this._id=t,this.fire("idchange",{old:e,new:t}),this},e.prototype.addTo=function(t){return t.addLayer(this),this},e.prototype.setZIndex=function(t){return this._zIndex=t,this.map&&this.map._sortLayersByZIndex(),this._renderer&&this._renderer.setZIndex(t),this},e.prototype.getZIndex=function(){return this._zIndex||0},e.prototype.getMinZoom=function(){var t=this.getMap(),e=this.options.minZoom;return t?Math.max(t.getMinZoom(),e||0):e},e.prototype.getMaxZoom=function(){var t=this.getMap(),e=this.options.maxZoom;return t?Math.min(t.getMaxZoom(),g(e)?1/0:e):e},e.prototype.getOpacity=function(){return this.options.opacity},e.prototype.setOpacity=function(t){return this.config("opacity",t),this},e.prototype.isCanvasRender=function(){var t=this._getRenderer();return t&&t instanceof Ni},e.prototype.getMap=function(){return this.map?this.map:null},e.prototype.getProjection=function(){var t=this.getMap();return t?t.getProjection():null},e.prototype.bringToFront=function(){var t=this._getLayerList();if(!t.length)return this;var e=t[t.length-1];if(1===t.length||e===this)return this;var i=e.getZIndex();return this.setZIndex(i+1),this},e.prototype.bringToBack=function(){var t=this._getLayerList();if(!t.length)return this;var e=t[0];if(1===t.length||e===this)return this;var i=e.getZIndex();return this.setZIndex(i-1),this},e.prototype.show=function(){var t=this;if(!this.options.visible){this.options.visible=!0;var e=this.getRenderer();e&&e.show();var i=this.getMap();e&&i?i.once("renderend",function(){t.fire("show")}):this.fire("show")}return this},e.prototype.hide=function(){var t=this;if(this.options.visible){this.options.visible=!1;var e=this.getRenderer();e&&e.hide();var i=this.getMap();e&&i?i.once("renderend",function(){t.fire("hide")}):this.fire("hide")}return this},e.prototype.isVisible=function(){if(m(this.options.opacity)&&this.options.opacity<=0)return!1;var t=this.getMap();if(t){var e=t.getZoom();if(!g(this.options.maxZoom)&&this.options.maxZoom<e||!g(this.options.minZoom)&&this.options.minZoom>e)return!1}return g(this.options.visible)&&(this.options.visible=!0),this.options.visible},e.prototype.remove=function(){return this.map&&this.map.removeLayer(this),this},e.prototype.getMask=function(){return this._mask},e.prototype.setMask=function(t){if(!("Point"===t.type&&t._isVectorMarker()||"Polygon"===t.type))throw new Error("Mask for a layer must be a marker with vector marker symbol or a Polygon.");if("Point"===t.type?t.updateSymbol({markerLineColor:"rgba(0, 0, 0, 0)",markerFillOpacity:0}):t.setSymbol({lineColor:"rgba(0, 0, 0, 0)",polygonOpacity:0}),t._bindLayer(this),this._mask=t,!this.getMap()||this.getMap().isZooming())return this;var e=this._getRenderer();return e&&e.setToRedraw&&this._getRenderer().setToRedraw(),this},e.prototype.removeMask=function(){if(delete this._mask,!this.getMap()||this.getMap().isZooming())return this;var t=this._getRenderer();return t&&t.setToRedraw&&this._getRenderer().setToRedraw(),this},e.prototype.onLoad=function(){return!0},e.prototype.onLoadEnd=function(){},e.prototype.isLoaded=function(){return!!this._loaded},e.prototype.getRenderer=function(){return this._getRenderer()},e.prototype.onConfig=function(t){if(m(t.opacity)||t.cssFilter){var e=this.getRenderer();e&&e.setToRedraw()}},e.prototype.onAdd=function(){},e.prototype.onRemove=function(){},e.prototype._bindMap=function(t,e){t&&(this.map=t,g(e)||this.setZIndex(e),this._switchEvents("on",this),this.onAdd(),this.fire("add"))},e.prototype._initRenderer=function(){var t=this.options.renderer;if(this.constructor.getRendererClass){var e=this.constructor.getRendererClass(t);if(!e)throw new Error("Invalid renderer for Layer("+this.getId()+"):"+t);this._renderer=new e(this),this._renderer.layer=this,this._renderer.setZIndex(this.getZIndex()),this._switchEvents("on",this._renderer),this._renderer.onAdd&&this._renderer.onAdd(),this.fire("renderercreate",{renderer:this._renderer})}},e.prototype._doRemove=function(){this._loaded=!1,this.onRemove(),this._switchEvents("off",this),this._renderer&&(this._switchEvents("off",this._renderer),this._renderer.remove(),delete this._renderer),delete this._mask,delete this.map},e.prototype._switchEvents=function(t,e){e&&e.getEvents&&this.getMap()[t](e.getEvents(),e)},e.prototype._getRenderer=function(){return this._renderer},e.prototype._getLayerList=function(){return this.map?this.map._layers:[]},e.prototype._getMask2DExtent=function(){if(!this._mask||!this.getMap())return null;var t=this._mask._getPainter();return t?t.get2DExtent():null},e}(ui(oi(Hi(ai))));Vi.mergeOptions({attribution:null,minZoom:null,maxZoom:null,visible:!0,opacity:1,globalCompositeOperation:null,renderer:"canvas",debugOutline:"#0f0",cssFilter:null,forceRenderOnMoving:!1,forceRenderOnZooming:!1,forceRenderOnRotating:!1});var Ui=Vi.prototype.fire;Vi.prototype.fire=function(t,e){return"layerload"===t&&(this._loaded=!0),this.map&&(e||(e={}),e.type=t,e.target=this,this.map._onLayerEvent(e)),Ui.apply(this,arguments)};var Ji={"EPSG:3857":{resolutions:function(){for(var t=[],e=12756274*Math.PI,i=0;i<21;i++)t[i]=e/(256*Math.pow(2,i));return t}(),fullExtent:{top:6378137*Math.PI,left:-6378137*Math.PI,bottom:-6378137*Math.PI,right:6378137*Math.PI}},"EPSG:4326":{fullExtent:{top:90,left:-180,bottom:-90,right:180},resolutions:function(){for(var t=[],e=0;e<20;e++)t[e]=180/(128*Math.pow(2,e));return t}()},BAIDU:{resolutions:function(){for(var t=Math.pow(2,18),e=[],i=0;i<20;i++)e[i]=t,t*=.5;return e[0]=null,e[1]=null,e[2]=null,e}(),fullExtent:{top:33554432,left:-33554432,bottom:-33554432,right:33554432}},IDENTITY:{resolutions:function(){for(var t=Math.pow(2,8),e=[],i=0;i<18;i++)e[i]=t,t*=.5;return e}(),fullExtent:{top:2e5,left:-2e5,bottom:-2e5,right:2e5}}};Ji["EPSG:4490"]=Ji["EPSG:4326"];var qi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p(this,t),this.options=e,this._initSpatialRef()}return t.getProjectionInstance=function(t){if(!t)return null;if(v(t))return t;for(var e in t=(t+"").toLowerCase(),zi)if(C(zi,e)){var i=zi[e].code;if(i&&i.toLowerCase()===t)return zi[e]}return null},t.equals=function(t,e){if(!t&&!e)return!0;if(!t||!e)return!1;if(t.projection!==e.projection)return!1;var i=t.fullExtent,r=e.fullExtent;if(i&&r&&(i.top!==r.top||i.bottom!==r.bottom||i.left!==r.left||i.right!==r.right))return!1;var n=t.resolutions,o=e.resolutions;if(n&&o){if(n.length!==o.length)return!1;for(var s=0;s<n.length;s++)if(n[s]!==o[s])return!1}return!0},t.prototype._initSpatialRef=function(){var e=this.options.projection;if(!(e=e?t.getProjectionInstance(e):Ii))throw new Error("must provide a valid projection in map's spatial reference.");(e=y({},xi,e)).measureLength||y(e,ki.DEFAULT),this._projection=e;var i=void 0,r=this.options.resolutions;if(!r&&(e.code&&(i=Ji[e.code])&&(r=i.resolutions),!r))throw new Error("must provide valid resolutions in map's spatial reference.");this._resolutions=r;var n=this.options.fullExtent;if(!n&&(e.code&&(i=Ji[e.code])&&(n=i.fullExtent),!n))throw new Error("must provide a valid fullExtent in map's spatial reference.");if(g(n.left)?(this._fullExtent=new mi(n),n.left=n.xmin,n.right=n.xmax,n.top=n.ymax,n.bottom=n.ymin):this._fullExtent=new mi(new di(n.left,n.top),new di(n.right,n.bottom)),g(n.top)||g(n.bottom)||g(n.left)||g(n.right))throw new Error("must provide valid top/bottom/left/right in fullExtent.");y(this._fullExtent,n),this._projection.fullExtent=n;var o=n.right>=n.left?1:-1,s=n.top>=n.bottom?-1:1;this._transformation=new vi([o,s,0,0])},t.prototype.getResolutions=function(){return this._resolutions||[]},t.prototype.getResolution=function(t){var e=0|t;e<0?e=0:e>this._resolutions.length-1&&(e=this._resolutions.length-1);var i=this._resolutions[e];return _(t)||e===this._resolutions.length-1?i:i+(this._resolutions[e+1]-i)*(t-e)},t.prototype.getProjection=function(){return this._projection},t.prototype.getFullExtent=function(){return this._fullExtent},t.prototype.getTransformation=function(){return this._transformation},t.prototype.getMinZoom=function(){for(var t=0;t<this._resolutions.length;t++)if(!g(this._resolutions[t]))return t;return 0},t.prototype.getMaxZoom=function(){for(var t=this._resolutions.length-1;t>=0;t--)if(!g(this._resolutions[t]))return t;return this._resolutions.length-1},t.prototype.getZoomDirection=function(){return G(this._resolutions[this.getMinZoom()]-this._resolutions[this.getMaxZoom()])},t.prototype.toJSON=function(){return this.json||(this.json={resolutions:this._resolutions,fullExtent:{top:this._fullExtent.top,left:this._fullExtent.left,bottom:this._fullExtent.bottom,right:this._fullExtent.right},projection:this._projection.code}),this.json},t}(),Yi={maxVisualPitch:60,maxPitch:80,centerCross:!1,zoomInCenter:!1,zoomAnimation:!S,zoomAnimationDuration:330,panAnimation:!S,panAnimationDuration:600,zoomable:!0,enableInfoWindow:!0,hitDetect:!oe.mobile,hitDetectLimit:5,fpsOnInteracting:25,layerCanvasLimitOnInteracting:-1,maxZoom:null,minZoom:null,maxExtent:null,checkSize:!0,renderer:"canvas"},Xi=function(t){function e(i,r){if(p(this,e),!r)throw new Error("Invalid options when creating map.");if(!r.center)throw new Error("Invalid center when creating map.");var n=y({},r),o=n.zoom;delete n.zoom;var s=new di(n.center);delete n.center;var a=n.baseLayer;delete n.baseLayer;var h=n.layers;delete n.layers;var u=f(this,t.call(this,n));return Object.defineProperty(u,"id",{value:R(),writable:!1}),u._loaded=!1,u._initContainer(i),u._panels={},u._baseLayer=null,u._layers=[],u._zoomLevel=o,u._center=s,u.setSpatialReference(n.spatialReference||n.view),u._mapViewPoint=new ae(0,0),u._initRenderer(),u._updateMapSize(u._getContainerDomSize()),a&&u.setBaseLayer(a),h&&u.addLayer(h),u._Load(),u}return c(e,t),e.addOnLoadHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._onLoadHooks=this.prototype._onLoadHooks||[],this.prototype._onLoadHooks.push(i),this},e.prototype.isLoaded=function(){return!!this._loaded},e.prototype.getContainer=function(){return this._containerDOM},e.prototype.getSpatialReference=function(){return this._spatialReference},e.prototype.setSpatialReference=function(t){var e=this.options.spatialReference;if(this._loaded&&qi.equals(e,t))return this;if(t=y({},t),this._center=this.getCenter(),this.options.spatialReference=t,this._spatialReference=new qi(t),this.options.spatialReference&&w(this.options.spatialReference.projection)){var i=this._spatialReference.getProjection();this.options.spatialReference.projection=i.code}return this._resetMapStatus(),this._fireEvent("spatialreferencechange",{old:e,new:y({},this.options.spatialReference)}),this},e.prototype.onConfig=function(t){var e=t.spatialReference||t.view;return g(e)||this.setSpatialReference(e),this},e.prototype.getProjection=function(){return this._spatialReference?this._spatialReference.getProjection():null},e.prototype.getFullExtent=function(){return this._spatialReference?this._spatialReference.getFullExtent():null},e.prototype.setCursor=function(t){return delete this._cursor,this._trySetCursor(t),this._cursor=t,this},e.prototype.resetCursor=function(){return this.setCursor(null)},e.prototype.getCenter=function(){return this._loaded&&this._prjCenter?this.getProjection().unproject(this._prjCenter):this._center},e.prototype.setCenter=function(t){if(!t)return this;if(t=new di(t),!this._verifyExtent(t))return this;if(!this._loaded)return this._center=t,this;this.onMoveStart();var e=this.getProjection().project(t);return this._setPrjCenter(e),this.onMoveEnd(this._parseEventFromCoord(this.getCenter())),this},e.prototype.getSize=function(){return g(this.width)||g(this.height)?this._getContainerDomSize():new he(this.width,this.height)},e.prototype.getContainerExtent=function(){var t=this.height,e=this.getPitch(),i=this.options.maxVisualPitch;return i&&e>i&&(t=this._getVisualHeight(i)),new _i(0,this.height-t,this.width,this.height)},e.prototype._getVisualHeight=function(t){var e=this.getPitch(),i=this.height/2*Math.tan(t*Math.PI/180);return this.height/2+i*Math.tan((90-e)*Math.PI/180)},e.prototype.getExtent=function(){return this._pointToExtent(this._get2DExtent())},e.prototype.getProjExtent=function(){var t=this._get2DExtent();return new mi(this._pointToPrj(t.getMin()),this._pointToPrj(t.getMax()))},e.prototype.getPrjExtent=function(){return this.getProjExtent()},e.prototype.getMaxExtent=function(){return this.options.maxExtent?new mi(this.options.maxExtent,this.getProjection()):null},e.prototype.setMaxExtent=function(t){if(t){var e=new mi(t,this.getProjection());this.options.maxExtent=e;var i=this.getCenter();this._verifyExtent(i)||this.panTo(e.getCenter())}else delete this.options.maxExtent;return this},e.prototype.getZoom=function(){return this._zoomLevel},e.prototype.getZoomForScale=function(t,e,i){var r=this.getZoom();if(g(e)&&(e=r),1===t&&e===r)return r;var n=this._getResolution(e)/t,o=this.getZoomFromRes(n);if(i)return o;return this.getSpatialReference().getZoomDirection()<0?Math.ceil(o-1e-6):Math.floor(o+1e-6)},e.prototype.getZoomFromRes=function(t){var e=this._getResolutions(),i=this._getResolution(this.getMinZoom()),r=this._getResolution(this.getMaxZoom());if(i<=r){if(t<=i)return this.getMinZoom();if(t>=r)return this.getMaxZoom()}else{if(t>=i)return this.getMinZoom();if(t<=r)return this.getMaxZoom()}for(var n=e.length,o=0;o<n-1;o++)if(e[o]){var s=e[o+1]-e[o],a=t-e[o];if(G(s)===G(a)&&Math.abs(s)>=Math.abs(a))return o+a/s}return n-1},e.prototype.setZoom=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{animation:!0};return isNaN(t)||g(t)?this:(this._loaded&&this.options.zoomAnimation&&e.animation?this._zoomAnimation(t):this._zoom(t),this)},e.prototype.getMaxZoom=function(){return g(this.options.maxZoom)?this.getMaxNativeZoom():this.options.maxZoom},e.prototype.setMaxZoom=function(t){var e=this.getMaxNativeZoom();return t>e&&(t=e),null!==t&&t<this._zoomLevel&&this.setZoom(t),this.options.maxZoom=t,this},e.prototype.getMinZoom=function(){return g(this.options.minZoom)?this._spatialReference.getMinZoom():this.options.minZoom},e.prototype.setMinZoom=function(t){if(null!==t){var e=this._spatialReference.getMinZoom();t<e&&(t=e),t>this._zoomLevel&&this.setZoom(t)}return this.options.minZoom=t,this},e.prototype.getMaxNativeZoom=function(){var t=this.getSpatialReference();return t?t.getMaxZoom():null},e.prototype.getGLZoom=function(){return this.getMaxNativeZoom()/2},e.prototype.getGLScale=function(t){return g(t)&&(t=this.getZoom()),this.getScale(t)/this.getScale(this.getGLZoom())},e.prototype.zoomIn=function(){return this.setZoom(this.getZoom()+1)},e.prototype.zoomOut=function(){return this.setZoom(this.getZoom()-1)},e.prototype.isZooming=function(){return!!this._zooming},e.prototype.isInteracting=function(){return this.isZooming()||this.isMoving()||this.isRotating()},e.prototype.setCenterAndZoom=function(t,e){return g(e)||this._zoomLevel===e?this.setCenter(t):(this.setCenter(t),this.setZoom(e,{animation:!1})),this},e.prototype.getFitZoom=function(t){var e=this;if(!(t&&t instanceof mi))return this._zoomLevel;if(t.xmin===t.xmax&&t.ymin===t.ymax)return this.getMaxZoom();var i=this.getSize(),r=t.convertTo(function(t){return e.coordToContainerPoint(t)}),n=r.getWidth(),o=r.getHeight(),s=i.width/n,a=i.height/o,h=this.getSpatialReference().getZoomDirection()<0?Math.max(s,a):Math.min(s,a);return this.getZoomForScale(h)},e.prototype.getView=function(){return{center:this.getCenter().toArray(),zoom:this.getZoom(),pitch:this.getPitch(),bearing:this.getBearing()}},e.prototype.setView=function(t){return t?(t.center&&this.setCenter(t.center),t.zoom&&this.setZoom(t.zoom,{animation:!1}),t.pitch&&this.setPitch(t.pitch),t.bearing&&this.setBearing(t.bearing),this):this},e.prototype.getResolution=function(t){return this._getResolution(t)},e.prototype.getScale=function(t){var e=g(t)?this.getZoom():t,i=this._getResolution(this.getMaxNativeZoom());return this._getResolution(e)/i},e.prototype.fitExtent=function(t,e){if(!t)return this;t=new mi(t,this.getProjection());var i=this.getFitZoom(t)+(e||0),r=t.getCenter();return this.setCenterAndZoom(r,i)},e.prototype.getBaseLayer=function(){return this._baseLayer},e.prototype.setBaseLayer=function(t){var e=!1;if(this._baseLayer&&(e=!0,this._fireEvent("baselayerchangestart"),this._baseLayer.remove()),!t)return delete this._baseLayer,this._fireEvent("baselayerchangeend"),this._fireEvent("setbaselayer"),this;return this._baseLayer=t,t._bindMap(this,-1),this._baseLayer.on("layerload",function(){this._fireEvent("baselayerload"),e&&(e=!1,this._fireEvent("baselayerchangeend"))},this),this._loaded&&this._baseLayer.load(),this._fireEvent("setbaselayer"),this},e.prototype.removeBaseLayer=function(){return this._baseLayer&&(this._baseLayer.remove(),delete this._baseLayer,this._fireEvent("baselayerremove")),this},e.prototype.getLayers=function(t){return this._getLayers(function(e){return!(e===this._baseLayer||e.getId().indexOf("_maptalks__internal_layer_")>=0)&&(!t||t(e))})},e.prototype.getLayer=function(t){if(!t)return null;var e=this._layerCache?this._layerCache[t]:null;if(e)return e;var i=this.getBaseLayer();return i&&i.getId()===t?i:null},e.prototype.addLayer=function(t){if(!t)return this;if(!Array.isArray(t))return t=Array.prototype.slice.call(arguments,0),this.addLayer(t);this._layerCache||(this._layerCache={});for(var e=this._layers,i=0,r=t.length;i<r;i++){var n=t[i],o=n.getId();if(g(o))throw new Error("Invalid id for the layer: "+o);if(n.getMap()!==this){if(this._layerCache[o])throw new Error("Duplicate layer id in the map: "+o);this._layerCache[o]=n,n._bindMap(this),e.push(n),this._loaded&&n.load()}}return this._sortLayersByZIndex(),this._fireEvent("addlayer",{layers:t}),this},e.prototype.removeLayer=function(t){if(!t)return this;if(!Array.isArray(t))return this.removeLayer([t]);for(var e=[],i=0,r=t.length;i<r;i++){var n=t[i];if(n instanceof Vi||(n=this.getLayer(n)),n){var o=n.getMap();if(o&&o===this){e.push(n),this._removeLayer(n,this._layers),this._loaded&&n._doRemove();var s=n.getId();this._layerCache&&delete this._layerCache[s]}}}return e.length>0&&this.once("frameend",function(){e.forEach(function(t){t.fire("remove")})}),this._fireEvent("removelayer",{layers:t}),this},e.prototype.sortLayers=function(t){if(!t||!Array.isArray(t))return this;for(var e=[],i=Number.MAX_VALUE,r=0,n=t.length;r<n;r++){var o=t[r];if(x(t[r])&&(o=this.getLayer(o)),!(o instanceof Vi&&o.getMap()&&o.getMap()===this))throw new Error("It must be a layer added to this map to order.");o.getZIndex()<i&&(i=o.getZIndex()),e.push(o)}for(var s=0,a=e.length;s<a;s++)e[s].setZIndex(i+s);return this},e.prototype.toDataURL=function(t){t||(t={});var e=t.mimeType;e||(e="image/png");var i=t.save,r=this._getRenderer();if(r&&r.toDataURL){var n=t.fileName;n||(n="export");var o=r.toDataURL(e);if(i&&o){var s=void 0;if("undefined"!=typeof Blob&&"undefined"!=typeof atob){var a=$(o.replace(/^data:image\/(png|jpeg|jpg);base64,/,""),e);s=URL.createObjectURL(a)}else s=o;var h=document.createElement("a");h.download=n,h.href=s,document.body.appendChild(h),h.click(),document.body.removeChild(h)}return o}return null},e.prototype.coordinateToPoint=function(t,e){var i=this.getProjection().project(t);return this._prjToPoint(i,e)},e.prototype.coordToPoint=function(t,e){return this.coordinateToPoint(t,e)},e.prototype.pointToCoordinate=function(t,e){var i=this._pointToPrj(t,e);return this.getProjection().unproject(i)},e.prototype.pointToCoord=function(t,e){return this.pointToCoordinate(t,e)},e.prototype.coordinateToViewPoint=function(t){return this._prjToViewPoint(this.getProjection().project(t))},e.prototype.coordToViewPoint=function(t){return this.coordinateToViewPoint(t)},e.prototype.viewPointToCoordinate=function(t){return this.getProjection().unproject(this._viewPointToPrj(t))},e.prototype.viewPointToCoord=function(t){return this.viewPointToCoordinate(t)},e.prototype.coordinateToContainerPoint=function(t,e){var i=this.getProjection().project(t);return this._prjToContainerPoint(i,e)},e.prototype.coordToContainerPoint=function(t,e){return this.coordinateToContainerPoint(t,e)},e.prototype.containerPointToCoordinate=function(t){var e=this._containerPointToPrj(t);return this.getProjection().unproject(e)},e.prototype.containerPointToCoord=function(t){return this.containerPointToCoordinate(t)},e.prototype.containerPointToViewPoint=function(t){return t.sub(this.getViewPoint())},e.prototype.viewPointToContainerPoint=function(t){return t.add(this.getViewPoint())},e.prototype.containerToExtent=function(t){var e=new _i(this._containerPointToPoint(t.getMin()),this._containerPointToPoint(t.getMax()));return this._pointToExtent(e)},e.prototype.checkSize=function(){var t=d()-this._initTime<1500&&0===this.width||0===this.height,e=this._getContainerDomSize(),i=this.height,r=this.width;if(e.width===r&&e.height===i)return this;var n=this.getCenter();this._updateMapSize(e);var o=new ae((r-e.width)/2,(i-e.height)/2);this._offsetCenterByPixel(o),this._mapViewCoord=this._getPrjCenter();var s=0===e.width||0===e.height||0===r||0===i;return(t||s)&&(this._noEvent=!0,this.setCenter(n),delete this._noEvent),this._fireEvent("resize"),this},e.prototype.distanceToPixel=function(t,e,i){var r=this.getProjection();if(!r)return null;var n=this.getScale()/this.getScale(i),o=this.getCenter(),s=r.locate(o,t,e),a=this.coordToContainerPoint(o),h=this.coordToContainerPoint(s);return h._sub(a)._multi(n)._abs(),new he(h.x,h.y)},e.prototype.distanceToPoint=function(t,e,i){var r=this.getProjection();if(!r)return null;var n=this.getCenter(),o=r.locate(n,t,e),s=this.coordToPoint(n,i),a=this.coordToPoint(o,i);return a._sub(s)._abs(),a},e.prototype.pixelToDistance=function(t,e){var i=this.getProjection();if(!i)return null;var r=this.getFullExtent(),n=r.top>r.bottom?-1:1,o=new ae(this.width/2+t,this.height/2+n*e),s=this.containerPointToCoord(o);return i.measureLength(this.getCenter(),s)},e.prototype.pointToDistance=function(t,e,i){var r=this.getProjection();if(!r)return null;var n=this._prjToPoint(this._getPrjCenter(),i);n._add(t,e);var o=this.pointToCoord(n,i);return r.measureLength(this.getCenter(),o)},e.prototype.locate=function(t,e,i){return this.getProjection()._locate(new di(t),e,i)},e.prototype.locateByPoint=function(t,e,i){var r=this.coordToContainerPoint(t);return this.containerPointToCoord(r._add(e,i))},e.prototype.getMainPanel=function(){return this._getRenderer().getMainPanel()},e.prototype.getPanels=function(){return this._panels},e.prototype.remove=function(){if(this.isRemoved())return this;this._fireEvent("removestart"),this._removeDomEvents(),this._clearHandlers(),this.removeBaseLayer();for(var t=this.getLayers(),e=0;e<t.length;e++)t[e].remove();return this._getRenderer()&&this._getRenderer().remove(),this._containerDOM.innerHTML&&(this._containerDOM.innerHTML=""),delete this._panels,delete this._containerDOM,delete this.renderer,this._fireEvent("removeend"),this._clearAllListeners(),this},e.prototype.isRemoved=function(){return!this._containerDOM},e.prototype.isMoving=function(){return!!this._moving},e.prototype.onMoveStart=function(t){this._originCenter=this.getCenter(),this._moving=!0,this._trySetCursor("move"),this._fireEvent("movestart",this._parseEvent(t?t.domEvent:null,"movestart"))},e.prototype.onMoving=function(t){this._fireEvent("moving",this._parseEvent(t?t.domEvent:null,"moving"))},e.prototype.onMoveEnd=function(t){if(this._moving=!1,this._trySetCursor("default"),this._fireEvent("moveend",t&&t.domEvent?this._parseEvent(t.domEvent,"moveend"):t),!this._verifyExtent(this.getCenter())){var e=this._originCenter;this._verifyExtent(e)||(e=this.getMaxExtent().getCenter()),this.panTo(e)}},e.prototype.onDragRotateStart=function(t){this._dragRotating=!0,this._fireEvent("dragrotatestart",this._parseEvent(t?t.domEvent:null,"dragrotatestart"))},e.prototype.onDragRotating=function(t){this._fireEvent("dragrotating",this._parseEvent(t?t.domEvent:null,"dragrotating"))},e.prototype.onDragRotateEnd=function(t){this._dragRotating=!1,this._fireEvent("dragrotateend",this._parseEvent(t?t.domEvent:null,"dragrotateend"))},e.prototype.isDragRotating=function(){return!!this._dragRotating},e.prototype.getRenderer=function(){return this._getRenderer()},e.prototype._initContainer=function(t){if(x(t)){if(this._containerDOM=document.getElementById(t),!this._containerDOM)throw new Error("Invalid container when creating map: '"+t+"'")}else this._containerDOM=t,S&&(this.CanvasClass=this._containerDOM.constructor);if(this._containerDOM.childNodes&&this._containerDOM.childNodes.length>0&&"maptalks-wrapper"===this._containerDOM.childNodes[0].className)throw new Error("Container is already loaded with another map instance, use map.remove() to clear it.")},e.prototype._trySetCursor=function(t){return this._cursor||this._priorityCursor||(t||(t="default"),this._setCursorToPanel(t)),this},e.prototype._setPriorityCursor=function(t){if(t)this._priorityCursor=t,this._setCursorToPanel(t);else{var e=!1;this._priorityCursor&&(e=!0),delete this._priorityCursor,e&&this.setCursor(this._cursor)}return this},e.prototype._setCursorToPanel=function(t){var e=this.getMainPanel();e&&e.style&&e.style.cursor!==t&&(e.style.cursor=t)},e.prototype._get2DExtent=function(t){var e=this;return this.getContainerExtent().convertTo(function(i){return e._containerPointToPoint(i,t)})},e.prototype._pointToExtent=function(t){var e=t.getMin(),i=t.getMax(),r=this.getFullExtent(),n=!r||r.left<=r.right?[e.x,i.x]:[i.x,e.x],o=n[0],s=n[1],a=!r||r.top>r.bottom?[i.y,e.y]:[e.y,i.y],h=a[1],u=new di(o,a[0]),l=new di(s,h);return new mi(this.pointToCoord(u),this.pointToCoord(l),this.getProjection())},e.prototype._removeLayer=function(t,e){if(t&&e){var i=e.indexOf(t);i>-1&&e.splice(i,1)}},e.prototype._sortLayersByZIndex=function(){if(this._layers){for(var t=0,e=this._layers.length;t<e;t++)this._layers[t]._order=t;this._layers.sort(function(t,e){var i=t.getZIndex()-e.getZIndex();return 0===i?t._order-e._order:i})}},e.prototype._fireEvent=function(t,e){this._noEvent||(this.fire("_"+t,e),this.fire(t,e))},e.prototype._Load=function(){this._resetMapStatus(),this.options.pitch&&(this.setPitch(this.options.pitch),delete this.options.pitch),this.options.bearing&&(this.setBearing(this.options.bearing),delete this.options.bearing),this._loadAllLayers(),this._getRenderer().onLoad(),this._loaded=!0,this._callOnLoadHooks(),this._initTime=d()},e.prototype._initRenderer=function(){var t=this.options.renderer,i=e.getRendererClass(t);this._renderer=new i(this),this._renderer.load()},e.prototype._getRenderer=function(){return this._renderer},e.prototype._loadAllLayers=function(){this._baseLayer&&this._baseLayer.load(),this._eachLayer(function(t){t&&t.load()},this.getLayers())},e.prototype._getLayers=function(t){for(var e=this._baseLayer?[this._baseLayer].concat(this._layers):this._layers,i=[],r=0;r<e.length;r++)t&&!t.call(this,e[r])||i.push(e[r]);return i},e.prototype._eachLayer=function(t){if(!(arguments.length<2)){var e=Array.prototype.slice.call(arguments,1);e&&!Array.isArray(e)&&(e=[e]);for(var i=[],r=0,n=e.length;r<n;r++)i=i.concat(e[r]);for(var o=0,s=i.length;o<s;o++)t.call(t,i[o])}},e.prototype._onLayerEvent=function(t){t&&"idchange"===t.type&&(delete this._layerCache[t.old],this._layerCache[t.new]=t.target)},e.prototype._resetMapStatus=function(){var t=this.getMaxZoom(),e=this.getMinZoom(),i=this._spatialReference.getMaxZoom(),r=this._spatialReference.getMinZoom();(g(t)||-1===t||t>i)&&this.setMaxZoom(i),(g(e)||-1===e||e<r)&&this.setMinZoom(r),(t=this.getMaxZoom())<(e=this.getMinZoom())&&this.setMaxZoom(e),(g(this._zoomLevel)||this._zoomLevel>t)&&(this._zoomLevel=t),this._zoomLevel<e&&(this._zoomLevel=e),delete this._prjCenter;var n=this.getProjection();this._prjCenter=n.project(this._center),this._calcMatrices();var o=this._getRenderer();o&&o.resetContainer()},e.prototype._getContainerDomSize=function(){if(!this._containerDOM)return null;var t=this._containerDOM,e=void 0,i=void 0;if(g(t.width)||g(t.height)){if(g(t.clientWidth)||g(t.clientHeight))throw new Error("can not get size of container");e=parseInt(t.clientWidth,0),i=parseInt(t.clientHeight,0)}else e=t.width,i=t.height,oe.retina&&t.layer&&(e/=2,i/=2);return new he(e,i)},e.prototype._updateMapSize=function(t){return this.width=t.width,this.height=t.height,this._getRenderer().updateMapSize(t),this._calcMatrices(),this},e.prototype._getPrjCenter=function(){return this._prjCenter},e.prototype._setPrjCenter=function(t){this._prjCenter=t,this.isInteracting()&&!this.isMoving()&&(this._mapViewCoord=t),this._calcMatrices()},e.prototype._setPrjCoordAtContainerPoint=function(t,e){if(e.x===this.width/2&&e.y===this.height/2)return this;var i=this._containerPointToPoint(e)._sub(this._prjToPoint(this._getPrjCenter())),r=this._pointToPrj(this._prjToPoint(t).sub(i));return this._setPrjCenter(r),this},e.prototype._verifyExtent=function(t){if(!t)return!1;var e=this.getMaxExtent();return!e||e.contains(t)},e.prototype._offsetCenterByPixel=function(t){var e=new ae(this.width/2-t.x,this.height/2-t.y),i=this._containerPointToPrj(e);return this._setPrjCenter(i),i},e.prototype.offsetPlatform=function(t){return t?(this._getRenderer().offsetPlatform(t),this._mapViewCoord=this._getPrjCenter(),this._mapViewPoint=this._mapViewPoint.add(t),this):this._mapViewPoint},e.prototype.getViewPoint=function(){var t=this._getViewPointFrameOffset(),e=this.offsetPlatform();return t&&(e=e.add(t)),e},e.prototype._getViewPointFrameOffset=function(){if(this.isZooming())return null;var t=this._getPrjCenter();return this._mapViewCoord&&!this._mapViewCoord.equals(t)?this._prjToContainerPoint(this._mapViewCoord).sub(this._prjToContainerPoint(t)):null},e.prototype._resetMapViewPoint=function(){this._mapViewPoint=new ae(0,0),this._mapViewCoord=this._getPrjCenter()},e.prototype._getResolution=function(t){return g(t)&&(t=this.getZoom()),this._spatialReference.getResolution(t)},e.prototype._getResolutions=function(){return this._spatialReference.getResolutions()},e.prototype._prjToPoint=function(t,e){return e=g(e)?this.getZoom():e,this._spatialReference.getTransformation().transform(t,this._getResolution(e))},e.prototype._pointToPrj=function(t,e){return e=g(e)?this.getZoom():e,this._spatialReference.getTransformation().untransform(t,this._getResolution(e))},e.prototype._pointToPoint=function(t,e){return g(e)?t.copy():t.multi(this._getResolution(e)/this._getResolution())},e.prototype._pointToPointAtZoom=function(t,e){return g(e)?t.copy():t.multi(this._getResolution()/this._getResolution(e))},e.prototype._containerPointToPrj=function(t){return this._pointToPrj(this._containerPointToPoint(t))},e.prototype._viewPointToPrj=function(t){return this._containerPointToPrj(this.viewPointToContainerPoint(t))},e.prototype._prjToContainerPoint=function(t,e){return this._pointToContainerPoint(this._prjToPoint(t,e),e)},e.prototype._prjToViewPoint=function(t){var e=this._prjToContainerPoint(t);return this._containerPointToViewPoint(e)},e.prototype._containerPointToViewPoint=function(t){return t?t._sub(this.getViewPoint()):null},e.prototype._viewPointToPoint=function(t,e){return this._containerPointToPoint(this.viewPointToContainerPoint(t),e)},e.prototype._pointToViewPoint=function(t,e){return this._prjToViewPoint(this._pointToPrj(t,e))},e.prototype._callOnLoadHooks=function(){var t=e.prototype;if(t._onLoadHooks)for(var i=0,r=t._onLoadHooks.length;i<r;i++)t._onLoadHooks[i].call(this)},e}(li(oi(Hi(ai))));Xi.mergeOptions(Yi);var Ki=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addHooks=function(){this.target&&this.target.on("_dblclick",this._onDoubleClick,this)},e.prototype.removeHooks=function(){this.target&&this.target.off("_dblclick",this._onDoubleClick,this)},e.prototype._onDoubleClick=function(t){var e=this.target;if(e.options.doubleClickZoom){var i=e.getZoom(),r=t.domEvent.shiftKey?Math.ceil(i)-1:Math.floor(i)+1;e._zoomAnimation(r,t.containerPoint)}},e}(si);Xi.mergeOptions({doubleClickZoom:!0}),Xi.addOnLoadHook("addHandler","doubleClickZoom",Ki);var Qi=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addHooks=function(){var t=this.target;if(t){var e=t._panels.mapWrapper||t._containerDOM;this._dragHandler=new fi(e,{cancelOn:this._cancelOn.bind(this),rightclick:!0}),this._dragHandler.on("mousedown",this._onMouseDown,this).on("dragstart",this._onDragStart,this).on("dragging",this._onDragging,this).on("dragend",this._onDragEnd,this).enable()}},e.prototype.removeHooks=function(){this._dragHandler.off("mousedown",this._onMouseDown,this).off("dragstart",this._onDragStart,this).off("dragging",this._onDragging,this).off("dragend",this._onDragEnd,this),this._dragHandler.remove(),delete this._dragHandler},e.prototype._cancelOn=function(t){return!(!this.target.isZooming()&&!this._ignore(t))},e.prototype._ignore=function(t){return!!t&&(t.domEvent&&(t=t.domEvent),this.target._ignoreEvent(t))},e.prototype._onMouseDown=function(t){delete this.startDragTime,delete this._mode,2===t.domEvent.button||t.domEvent.ctrlKey?(this.target.options.dragRotate||this.target.options.dragPitch)&&(this._mode="rotatePitch"):this.target.options.dragPan&&(this._mode="move"),this.target._stopAnim(this.target._animPlayer),De(t.domEvent)},e.prototype._onDragStart=function(t){this.startDragTime=d(),"move"===this._mode?this._moveStart(t):"rotatePitch"===this._mode&&this._rotateStart(t)},e.prototype._onDragging=function(t){this.target._isEventOutMap(t.domEvent)||("move"===this._mode?this._moving(t):"rotatePitch"===this._mode&&this._rotating(t))},e.prototype._onDragEnd=function(t){"move"===this._mode?this._moveEnd(t):"rotatePitch"===this._mode&&this._rotateEnd(t),delete this.startDragTime,delete this.startBearing},e.prototype._start=function(t){this.preX=t.mousePos.x,this.preY=t.mousePos.y,this.startX=this.preX,this.startY=this.preY},e.prototype._moveStart=function(t){this._start(t);var e=this.target;e.onMoveStart(t);var i=Ge(e._getActualEvent(t.domEvent),e.getContainer());this.startPrjCoord=e._containerPointToPrj(i)},e.prototype._moving=function(t){if(this.startDragTime){var e=this.target,i=Ge(e._getActualEvent(t.domEvent),e.getContainer());e._setPrjCoordAtContainerPoint(this.startPrjCoord,i),e.onMoving(t)}},e.prototype._moveEnd=function(t){if(this.startDragTime){var e=this.target,i=d()-this.startDragTime,r=t.mousePos.x,n=t.mousePos.y,o=r-this.startX,s=n-this.startY;this._clear(),e.options.panAnimation&&!t.interupted&&e._verifyExtent(e.getCenter())&&i<280&&Math.abs(s)+Math.abs(o)>5?(i=5*i*(Math.abs(o)+Math.abs(s))/500,e.panBy(new ae(o,s),{duration:i})):e.onMoveEnd(t)}},e.prototype._rotateStart=function(t){this._start(t),delete this._rotateMode,this.startBearing=this.target.getBearing(),this.target.onDragRotateStart(t),this._db=0},e.prototype._rotating=function(t){var e=this.target,i=t.mousePos.x,r=t.mousePos.y,n=e.getPitch(),o=e.getBearing(),s=Math.abs(i-this.preX),a=Math.abs(r-this.preY);if(this._rotateMode||(e.options.dragRotatePitch?this._rotateMode="rotate_pitch":this._rotateMode=s>a?"rotate":s<a?"pitch":"rotate"),!("pitch"===this._rotateMode&&0===n&&a<10)){if(this._rotateMode.indexOf("rotate")>=0&&e.options.dragRotate){var h=0;h=e.options.dragPitch||s>a?-.6*(this.preX-i):i>e.width/2?.6*(this.preY-r):-.6*(this.preY-r);var u=e.getBearing()+h;this._db=this._db||0,this._db+=h,e.setBearing(u)}this._rotateMode.indexOf("pitch")>=0&&e.options.dragPitch&&e.setPitch(e.getPitch()+.4*(this.preY-r)),this.preX=i,this.preY=r,e.getBearing()===o&&e.getPitch()===n||e.onDragRotating(t)}},e.prototype._rotateEnd=function(t){var e=this.target,i=e.getBearing();this._clear();var r=d()-this.startDragTime;if(e.onDragRotateEnd(t),Math.abs(i-this.startBearing)>20&&("rotate"===this._rotateMode||"rotate_pitch"===this._rotateMode)&&!t.interupted&&r<400){var n=e.getBearing();e.animateTo({bearing:n+this._db/2},{easing:"out",duration:800})}},e.prototype._clear=function(){delete this.startPrjCoord,delete this.preX,delete this.preY,delete this.startX,delete this.startY},e}(si);function $i(t,e,i,r){for(var n=[],o=0,s=void 0,a=0,h=t.length;a<h-1;a++)(s=er(t[a],t[a+1],e,a,i,r))&&(n[o]=n[o]||[],n[o].push({point:s[0],index:a}),s[1]===t[a+1]&&a!==h-2||(n[o].push({point:s[1],index:a+1}),o++));return n}Xi.mergeOptions({draggable:!0,dragPan:!0,dragRotatePitch:!0,dragRotate:!0,dragPitch:!0}),Xi.addOnLoadHook("addHandler","draggable",Qi);var tr=void 0;function er(t,e,i,r,n,o){var s=r?tr:nr(t,i),a=nr(e,i),h=void 0,u=void 0,l=void 0;for(tr=a;;){if(!(s|a))return[t,e];if(s&a)return!1;if(o)return[t,e];l=nr(u=rr(t,e,h=s||a,i,n),i),h===s?(t=u,s=l):(e=u,a=l)}}function ir(t,e,i){var r=[1,4,2,8],n=void 0,o=void 0,s=void 0,a=void 0,h=void 0,u=void 0,l=void 0,p=void 0,c=void 0;for(o=0,l=t.length;o<l;o++)t[o]._code=nr(t[o],e);for(a=0;a<4;a++){for(p=r[a],n=[],o=0,s=(l=t.length)-1;o<l;s=o++)h=t[o],u=t[s],h._code&p?u._code&p||((c=rr(u,h,p,e,i))._code=nr(c,e),n.push(c)):(u._code&p&&((c=rr(u,h,p,e,i))._code=nr(c,e),n.push(c)),n.push(h));t=n}return t}function rr(t,e,i,r,n){var o=e.x-t.x,s=e.y-t.y,a=r.getMin(),h=r.getMax(),u=void 0,l=void 0;8&i?(u=t.x+o*(h.y-t.y)/s,l=h.y):4&i?(u=t.x+o*(a.y-t.y)/s,l=a.y):2&i?(u=h.x,l=t.y+s*(h.x-t.x)/o):1&i&&(u=a.x,l=t.y+s*(a.x-t.x)/o);var p=new ae(u,l);return n&&p._round(),p}function nr(t,e){var i=0;return t.x<e.getMin().x?i|=1:t.x>e.getMax().x&&(i|=2),t.y<e.getMin().y?i|=4:t.y>e.getMax().y&&(i|=8),i}function or(t,e,i,r){t=new ae(t);var n=Math.abs(i.x-e.x),o=Math.abs(i.y-e.y),s=Math.sqrt(Math.abs(n*n-o*o)),a=void 0,h=void 0,u=void 0;return n>=o?(a=new ae(e.x-s,e.y),h=new ae(e.x+s,e.y),u=2*n):(a=new ae(e.x,e.y-s),h=new ae(e.x,e.y+s),u=2*o),t.distanceTo(a)+t.distanceTo(h)<=u+2*r}var sr=function(){function t(){p(this,t)}return t.prototype.getMap=function(){return this.geometry.getMap()},t.prototype.getPainter=function(){return this.painter},t.testColor=function(t){return!(!t||!x(t))&&u.indexOf(t)>=0},t}(),ar=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype._prepareContext=function(t){m(this.symbol.opacity)?t.globalAlpha!==this.symbol.opacity&&(t.globalAlpha=this.symbol.opacity):1!==t.globalAlpha&&(t.globalAlpha=1)},e.prototype.prepareCanvas=function(t,e,i){ti.prepareCanvas(t,e,i,this.getPainter().isHitTesting())},e.prototype.remove=function(){},e.prototype.setZIndex=function(){},e.prototype.show=function(){},e.prototype.hide=function(){},e.prototype._defineStyle=function(t){return function(){var e=this,i=[],r={};return Tt(t,function(){var t=e.getMap();return function(t,e,i){return t[0]=e,t[1]=i,t}(i,t.getZoom(),y({},e.geometry.getProperties(),function(t,e,i,r){return t["{bearing}"]=e,t["{pitch}"]=i,t["{zoom}"]=r,t}(r,t.getBearing(),t.getPitch(),t.getZoom())))})}.bind(this)()},e}(sr);var hr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this));return o.symbol=i,o.geometry=r,o.painter=n,o}return c(e,t),e.prototype.get2DExtent=function(){for(var t=this.getMap(),e=t.getGLZoom(),i=new _i,r=this._getRenderPoints()[0],n=r.length-1;n>=0;n--)r[n]&&i._combine(t._pointToPoint(r[n],e));return i},e.prototype._rotateExtent=function(t,e){return t.convertTo(function(t){return t._rotate(e)})},e.prototype._getRenderPoints=function(){return this.getPainter().getRenderPoints(this.getPlacement())},e.prototype._getRenderContainerPoints=function(t){var e=this.getPainter(),i=this._getRenderPoints()[0];if(e.isSpriting())return i;var r=this.getDxDy(),n=this.painter._pointContainerPoints(i,r.x,r.y,t,!0,this.getPlacement());if(!n||!Array.isArray(n[0]))return n;for(var o=[],s=0,a=n.length;s<a;s++)for(var h=0,u=n[s].length;h<u;h++)o.push(n[s][h]);return o},e.prototype._getRotationAt=function(t){var e=this.getRotation();e||(e=0);var i=this._getRenderPoints()[1];if(!i||!i[t])return e;var r=this.getMap(),n=i[t][0],o=i[t][1];if(r.isTransforming()){var s=r.getGLZoom();n=r._pointToContainerPoint(i[t][0],s),o=r._pointToContainerPoint(i[t][1],s)}return e+tt(n.x,n.y,o.x,o.y)},e.prototype._rotate=function(t,e,i){if(i){var r=this.getDxDy(),n=e.sub(r);return t.save(),t.translate(n.x,n.y),t.rotate(i),this.getDxDy()}return null},e}(ar),ur=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,r,n));o._dynamic=Pt(i),o.style=o._defineStyle(o.translate()),o.strokeAndFill=o._defineStyle(e.translateLineAndFill(o.style));var s=o.strokeAndFill.lineWidth;return o.padding=s%2==0?2:1.5,o}return c(e,t),e.test=function(t){return!!t&&!(!g(t.markerFile)||g(t.markerType)||"path"===t.markerType)},e.prototype.symbolize=function(t,e){var i=this.style;if(this.painter.isHitTesting()||0!==i.markerWidth&&0!==i.markerHeight&&(0!==i.polygonOpacity||0!==i.lineOpacity)){var r=this._getRenderContainerPoints();V(r)&&(this._prepareContext(t),this.getPainter().isSpriting()||this.geometry.getLayer().getMask()===this.geometry||this._dynamic||!1===this.geometry.getLayer().options.cacheVectorOnCanvas?this._drawMarkers(t,r,e):this._drawMarkersWithCache(t,r,e))}},e.prototype.getDxDy=function(){var t=this.style,e=t.markerDx,i=t.markerDy;return new ae(e,i)},e.prototype._drawMarkers=function(t,e,i){var r=this.strokeAndFill;Rt(r.lineColor)||Rt(r.polygonFill)||this.prepareCanvas(t,r,i);for(var n=e.length-1;n>=0;n--){var o=e[n],s=this._rotate(t,o,this._getRotationAt(n));s&&(o=s),this._drawVectorMarker(t,o,i),s&&t.restore()}},e.prototype._drawMarkersWithCache=function(t,e,i){var r=this._stampSymbol(),n=i.getImage(r);n||(n=this._createMarkerImage(t,i),i.addResource([r,n.width,n.height],n));for(var o=this._getAnchor(n.width,n.height),s=e.length-1;s>=0;s--){var a=e[s],h=this._rotate(t,a,this._getRotationAt(s));h&&(a=h),ti.image(t,n,a.x+o.x,a.y+o.y),h&&t.restore()}},e.prototype._calMarkerSize=function(){if(!this._size){var t=this.strokeAndFill.lineWidth,e=2*(this.symbol.shadowBlur||0),i=Math.round(this.style.markerWidth+t+2*e+2*this.padding),r=Math.round(this.style.markerHeight+t+2*e+2*this.padding);this._size=[i,r]}return this._size},e.prototype._createMarkerImage=function(t,e){var i=t.canvas.constructor,r=this._calMarkerSize(),n=ti.createCanvas(r[0],r[1],i),o=this._getCacheImageAnchor(r[0],r[1]),s=n.getContext("2d");return Rt(this.strokeAndFill.lineColor)||Rt(this.strokeAndFill.polygonFill)||this.prepareCanvas(s,this.strokeAndFill,e),this._drawVectorMarker(s,o,e),n},e.prototype._stampSymbol=function(){return this._stamp||(this._stamp=[this.style.markerType,Rt(this.style.markerFill)?jt(this.style.markerFill):this.style.markerFill,this.style.markerFillOpacity,this.style.markerFillPatternFile,Rt(this.style.markerLineColor)?jt(this.style.markerLineColor):this.style.markerLineColor,this.style.markerLineWidth,this.style.markerLineOpacity,this.style.markerLineDasharray?this.style.markerLineDasharray.join(","):"",this.style.markerLinePatternFile,this.style.markerWidth,this.style.markerHeight,this.style.markerHorizontalAlignment,this.style.markerVerticalAlignment].join("_")),this._stamp},e.prototype._getAnchor=function(t,e){var i=2*(this.symbol.shadowBlur||0)+this.padding,r=we(new he(t,e),this.style.markerHorizontalAlignment,this.style.markerVerticalAlignment);return r.x!==-t/2&&(r.x-=G(r.x+t/2)*i),r.y!==-e/2&&(r.y-=G(r.y+e/2)*i),r},e.prototype._getCacheImageAnchor=function(t,e){var i=2*(this.symbol.shadowBlur||0)+this.padding,r=this.style.markerType;return"bar"===r||"pie"===r||"pin"===r?new ae(t/2,e-i):"rectangle"===r?new ae(i,i):new ae(t/2,e/2)},e.prototype._getGraidentExtent=function(t){var e=new _i,i=this.getDxDy(),r=this.getFixedExtent();if(Array.isArray(t))for(var n=t.length-1;n>=0;n--)e._combine(t[n]);else e._combine(t);return e.xmin+=r.xmin-i.x,e.ymin+=r.ymin-i.y,e.xmax+=r.xmax-i.x,e.ymax+=r.ymax-i.y,e},e.prototype._drawVectorMarker=function(t,i,r){var n=this.style,o=this.strokeAndFill,s=n.markerType.toLowerCase(),a=e._getVectorPoints(s,n.markerWidth,n.markerHeight),h=o.lineOpacity,u=o.polygonOpacity;if(Rt(o.lineColor)||Rt(o.polygonFill)){var l=void 0;Rt(o.lineColor)&&(l=this._getGraidentExtent(i),o.lineGradientExtent=l.expand(o.lineWidth)),Rt(o.polygonFill)&&(l||(l=this._getGraidentExtent(i)),o.polygonGradientExtent=l),this.prepareCanvas(t,o,r)}var p=n.markerWidth,c=n.markerHeight,f=n.markerLineWidth/2;if("ellipse"===s)ti.ellipse(t,i,p/2,c/2,h,u);else if("cross"===s||"x"===s){for(var d=a.length-1;d>=0;d--)a[d]._add(i);ti.path(t,a.slice(0,2),h),ti.path(t,a.slice(2,4),h)}else if("diamond"===s||"bar"===s||"square"===s||"rectangle"===s||"triangle"===s){"bar"===s?i=i.add(0,-f):"rectangle"===s&&(i=i.add(f,f));for(var y=a.length-1;y>=0;y--)a[y]._add(i);ti.polygon(t,a,h,u)}else if("pin"===s){i=i.add(0,-f);for(var g=a.length-1;g>=0;g--)a[g]._add(i);var m=t.lineCap;t.lineCap="round",ti.bezierCurveAndFill(t,a,h,u),t.lineCap=m}else{if("pie"!==s)throw new Error("unsupported markerType: "+s);i=i.add(0,-f);var _=180*Math.atan(p/2/c)/Math.PI,v=t.lineCap;t.lineCap="round",ti.sector(t,i,c,[90-_,90+_],h,u),t.lineCap=v}},e.prototype.getPlacement=function(){return this.symbol.markerPlacement},e.prototype.getRotation=function(){var t=this.style.markerRotation;return m(t)?-t*Math.PI/180:null},e.prototype.getFixedExtent=function(){var t=this.getDxDy(),e=2*this.padding,i=this._calMarkerSize().map(function(t){return t-e}),r=this._getAnchor(i[0],i[1]),n=new _i(t.add(0,0),t.add(i[0],i[1]));n._add(r);var o=this.getRotation();return o&&(n=this._rotateExtent(n,o)),n},e.prototype.translate=function(){var t=this.symbol,e={markerType:Z(t.markerType,"ellipse"),markerFill:Z(t.markerFill,"#00f"),markerFillOpacity:Z(t.markerFillOpacity,1),markerFillPatternFile:Z(t.markerFillPatternFile,null),markerLineColor:Z(t.markerLineColor,"#000"),markerLineWidth:Z(t.markerLineWidth,1),markerLineOpacity:Z(t.markerLineOpacity,1),markerLineDasharray:Z(t.markerLineDasharray,[]),markerLinePatternFile:Z(t.markerLinePatternFile,null),markerDx:Z(t.markerDx,0),markerDy:Z(t.markerDy,0),markerWidth:Z(t.markerWidth,10),markerHeight:Z(t.markerHeight,10),markerRotation:Z(t.markerRotation,0)},i=e.markerType,r=void 0,n=void 0;return"bar"===i||"pie"===i||"pin"===i?(r="middle",n="top"):"rectangle"===i?(r="right",n="bottom"):(r="middle",n="middle"),e.markerHorizontalAlignment=Z(t.markerHorizontalAlignment,r),e.markerVerticalAlignment=Z(t.markerVerticalAlignment,n),m(t.markerOpacity)&&(m(t.markerFillOpacity)&&(e.markerFillOpacity*=t.markerOpacity),m(t.markerLineOpacity)&&(e.markerLineOpacity*=t.markerOpacity)),e},e.translateLineAndFill=function(t){var e={lineColor:t.markerLineColor,linePatternFile:t.markerLinePatternFile,lineWidth:t.markerLineWidth,lineOpacity:t.markerLineOpacity,lineDasharray:t.markerLineDasharray,lineCap:"butt",lineJoin:"round",polygonFill:t.markerFill,polygonPatternFile:t.markerFillPatternFile,polygonOpacity:t.markerFillOpacity};return 0===e.lineWidth&&(e.lineOpacity=0),e},e._getVectorPoints=function(t,e,i){var r=i/2,n=e/2,o=void 0;if("triangle"===t)return[o=new ae(0,0-r),new ae(0-n,0+r),new ae(0+n,0+r)];if("cross"===t)return[o=new ae(0-n,0),new ae(0+n,0),new ae(0,0-r),new ae(0,0+r)];if("diamond"===t)return[o=new ae(0-n,0),new ae(0,0-r),new ae(0+n,0),new ae(0,0+r)];if("square"===t)return[o=new ae(0-n,0+r),new ae(0+n,0+r),new ae(0+n,0-r),new ae(0-n,0-r)];if("rectangle"===t)return[o=new ae(0,0),o.add(e,0),o.add(e,i),o.add(0,i)];if("x"===t)return[o=new ae(0-n,0+r),new ae(0+n,0-r),new ae(0+n,0+r),new ae(0-n,0-r)];if("bar"===t)return[o=new ae(0-n,0-i),new ae(0+n,0-i),new ae(0+n,0),new ae(0-n,0)];if("pin"===t){var s=i*Math.atan(n/r);return[o=new ae(0,0),new ae(0-s,0-i),new ae(0+s,0-i),new ae(0,0)]}return[]},e}(hr),lr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getPlacement=function(){return"point"},e.prototype.getDxDy=function(){return new ae(0,0)},e.prototype.symbolize=function(t){var e=this.geometry,i=e.getLayer();if(e.options.debug||!i||i.options.debug){var r=this.getMap();if(r&&!r.isZooming()){var n=i.options.debugOutline;t.strokeStyle=n,t.fillStyle=n;var o=this.getPainter().getContainerExtent().toArray();ti.polygon(t,[o],1,0);for(var s=this._getRenderContainerPoints(),a=this.geometry.getId(),h=ur._getVectorPoints("cross",10,10),u=0;u<s.length;u++){var l=s[u];g(a)||ti.fillText(t,a,l.add(8,-4),n);for(var p=[],c=0;c<h.length;c++)p.push(h[c].add(l));ti.path(t,p.slice(0,2),1),ti.path(t,p.slice(2,4),1)}}}},e}(hr),pr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,r,n));return o.style=o._defineStyle(o.translate()),o}return c(e,t),e.test=function(t){return!!t&&!g(t.markerFile)},e.prototype.symbolize=function(t,e){var i=this.style;if(this.painter.isHitTesting()||0!==i.markerWidth&&0!==i.markerHeight&&0!==i.markerOpacity){var r=this._getRenderContainerPoints();if(V(r)){var n=this._getImage(e);if(n){this._prepareContext(t);var o=i.markerWidth,s=i.markerHeight;if(!m(o)||!m(s)){o=n.width,s=n.height,i.markerWidth=o,i.markerHeight=s;var a=[i.markerFile,i.markerWidth,i.markerHeight];e.isResourceLoaded(a)||e.addResource(a,n);var h=this.getPainter();h.isSpriting()||h.removeCache()}var u=void 0;"path"!==this.symbol.markerType&&m(i.markerOpacity)&&i.markerOpacity<1&&(u=t.globalAlpha,t.globalAlpha*=i.markerOpacity);for(var l=we(new he(o,s),i.markerHorizontalAlignment,i.markerVerticalAlignment),p=0,c=r.length;p<c;p++){var f=r[p],d=this._rotate(t,f,this._getRotationAt(p));d&&(f=d),ti.image(t,n,f.x+l.x,f.y+l.y,o,s),d&&t.restore()}void 0!==u&&(t.globalAlpha=u)}else"undefined"!=typeof console&&console.warn("no img found for "+(this.style.markerFile||this._url[0]))}}},e.prototype._getImage=function(t){return t?t.getImage([this.style.markerFile,this.style.markerWidth,this.style.markerHeight]):null},e.prototype.getPlacement=function(){return this.symbol.markerPlacement},e.prototype.getRotation=function(){var t=this.style.markerRotation;return m(t)?-t*Math.PI/180:null},e.prototype.getDxDy=function(){var t=this.style,e=t.markerDx,i=t.markerDy;return new ae(e,i)},e.prototype.getFixedExtent=function(t){var e=this.style,i=e.markerFile,r=t?t.getImage(i):null,n=e.markerWidth||(r?r.width:0),o=e.markerHeight||(r?r.height:0),s=this.getDxDy(),a=we(new he(n,o),e.markerHorizontalAlignment,e.markerVerticalAlignment),h=new _i(s.add(0,0),s.add(n,o));h._add(a);var u=this.getRotation();return u&&(h=this._rotateExtent(h,u)),h},e.prototype.translate=function(){var t=this.symbol;return{markerFile:t.markerFile,markerOpacity:Z(t.markerOpacity,1),markerWidth:Z(t.markerWidth,null),markerHeight:Z(t.markerHeight,null),markerRotation:Z(t.markerRotation,0),markerDx:Z(t.markerDx,0),markerDy:Z(t.markerDy,0),markerHorizontalAlignment:Z(t.markerHorizontalAlignment,"middle"),markerVerticalAlignment:Z(t.markerVerticalAlignment,"top")}},e}(hr),cr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this));return o.symbol=i,o.geometry=r,o.painter=n,"Point"===r.type?f(o):(o.style=o._defineStyle(o.translate()),o)}return c(e,t),e.test=function(t,e){if(!t)return!1;if(e&&"Point"===e.type)return!1;for(var i in t){var r=i.slice(0,4);if("line"===r||"poly"===r)return!0}return!1},e.prototype.symbolize=function(t,e){var i=this.style;if(0!==i.polygonOpacity||0!==i.lineOpacity||this.painter.isHitTesting()){var r=this._getPaintParams();if(r){this._prepareContext(t);var n=Rt(i.lineColor),o="Polygon"===this.geometry.getJSONType()||"LineString"===this.geometry.type;!n||!i.lineColor.places&&o||(i.lineGradientExtent=this.getPainter().getContainerExtent()._expand(i.lineWidth)),Rt(i.polygonFill)&&(i.polygonGradientExtent=this.getPainter().getContainerExtent());var s=r[0];if("Polygon"===this.geometry.getJSONType()&&s.length>0&&Array.isArray(s[0][0])||"LineString"===this.geometry.type&&s.length>0&&Array.isArray(s[0]))for(var a=0;a<s.length;a++){this.prepareCanvas(t,i,e),n&&o&&!i.lineColor.places&&this._createGradient(t,s[a],i.lineColor);var h=[t,s[a]];r.length>1&&h.push.apply(h,r.slice(1)),h.push(i.lineOpacity,i.polygonOpacity,i.lineDasharray),this.geometry._paintOn.apply(this.geometry,h)}else{this.prepareCanvas(t,i,e),n&&o&&!i.lineColor.places&&this._createGradient(t,s,i.lineColor);var u=[t];u.push.apply(u,r),u.push(i.lineOpacity,i.polygonOpacity,i.lineDasharray),this.geometry._paintOn.apply(this.geometry,u)}t.setLineDash&&Array.isArray(i.lineDasharray)&&t.setLineDash([])}}},e.prototype.get2DExtent=function(){var t=this.getMap(),e=this.geometry._getPrjExtent();if(!e)return null;this._extMin&&this._extMax||(this._extMin=new di(0,0),this._extMax=new di(0,0)),this._extMin.x=e.xmin,this._extMin.y=e.ymin,this._extMax.x=e.xmax,this._extMax.y=e.ymax;var i=t._prjToPoint(this._extMin),r=t._prjToPoint(this._extMax);return this._pxExtent?(this._pxExtent.xmin=Math.min(i.x,r.x),this._pxExtent.xmax=Math.max(i.x,r.x),this._pxExtent.ymin=Math.min(i.y,r.y),this._pxExtent.ymax=Math.max(i.y,r.y)):this._pxExtent=new _i(i,r),this._pxExtent},e.prototype.getFixedExtent=function(){var t=this.style.lineWidth/2;return new _i(-t,-t,t,t)},e.prototype._getPaintParams=function(){return this.getPainter().getPaintParams(this.style.lineDx,this.style.lineDy)},e.prototype.translate=function(){var t=this.symbol,e={lineColor:Z(t.lineColor,"#000"),lineWidth:Z(t.lineWidth,2),lineOpacity:Z(t.lineOpacity,1),lineDasharray:Z(t.lineDasharray,[]),lineCap:Z(t.lineCap,"butt"),lineJoin:Z(t.lineJoin,"miter"),linePatternFile:Z(t.linePatternFile,null),lineDx:Z(t.lineDx,0),lineDy:Z(t.lineDy,0),polygonFill:Z(t.polygonFill,null),polygonOpacity:Z(t.polygonOpacity,1),polygonPatternFile:Z(t.polygonPatternFile,null),polygonPatternDx:Z(t.polygonPatternDx,0),polygonPatternDy:Z(t.polygonPatternDy,0),linePatternDx:Z(t.linePatternDx,0),linePatternDy:Z(t.linePatternDy,0)};return 0===e.lineWidth&&(e.lineOpacity=0),"LineString"!==this.geometry.type||e.polygonFill||(e.polygonFill=e.lineColor),e},e.prototype._createGradient=function(t,e,i){if(Array.isArray(e)){var r=e.length,n=t.createLinearGradient(e[0].x,e[0].y,e[r-1].x,e[r-1].y);i.colorStops.forEach(function(t){n.addColorStop.apply(n,t)}),t.strokeStyle=n}},e}(ar),fr="___text_symbol_cache",dr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,r,n));if(o._dynamic=Pt(i),o.style=o._defineStyle(o.translate()),0===o.style.textWrapWidth)return f(o);o.strokeAndFill=o._defineStyle(o.translateLineAndFill(o.style));var s=xe(o.style.textName,o.geometry.getProperties());return o._dynamic||(o._cacheKey=function(t,e){var i=[t];for(var r in e)e.hasOwnProperty(r)&&r.length>4&&"text"===r.substring(0,4)&&i.push(r+"="+e[r]);return i.join("-")}(s,o.style)),o._descText(s),o}return c(e,t),e.test=function(t){return!!t&&!g(t.textName)},e.prototype.symbolize=function(t,e){if(this.painter.isHitTesting()||0!==this.style.textSize&&(this.style.textOpacity||this.style.textHaloRadius&&this.style.textHaloOpacity)&&0!==this.style.textWrapWidth){var i=this._getRenderContainerPoints();if(V(i)){var r=this.style,n=this.strokeAndFill,o=xe(this.style.textName,this.geometry.getProperties());this._descText(o),this._prepareContext(t),this.prepareCanvas(t,n,e),ti.prepareCanvasFont(t,r);for(var s=0,a=i.length;s<a;s++){var h=i[s],u=this._rotate(t,h,this._getRotationAt(s));u&&(h=u),ti.text(t,o,h,r,this.textDesc),u&&t.restore()}}}},e.prototype.getPlacement=function(){return this.symbol.textPlacement},e.prototype.getRotation=function(){var t=this.style.textRotation;return m(t)?-t*Math.PI/180:null},e.prototype.getDxDy=function(){var t=this.style;return new ae(t.textDx,t.textDy)},e.prototype.getFixedExtent=function(){var t=this.getDxDy(),e=this.style,i=this.textDesc.size,r=we(i,e.textHorizontalAlignment,e.textVerticalAlignment),n=r.x,o=r.y;if(e.textHaloRadius){var s=e.textHaloRadius;i=i.add(2*s,2*s)}var a=new _i(t.add(n,o),t.add(n+i.width,o+i.height)),h=this.getRotation();return h&&(a=this._rotateExtent(a,h)),a},e.prototype.translate=function(){var t=this.symbol,e={textName:t.textName,textFaceName:Z(t.textFaceName,"monospace"),textWeight:Z(t.textWeight,"normal"),textStyle:Z(t.textStyle,"normal"),textSize:Z(t.textSize,10),textFont:Z(t.textFont,null),textFill:Z(t.textFill,"#000"),textOpacity:Z(t.textOpacity,1),textHaloFill:Z(t.textHaloFill,"#ffffff"),textHaloRadius:Z(t.textHaloRadius,0),textHaloOpacity:Z(t.textHaloOpacity,1),textWrapWidth:Z(t.textWrapWidth,null),textWrapCharacter:Z(t.textWrapCharacter,"\n"),textLineSpacing:Z(t.textLineSpacing,0),textDx:Z(t.textDx,0),textDy:Z(t.textDy,0),textHorizontalAlignment:Z(t.textHorizontalAlignment,"middle"),textVerticalAlignment:Z(t.textVerticalAlignment,"middle"),textAlign:Z(t.textAlign,"center"),textRotation:Z(t.textRotation,0),textMaxWidth:Z(t.textMaxWidth,0),textMaxHeight:Z(t.textMaxHeight,0)};return e.textMaxWidth>0&&(!e.textWrapWidth||e.textWrapWidth>e.textMaxWidth)&&(e.textWrapWidth||(e.textMaxHeight=1),e.textWrapWidth=e.textMaxWidth),e},e.prototype.translateLineAndFill=function(t){return{lineColor:t.textHaloRadius?t.textHaloFill:t.textFill,lineWidth:t.textHaloRadius,lineOpacity:t.textOpacity,lineDasharray:null,lineCap:"butt",lineJoin:"round",polygonFill:t.textFill,polygonOpacity:t.textOpacity}},e.prototype._descText=function(t){this._dynamic?this.textDesc=this._measureText(t):(this.textDesc=this._loadFromCache(),this.textDesc||(this.textDesc=this._measureText(t),this._storeToCache(this.textDesc)))},e.prototype._measureText=function(t){var e=this.style.textMaxHeight,i=Ce(t,this.style);return e&&e<i.size.height&&(i.size.height=e),i},e.prototype._storeToCache=function(t){S||(this.geometry[fr]||(this.geometry[fr]={}),this.geometry[fr][this._cacheKey]={desc:t,active:!0})},e.prototype._loadFromCache=function(){if(!this.geometry[fr])return null;var t=this.geometry[fr][this._cacheKey];return t?(t.active=!0,t.desc):null},e}(hr);dr.CACHE_KEY=fr;var yr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,r,n));return o.style=o._defineStyle(o.translate()),g(o.style.markerWidth)&&(o.style.markerWidth=80),g(o.style.markerHeight)&&(o.style.markerHeight=80),oe.gecko?o._url=[Et(i,o.style.markerWidth,o.style.markerHeight),o.style.markerWidth,o.style.markerHeight]:o._url=[Et(i),i.markerWidth,i.markerHeight],o}return c(e,t),e.test=function(t){return!!t&&!(!g(t.markerFile)||"path"!==t.markerType)},e.prototype._prepareContext=function(){},e.prototype._getImage=function(t){if(t&&t.isResourceLoaded(this._url))return t.getImage(this._url);var e=new Image;return e.src=this._url[0],t&&t.addResource(this._url,e),e},e}(pr),gr={lineWidth:1,polygonFill:"#fff",polygonOpacity:.5},mr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,r,n));return o.style=r.getLayer().options.drawAltitude,o.style&&v(o.style)||(o.style={lineWidth:2}),o.style.lineWidth||(o.style.lineWidth=0),o.dxdy=o._defineStyle({dx:i.textDx||i.markerDx,dy:i.textDy||i.markerDy}),o}return c(e,t),e.test=function(t,e){if(!e.getLayer())return!1;var i=e.getJSONType();return"Marker"===i||"LineString"===i},e.prototype.symbolize=function(t){var e=this.geometry.getLayer();if(e.options.drawAltitude){var i=this.geometry.getProperties();if(i&&i[e.options.altitudeProperty]){var r=this._getStyle();if(this._prepareContext(t),"LineString"===this.geometry.type){var n=this._getPaintParams(r.lineDx,r.lineDy);if(!n)return;var o=this.getPainter().getPaintParams(r.lineDx,r.lineDy,!0)[0];this._drawLineAltitude(t,n[0],o)}else{var s=this._getRenderContainerPoints(),a=this._getRenderContainerPoints(!0);if(!s||0===s.length)return;this._drawMarkerAltitude(t,s[0],a[0])}}}},e.prototype.getDxDy=function(){var t=this.dxdy;return new ae(t.dx||0,t.dy||0)},e.prototype.get2DExtent=function(){return"LineString"===this.geometry.type?cr.prototype.get2DExtent.apply(this):t.prototype.get2DExtent.call(this)},e.prototype.getPlacement=function(){return"point"},e.prototype._getPaintParams=function(t,e){return this.getPainter().getPaintParams(t||0,e||0)},e.prototype._drawMarkerAltitude=function(t,e,i){var r=this._getStyle();this.prepareCanvas(t,r),ti.path(t,[e,i],r.lineOpacity,null,r.lineDasharray)},e.prototype._drawLineAltitude=function(t,e,i){var r=this._getStyle();if(e.length>0&&Array.isArray(e[0]))for(var n=0;n<e.length;n++)this._drawLine(t,e[n],i[n]);else this._drawLine(t,e,i);t.setLineDash&&Array.isArray(r.lineDasharray)&&t.setLineDash([])},e.prototype._drawLine=function(t,e,i){var r=this._getStyle();this.prepareCanvas(t,r);for(var n=0,o=e.length-1;n<o;n++)ti.polygon(t,[e[n],e[n+1],i[n+1],i[n]],r.lineOpacity,r.polygonOpacity,r.lineDasharray)},e.prototype._getStyle=function(){var t=this.geometry.getLayer().options.drawAltitude;return v(t)||(t=gr),t.lineWidth||(t.lineWidth=0,t.lineOpacity=0),t},e}(hr),_r=(Object.freeze({Symbolizer:sr,CanvasSymbolizer:ar,DebugSymbolizer:lr,ImageMarkerSymbolizer:pr,PointSymbolizer:hr,StrokeAndFillSymbolizer:cr,TextMarkerSymbolizer:dr,VectorMarkerSymbolizer:ur,VectorPathMarkerSymbolizer:yr,DrawAltitudeSymbolizer:mr}),[mr,cr,pr,yr,ur,dr]),vr=void 0,xr=function(t){function e(i){p(this,e);var r=f(this,t.call(this));return r.geometry=i,r.symbolizers=r._createSymbolizers(),r._altAtGLZoom=r._getGeometryAltitude(),r}return c(e,t),e.prototype.getMap=function(){return this.geometry.getMap()},e.prototype.getLayer=function(){return this.geometry.getLayer()},e.prototype._createSymbolizers=function(){var t=this.getSymbol(),e=[],i=_r,r=t;Array.isArray(t)||(r=[t]);for(var n=r.length-1;n>=0;n--)for(var o=r[n],s=i.length-1;s>=0;s--)if(i[s].test(o,this.geometry)){var a=new i[s](o,this.geometry,this);e.push(a),a instanceof hr&&(this._hasPoint=!0)}if(!e.length&&console){var h=this.geometry.getId();console.warn("invalid symbol for geometry("+(this.geometry?this.geometry.getType()+(h?":"+h:""):"")+") to draw : "+JSON.stringify(t))}return this._debugSymbolizer=new lr(t,this.geometry,this),e},e.prototype.hasPoint=function(){return!!this._hasPoint},e.prototype.getRenderPoints=function(t){return this._renderPoints||(this._renderPoints={}),t||(t="center"),this._renderPoints[t]||(this._renderPoints[t]=this.geometry._getRenderPoints(t)),this._renderPoints[t]},e.prototype.getPaintParams=function(t,e,i){var r=this.getMap(),n=this.geometry,o=r.getResolution(),s=0!==r.getPitch(),a=0!==r.getBearing(),h=this._cachedParams,u=n._paintAsPath&&n._paintAsPath();if(u&&this._unsimpledParams&&o<=this._unsimpledParams._res)h=this._unsimpledParams;else if(!h||h._res!==r.getResolution()||this._pitched!==s&&n._redrawWhenPitch()||this._rotated!==a&&n._redrawWhenRotate()){if(!(h=n._getPaintParams()))return null;h._res=o,!n._simplified&&u&&(this._unsimpledParams||(this._unsimpledParams=h),o>this._unsimpledParams._res&&(this._unsimpledParams._res=o)),this._cachedParams=h}if(!h)return null;this._pitched=s,this._rotated=a;var l=r.getGLScale(),p=[],c=h[0],f=r.getContainerExtent(),d=this._pointContainerPoints(c,t,e,i,!f.contains(this._hitPoint));if(!d)return null;p.push(d);for(var y=1,g=h.length;y<g;y++)m(h[y])||h[y]instanceof he?m(h[y])?p.push(h[y]/l):p.push(h[y].multi(1/l)):p.push(h[y]);return p},e.prototype._pointContainerPoints=function(t,e,i,r,n,o){if(!this.getContainerExtent())return null;var s=this.getMap(),a=s.getGLZoom(),h=this.containerOffset,u=void 0;function l(t,r){var n=s._pointToContainerPoint(t,a,r)._sub(h);return(e||i)&&n._add(e||0,i||0),n}var p=this.getAltitude();if(Array.isArray(t)){var c=this.geometry,f=void 0,d=(f=!n&&c.options.enableClip?this._clip(t,p):{points:t,altitude:p}).points;p=f.altitude,r&&(p=0);var y=p;u=[];for(var g=0,m=d.length;g<m;g++){var _=d[g];if(Array.isArray(_)){for(var v=[],x=0,w=_.length;x<w;x++){var b=_[x];Array.isArray(p)&&(y=p[g]?p[g][x]:0),v.push(l(b,y))}u.push(v)}else Array.isArray(p)&&(y="vertex-last"===o?p[p.length-1-g]:"line"===o?(p[g]+p[g+1])/2:p[g]),u.push(l(_,y))}}else t instanceof ae&&(r&&(p=0),u=s._pointToContainerPoint(t,a,p)._sub(h),(e||i)&&u._add(e,i));return u},e.prototype._clip=function(t,e){var i=this.getMap(),r=this.geometry,n=i.getGLZoom(),o=this.getSymbol().lineWidth;m(o)||(o=4);var s=i.getContainerExtent().expand(o).convertTo(function(t){return i._containerPointToPoint(t,n)});if(i.getPitch()>0&&e){var a=i.cameraLookAt,h=i.cameraPosition;s=s.combine(new ae(h)._add(G(a[0]-h[0]),G(a[1]-h[1])))}var u=t;if(this.get2DExtent().within(s))return{points:u,altitude:e};var l=r.options.smoothness;if(r.getShell&&this.geometry.getHoles&&!l)if(Array.isArray(t[0])){u=[];for(var p=0;p<t.length;p++){var c=ir(t[p],s);c.length&&u.push(c)}}else u=ir(t,s);else if("LineString"===r.getJSONType()){if(Array.isArray(t[0])){u=[];for(var f=0;f<t.length;f++)I(u,$i(t[f],s,!1,!!l))}else u=$i(t,s,!1,!!l);return this._interpolateSegAlt(u,t,e)}return{points:u,altitude:e}},e.prototype._interpolateSegAlt=function(t,e,i){if(!Array.isArray(i)){var r=function(t){return t.point};return{points:t.map(function(t){return Array.isArray(t)?t.map(r):t.point}),altitude:i}}var n=function t(e,i,r){if(!Array.isArray(r))return e;var n=[];for(var o=0,s=e.length;o<s;o++)if(Array.isArray(e[o]))n.push(t(e[o],i,r));else{var a=e[o];if(a.point.equals(i[a.index]))a.altitude=r[a.index],n.push(a);else{var h=void 0,u=void 0;0===a.index?(h=a.index,u=a.index+1):(h=a.index-1,u=a.index);var l=a.point.distanceTo(i[u]),p=l/(l+i[h].distanceTo(a.point)),c=W(r[h],r[u],1-p);a.altitude=c,n.push(a)}}return n}(t,e,i);return i=[],{points:n.map(function(t){if(Array.isArray(t)){var e=[],r=t.map(function(t){return e.push(t.altitude),t.point});return i.push(e),r}return i.push(t.altitude),t.point}),altitude:i}},e.prototype.getSymbol=function(){return this.geometry._getInternalSymbol()},e.prototype.paint=function(t,e,i){if(this.symbolizers){var r=this.getLayer()._getRenderer();if(r&&r.context&&(!t||t.intersects(this.get2DExtent(r.resources)))){var n=this.getMap(),o=this.getMinAltitude(),s=n.getFrustumAltitude();if(!(o&&s&&s<o)){this.containerOffset=i||n._pointToContainerPoint(r.southWest)._add(0,-n.height),this._beforePaint();for(var a=e||r.context,h=[a,r.resources],u=this.symbolizers.length-1;u>=0;u--)this._prepareShadow(a,this.symbolizers[u].symbol),this.symbolizers[u].symbolize.apply(this.symbolizers[u],h);this._afterPaint(),this._painted=!0,this._debugSymbolizer.symbolize.apply(this._debugSymbolizer,h)}}}},e.prototype.getSprite=function(t,e){if("Point"!==this.geometry.type)return null;if(this._spriting=!0,!this._sprite&&this.symbolizers.length>0){var i=new _i;this.symbolizers.forEach(function(e){var r=e.getFixedExtent(t);i._combine(r)});var r=i.getMin().multi(-1),n=e||(this.getMap()?this.getMap().CanvasClass:null),o=ti.createCanvas(i.getWidth(),i.getHeight(),n),s=void 0;this._renderPoints&&(s=this._renderPoints);for(var a=o.getContext("2d"),h=[a,t],u=this.symbolizers.length-1;u>=0;u--){var l=this.symbolizers[u].getDxDy();this._renderPoints={center:[[r.add(l)]]},this._prepareShadow(a,this.symbolizers[u].symbol),this.symbolizers[u].symbolize.apply(this.symbolizers[u],h)}s&&(this._renderPoints=s),this._sprite={canvas:o,offset:i.getCenter()}}return this._spriting=!1,this._sprite},e.prototype.isSpriting=function(){return!!this._spriting},e.prototype.hitTest=function(t,e){(!e||e<.5)&&(e=.5),vr||(vr=ti.createCanvas(1,1)),ti.setHitTesting(!0),vr.width=vr.height=2*e;var i=vr.getContext("2d");this._hitPoint=t.sub(e,e);try{this.paint(null,i,this._hitPoint)}catch(t){throw t}finally{ti.setHitTesting(!1)}delete this._hitPoint;for(var r=i.getImageData(0,0,vr.width,vr.height).data,n=3,o=r.length;n<o;n+=4)if(r[n]>0)return!0;return!1},e.prototype.isHitTesting=function(){return!!this._hitPoint},e.prototype._prepareShadow=function(t,e){e.shadowBlur?(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor||"#000",t.shadowOffsetX=e.shadowOffsetX||0,t.shadowOffsetY=e.shadowOffsetY||0):t.shadowBlur&&(t.shadowBlur=null,t.shadowColor=null,t.shadowOffsetX=null,t.shadowOffsetY=null)},e.prototype._eachSymbolizer=function(t,e){if(this.symbolizers){e||(e=this);for(var i=this.symbolizers.length-1;i>=0;i--)t.apply(e,[this.symbolizers[i]])}},e.prototype.get2DExtent=function(t){this._verifyProjection();var e=this.getMap();t=t||this.getLayer()._getRenderer().resources;var i=e.getZoom();if((!this._extent2D||this._extent2D._zoom!==i)&&(delete this._extent2D,delete this._fixedExtent,this.symbolizers)){for(var r=this._extent2D=new _i,n=this._fixedExtent=new _i,o=this.symbolizers.length-1;o>=0;o--){var s=this.symbolizers[o];r._combine(s.get2DExtent()),s.getFixedExtent&&n._combine(s.getFixedExtent(t))}r._zoom=i}return this._extent2D.add(this._fixedExtent)},e.prototype.getContainerExtent=function(){this._verifyProjection();var t=this.getMap(),e=t.getZoom(),i=t.getGLScale();this._extent2D&&this._extent2D._zoom===e||this.get2DExtent();var r=this.getMinAltitude(),n=t.getFrustumAltitude();if(r&&n&&n<r)return null;var o=this._extent2D.convertTo(function(n){return t._pointToContainerPoint(n,e,r/i)}),s=this.getMaxAltitude();if(s!==r){var a=this._extent2D.convertTo(function(r){return t._pointToContainerPoint(r,e,s/i)});o._combine(a)}return o&&o._add(this._fixedExtent),this.geometry.options.smoothness&&o._expand(.15*o.getWidth()),o},e.prototype.getFixedExtent=function(){var t=this.getMap().getZoom();return this._extent2D&&this._extent2D._zoom===t||this.get2DExtent(),this._fixedExtent},e.prototype.setZIndex=function(t){this._eachSymbolizer(function(e){e.setZIndex(t)})},e.prototype.show=function(){this._painted?(this.removeCache(),this._eachSymbolizer(function(t){t.show()})):this.getLayer().isCanvasRender()||this.paint()},e.prototype.hide=function(){this._eachSymbolizer(function(t){t.hide()})},e.prototype.repaint=function(){this._altAtGLZoom=this._getGeometryAltitude(),this.removeCache();var t=this.getLayer();if(t){var e=t.getRenderer();e&&e.setToRedraw()&&e.setToRedraw()}},e.prototype.refreshSymbol=function(){this.removeCache(),this._removeSymbolizers(),this.symbolizers=this._createSymbolizers()},e.prototype.remove=function(){this.removeCache(),this._removeSymbolizers()},e.prototype._removeSymbolizers=function(){this._eachSymbolizer(function(t){delete t.painter,t.remove()}),delete this.symbolizers},e.prototype.removeCache=function(){delete this._renderPoints,delete this._paintParams,delete this._sprite,delete this._extent2D,delete this._fixedExtent,delete this._cachedParams,delete this._unsimpledParams,this.geometry&&delete this.geometry[dr.CACHE_KEY]},e.prototype.getAltitude=function(){return this._getAltitudeProperty()!==this._propAlt&&(this._altAtGLZoom=this._getGeometryAltitude()),this._altAtGLZoom?this._altAtGLZoom:0},e.prototype.getMinAltitude=function(){return this.minAltitude?this.minAltitude:0},e.prototype.getMaxAltitude=function(){return this.maxAltitude?this.maxAltitude:0},e.prototype._getGeometryAltitude=function(){var t=this;if(!this.getMap())return 0;var e=this._getAltitudeProperty();if(this._propAlt=e,!e)return this.minAltitude=this.maxAltitude=0,0;var i=this.geometry.getCenter();return Array.isArray(e)?(this.minAltitude=Number.MAX_VALUE,this.maxAltitude=Number.MIN_VALUE,e.map(function(e){var r=t._meterToPoint(i,e);return r<t.minAltitude&&(t.minAltitude=r),r>t.maxAltitude&&(t.maxAltitude=r),r})):(this.minAltitude=this.maxAltitude=this._meterToPoint(i,e),this.minAltitude)},e.prototype._meterToPoint=function(t,e){var i=this.getMap(),r=i.getGLZoom(),n=i.locate(t,e,0),o=i.coordToPoint(t,r),s=i.coordToPoint(n,r);return Math.abs(s.x-o.x)*G(e)},e.prototype._getAltitudeProperty=function(){var t=this.geometry,e=t.getLayer().options,i=t.getProperties();return e.enableAltitude&&i?i[e.altitudeProperty]:0},e.prototype._verifyProjection=function(){var t=this.geometry._getProjection();this._projCode&&this._projCode!==t.code&&this.removeCache(),this._projCode=t.code},e.prototype._beforePaint=function(){var t=this.geometry[dr.CACHE_KEY];if(t)for(var e in t)C(t,e)&&(t[e].active=!1)},e.prototype._afterPaint=function(){var t=this.geometry[dr.CACHE_KEY];if(t)for(var e in t)C(t,e)&&(t[e].active||delete t[e])},e}(ai);var wr=function(t){function e(i){p(this,e);var r=f(this,t.call(this));return r.geometry=i,r}return c(e,t),e.prototype._eachPainter=function(t){for(var e=this.geometry.getGeometries(),i=void 0,r=0,n=e.length;r<n&&(!(i=e[r]._getPainter())||!i||!1!==t.call(this,i));r++);},e.prototype.paint=function(t){this.geometry&&this._eachPainter(function(e){e.paint(t)})},e.prototype.get2DExtent=function(t){var e=new _i;return this._eachPainter(function(i){e=e.combine(i.get2DExtent(t))}),e},e.prototype.getContainerExtent=function(){var t=new _i;return this._eachPainter(function(e){t=t.combine(e.getContainerExtent())}),t},e.prototype.remove=function(){var t=arguments;this._eachPainter(function(e){e.remove.apply(e,t)})},e.prototype.setZIndex=function(){var t=arguments;this._eachPainter(function(e){e.setZIndex.apply(e,t)})},e.prototype.show=function(){var t=arguments;this._eachPainter(function(e){e.show.apply(e,t)})},e.prototype.hide=function(){var t=arguments;this._eachPainter(function(e){e.hide.apply(e,t)})},e.prototype.repaint=function(){var t=arguments;this._eachPainter(function(e){e.repaint.apply(e,t)})},e.prototype.refreshSymbol=function(){var t=arguments;this._eachPainter(function(e){e.refreshSymbol.apply(e,t)})},e.prototype.hasPoint=function(){var t=!1;return this._eachPainter(function(e){return!e.hasPoint()||(t=!0,!1)}),t},e.prototype.getMinAltitude=function(){var t=!0,e=0;return this._eachPainter(function(i){var r=i.getMinAltitude();(t||r<e)&&(t=!1,e=r)}),e},e.prototype.getMaxAltitude=function(){var t=0;return this._eachPainter(function(e){var i=e.getMaxAltitude();i>t&&(t=i)}),t},e}(ai),br=function(t){function e(i){p(this,e);var r=y({},i),n=r.symbol,o=r.properties,s=r.id;delete r.symbol,delete r.id,delete r.properties;var a=f(this,t.call(this,r));return n&&a.setSymbol(n),o&&a.setProperties(o),g(s)||a.setId(s),a}return c(e,t),e.prototype.getFirstCoordinate=function(){if("GeometryCollection"===this.type){var t=this.getGeometries();return t.length?t[0].getFirstCoordinate():null}var e=this.getCoordinates();if(!Array.isArray(e))return e;do{e=e[0]}while(Array.isArray(e)&&e.length>0);return e},e.prototype.getLastCoordinate=function(){if("GeometryCollection"===this.type){var t=this.getGeometries();return t.length?t[t.length-1].getLastCoordinate():null}var e=this.getCoordinates();if(!Array.isArray(e))return e;do{e=e[e.length-1]}while(Array.isArray(e)&&e.length>0);return e},e.prototype.addTo=function(t,e){return t.addGeometry(this,e),this},e.prototype.getLayer=function(){return this._layer?this._layer:null},e.prototype.getMap=function(){return this._layer?this._layer.getMap():null},e.prototype.getId=function(){return this._id},e.prototype.setId=function(t){var e=this.getId();return this._id=t,this._fireEvent("idchange",{old:e,new:t}),this},e.prototype.getProperties=function(){return this.properties?this.properties:this._getParent()?this._getParent().getProperties():null},e.prototype.setProperties=function(t){var e=this.properties;return this.properties=v(t)?y({},t):t,this._repaint(),this._fireEvent("propertieschange",{old:e,new:t}),this},e.prototype.getType=function(){return this.type},e.prototype.getSymbol=function(){var t=this._symbol;return t?Array.isArray(t)?It(t):y({},t):null},e.prototype.setSymbol=function(t){return this._symbol=this._prepareSymbol(t),this.onSymbolChanged(),this},e.prototype.updateSymbol=function(t){if(!t)return this;var e=this._getSymbol();return e=It(e||this._getInternalSymbol(),t),this.setSymbol(e)},e.prototype.getCenter=function(){return this._computeCenter(this._getMeasurer())},e.prototype.getExtent=function(){var t=this._getPrjExtent();if(t){var e=this._getProjection(),i=e.unproject(new di(t.xmin,t.ymin)),r=e.unproject(new di(t.xmax,t.ymax));return new mi(i,r,this._getProjection())}return this._computeExtent(this._getMeasurer())},e.prototype.getContainerExtent=function(){var t=this._getPainter();return t?t.getContainerExtent():null},e.prototype.getSize=function(){var t=this.getContainerExtent();return t?t.getSize():null},e.prototype.containsPoint=function(t,e){if(!this.getMap())throw new Error('The geometry is required to be added on a map to perform "containsPoint".');return t instanceof di&&(t=this.getMap().coordToContainerPoint(t)),this._containsPoint(t,e)},e.prototype._containsPoint=function(t,e){var i=this._getPainter();return!!i&&(g(e)&&this._hitTestTolerance&&(e=this._hitTestTolerance()),i.hitTest(t,e))},e.prototype.show=function(){if(this.options.visible=!0,this.getMap()){var t=this._getPainter();t&&t.show(),this._fireEvent("show")}return this},e.prototype.hide=function(){if(this.options.visible=!1,this.getMap()){this.onHide();var t=this._getPainter();t&&t.hide(),this._fireEvent("hide")}return this},e.prototype.isVisible=function(){if(!this.options.visible)return!1;var t=this._getInternalSymbol();if(!t)return!0;if(Array.isArray(t)){if(!t.length)return!0;for(var e=0,i=t.length;e<i;e++)if(g(t[e].opacity)||t[e].opacity>0)return!0;return!1}return g(t.opacity)||m(t.opacity)&&t.opacity>0},e.prototype.getZIndex=function(){return this.options.zIndex||0},e.prototype.setZIndex=function(t){var e=this.options.zIndex;return this.options.zIndex=t,this._fireEvent("zindexchange",{old:e,new:t}),this},e.prototype.setZIndexSilently=function(t){return this.options.zIndex=t,this},e.prototype.bringToFront=function(){var t=this.getLayer();if(!t||!t.getGeoMaxZIndex)return this;var e=t.getGeoMaxZIndex();return this.setZIndex(e+1),this},e.prototype.bringToBack=function(){var t=this.getLayer();if(!t||!t.getGeoMinZIndex)return this;var e=t.getGeoMinZIndex();return this.setZIndex(e-1),this},e.prototype.translate=function(t,e){if(g(t))return this;var i=new di(t,e);if(0===i.x&&0===i.y)return this;var r=this.getCoordinates();if(r)if(Array.isArray(r)){var n=H(r,function(t){return t.add(i)});this.setCoordinates(n)}else this.setCoordinates(r.add(i));return this},e.prototype.flash=function(t,e,i,r){return nt.call(this,t,e,i,r)},e.prototype.copy=function(){var t=this.toJSON(),i=e.fromJSON(t);return i.options.visible=!0,i},e.prototype.remove=function(){return this.getLayer()?(this._fireEvent("removestart"),this._unbind(),this._fireEvent("removeend"),this._fireEvent("remove"),this):this},e.prototype.toGeoJSONGeometry=function(){return this._exportGeoJSONGeometry()},e.prototype.toGeoJSON=function(t){t||(t={});var e={type:"Feature",geometry:null};if(g(t.geometry)||t.geometry){var i=this._exportGeoJSONGeometry();e.geometry=i}var r=this.getId();g(r)||(e.id=r);var n=void 0;return(g(t.properties)||t.properties)&&(n=this._exportProperties()),e.properties=n,e},e.prototype.toJSON=function(t){t||(t={});var e=this._toJSON(t);return y(e,this._exportGraphicOptions(t)),e},e.prototype.getLength=function(){return this._computeGeodesicLength(this._getMeasurer())},e.prototype.getArea=function(){return this._computeGeodesicArea(this._getMeasurer())},e.prototype.rotate=function(t,e){if("GeometryCollection"===this.type)return this.getGeometries().forEach(function(i){return i.rotate(t,e)}),this;e=e?new di(e):this.getCenter();var i=this._getMeasurer(),r=this.getCoordinates();if(!Array.isArray(r)){if(e.x!==r.x||e.y!==r.y){var n=i._rotate(r,e,t);this.setCoordinates(n)}return this}return H(r,function(r){return i._rotate(r,e,t)}),this.setCoordinates(r),this},e.prototype._getConnectPoints=function(){return[this.getCenter()]},e.prototype._initOptions=function(t){var e=y({},t),i=e.symbol,r=e.properties,n=e.id;delete e.symbol,delete e.id,delete e.properties,this.setOptions(e),i&&this.setSymbol(i),r&&this.setProperties(r),g(n)||this.setId(n)},e.prototype._bindLayer=function(t){if(this.getLayer())throw new Error("Geometry cannot be added to two or more layers at the same time.");this._layer=t,this._clearCache(),this._clearProjection()},e.prototype._prepareSymbol=function(t){if(Array.isArray(t)){for(var e=[],i=0;i<t.length;i++)e.push(Lt(this._checkAndCopySymbol(t[i])));return e}return t?Lt(t=this._checkAndCopySymbol(t)):null},e.prototype._checkAndCopySymbol=function(t){var e={};for(var i in t)h[i]&&x(t[i])?e[i]=+t[i]:e[i]=t[i];return e},e.prototype._getSymbol=function(){return this._symbol},e.prototype._setExternSymbol=function(t){return this._externSymbol=this._prepareSymbol(t),this.onSymbolChanged(),this},e.prototype._getInternalSymbol=function(){return this._symbol?this._symbol:this._externSymbol?this._externSymbol:this.options.symbol?this.options.symbol:null},e.prototype._getPrjExtent=function(){var t=this._getProjection();return this._verifyProjection(),!this._extent&&t&&(this._extent=this._computePrjExtent(t)),this._extent},e.prototype._unbind=function(){var t=this.getLayer();t&&(this._animPlayer&&this._animPlayer.finish(),this._clearHandlers(),this._unbindMenu(),this._unbindInfoWindow(),this.isEditing()&&this.endEdit(),this._removePainter(),this.onRemove&&this.onRemove(),t.onRemoveGeometry&&t.onRemoveGeometry(this),delete this._layer,delete this._internalId,delete this._extent)},e.prototype._getInternalId=function(){return this._internalId},e.prototype._setInternalId=function(t){this._internalId=t},e.prototype._getMeasurer=function(){return this._getProjection()?this._getProjection():qi.getProjectionInstance(this.options.defaultProjection)},e.prototype._getProjection=function(){var t=this.getMap();return t?t.getProjection():null},e.prototype._verifyProjection=function(){var t=this._getProjection();!this._projCode||t&&this._projCode===t.code||this._clearProjection(),this._projCode=t?t.code:null},e.prototype._getExternalResources=function(){return kt(this._getInternalSymbol())},e.prototype._getPainter=function(){return!this._painter&&this.getMap()&&(-1!==n.indexOf(this.type)?this._painter=new wr(this):this._painter=new xr(this)),this._painter},e.prototype._removePainter=function(){this._painter&&this._painter.remove(),delete this._painter},e.prototype._paint=function(t){this._painter&&this._painter.paint(t)},e.prototype._clearCache=function(){delete this._extent},e.prototype._clearProjection=function(){delete this._extent},e.prototype._repaint=function(){this._painter&&this._painter.repaint()},e.prototype.onHide=function(){this.closeMenu(),this.closeInfoWindow()},e.prototype.onShapeChanged=function(){this._clearCache(),this._repaint(),this._fireEvent("shapechange")},e.prototype.onPositionChanged=function(){this._clearCache(),this._repaint(),this._fireEvent("positionchange")},e.prototype.onSymbolChanged=function(){this._painter&&this._painter.refreshSymbol(),this._fireEvent("symbolchange")},e.prototype.onConfig=function(t){var e=void 0;t.properties&&(e=t.properties,delete t.properties);var i=!1;for(var r in t)if(t.hasOwnProperty(r)){var n=r.slice(0,5);if("arrow"===n||"smoot"===n){i=!0;break}}e?(this.setProperties(e),this._repaint()):i&&this._repaint()},e.prototype._setParent=function(t){t&&(this._parent=t)},e.prototype._getParent=function(){return this._parent},e.prototype._fireEvent=function(t,e){this.getLayer()&&this.getLayer()._onGeometryEvent&&(e||(e={}),e.type=t,e.target=this,this.getLayer()._onGeometryEvent(e)),this.fire(t,e)},e.prototype._toJSON=function(t){return{feature:this.toGeoJSON(t)}},e.prototype._exportGraphicOptions=function(t){var e={};return(g(t.options)||t.options)&&(e.options=this.config()),(g(t.symbol)||t.symbol)&&(e.symbol=this.getSymbol()),(g(t.infoWindow)||t.infoWindow)&&this._infoWinOptions&&(e.infoWindow=this._infoWinOptions),e},e.prototype._exportGeoJSONGeometry=function(){var t=this.getCoordinates(),e=di.toNumberArrays(t);return{type:this.getType(),coordinates:e}},e.prototype._exportProperties=function(){var t=null,e=this.getProperties();return g(e)||(t=v(e)?y({},e):e),t},e}(ui(oi(li(ai))));br.mergeOptions({id:null,visible:!0,editable:!0,cursor:null,defaultProjection:"EPSG:4326"});var Cr="mousedown mouseup mousemove click dblclick contextmenu touchstart touchmove touchend",Pr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addHooks=function(){var t=this.target,e=t._panels.allLayers||t._containerDOM;Xe(e,Cr,this._identifyGeometryEvents,this)},e.prototype.removeHooks=function(){var t=this.target,e=t._panels.allLayers||t._containerDOM;Ke(e,Cr,this._identifyGeometryEvents,this)},e.prototype._identifyGeometryEvents=function(t,e){var i=this.target;if(!i.isInteracting()&&!i._ignoreEvent(t)){var r=i._getLayers(function(t){return!(!t.identify||!t.options.geometryEvents)});if(r.length){var n=null,o=e||t.type;if("mousedown"===o||"touchstart"===o&&1===t.touches.length)this._mouseDownTime=d();else if(("click"===o||"touchend"===o)&&this._mouseDownTime){var s=this._mouseDownTime;if(delete this._mouseDownTime,d()-s>300){if("click"===o)return}else"touchend"===o&&(n="click")}var a=t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t;if(a){var h=Ge(a,i._containerDOM),u=i.containerPointToCoordinate(h);"touchstart"===o&&De(t);var l=null,p={includeInternals:!0,filter:function(e){if(!(e instanceof br))return!1;var i=e._getEventTypeToFire(t);if("mousemove"===o){if(!l&&e.options.cursor&&(l=e.options.cursor),!e.listens("mousemove")&&!e.listens("mouseover")&&!e.listens("mouseenter"))return!1}else if(!e.listens(i)&&!e.listens(n))return!1;return!0},count:1,coordinate:u,onlyVisible:i.options.onlyVisibleGeometryEvents,layers:r},c=function(e){var r=!0;if("mousemove"===o){var s={};if(e.length>0)for(var a=e.length-1;a>=0;a--){var h=e[a];if(h instanceof br){var u=h._getInternalId();s[u]=h,h._onEvent(t),this._prevOverGeos&&this._prevOverGeos.geomap[u]||h._onEvent(t,"mouseenter"),r=h._onEvent(t,"mouseover")}}i._setPriorityCursor(l);var p=this._prevOverGeos&&this._prevOverGeos.geos;if(this._prevOverGeos={geos:e,geomap:s},p&&p.length>0)for(var c=p.length-1;c>=0;c--){var f=p[c];if(f instanceof br){var d=p[c]._getInternalId();s[d]||(r=f._onEvent(t,"mouseout"))}}}else{if(!e||!e.length)return;for(var y=e.length-1;y>=0;y--)if(e[y]instanceof br){r=e[y]._onEvent(t),n&&e[y]._onEvent(t,n);break}}!1===r&&Ie(t)}.bind(this);this._queryIdentifyTimeout&&E(this._queryIdentifyTimeout),"mousemove"===o||"touchmove"===o?this._queryIdentifyTimeout=O(function(){i.isInteracting()||i.identify(p,c)}):i.identify(p,c)}}}},e}(si);Xi.mergeOptions({geometryEvents:!0,onlyVisibleGeometryEvents:!0}),Xi.addOnLoadHook("addHandler","geometryEvents",Pr);var Mr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addHooks=function(){Ae(this.target._containerDOM,"mousewheel",this._onWheelScroll,this)},e.prototype.removeHooks=function(){Re(this.target._containerDOM,"mousewheel",this._onWheelScroll)},e.prototype._onWheelScroll=function(t){var e=this,i=this.target;if(i._ignoreEvent(t)||!i.options.zoomable)return!1;if(De(t),Ie(t),this._zooming)return this._requesting++,!1;this._requesting=0;var r=i._containerDOM,n=(t.wheelDelta?t.wheelDelta:t.detail)>0?1:-1;t.detail&&(n*=-1);var o=i.getZoom(),s=o+n;if((s=i._checkZoom(n>0?Math.ceil(s):Math.floor(s)))===o)return!1;this._zooming=!0;var a=i._checkZoomOrigin(Ge(t,r));this._delta||(i.onZoomStart(null,a),this._origin=a,this._delta=n,this._startZoom=i.getZoom());return i.animateTo({zoom:s-1*this._delta/2,around:this._origin},{continueOnViewChanged:!0,easing:"linear",duration:90,wheelZoom:!0},function(r){"finished"===r.state.playState&&(e._requesting<1||Math.abs(s-e._startZoom)>2||s===i.getMaxZoom()||s===i.getMinZoom()?(i.animateTo({zoom:s,around:e._origin},{continueOnViewChanged:!0,duration:100},function(t){"finished"===t.state.playState&&setTimeout(function(){delete e._zooming,delete e._requesting},200)}),delete e._startZoom,delete e._origin,delete e._delta,e._requesting=0):g(e._requesting)||(delete e._zooming,e._onWheelScroll(t)))}),!1},e}(si);Xi.mergeOptions({scrollWheelZoom:!0}),Xi.addOnLoadHook("addHandler","scrollWheelZoom",Mr);var Tr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addHooks=function(){Ae(this.target.getContainer(),"touchstart",this._onTouchStart,this)},e.prototype.removeHooks=function(){Re(this.target.getContainer(),"touchstart",this._onTouchStart)},e.prototype._onTouchStart=function(t){var e=this.target;if(t.touches&&2===t.touches.length&&!e.isInteracting()){var i=e.getContainer(),r=Ge(t.touches[0],i),n=Ge(t.touches[1],i);this.preY=r.y,this._startP1=r,this._startP2=n,this._startDist=r.distanceTo(n),this._startVector=r.sub(n),this._startZoom=e.getZoom(),this._startBearing=e.getBearing(),Ae(document,"touchmove",this._onTouchMove,this),Ae(document,"touchend",this._onTouchEnd,this),De(t),e._fireEvent("touchactstart")}},e.prototype._onTouchMove=function(t){var e=this.target;if(t.touches&&2===t.touches.length){var i=e.getContainer(),r=Ge(t.touches[0],i),n=Ge(t.touches[1],i),o=r.sub(this._startP1),s=n.sub(this._startP2),a=r.sub(n),h=r.distanceTo(n)/this._startDist,u=180*a.angleWith(this._startVector)/Math.PI,l=.4*((this.preY||r.y)-r.y);this.preY=r.y;var p={domEvent:t,mousePos:[r,n]};if(this.mode||(e.options.touchRotate&&Math.abs(u)>8?this.mode=e.options.touchZoomRotate?"rotate_zoom":"rotate":e.options.touchPitch&&o.y*s.y>0&&Math.abs(o.y)>10&&Math.abs(s.y)>10?this.mode="pitch":e.options.zoomable&&e.options.touchZoom&&Math.abs(1-h)>.15&&(this.mode=e.options.touchZoomRotate&&e.options.touchRotate?"rotate_zoom":"zoom"),this._startTouching(p)),"zoom"===this.mode||"rotate_zoom"===this.mode){this._scale=h;var c=e._getResolution(this._startZoom)/h,f=e.getZoomFromRes(c);e.onZooming(f,this._Origin)}"rotate"===this.mode||"rotate_zoom"===this.mode?(e.setBearing(this._startBearing+u),e.onDragRotating(p)):"pitch"===this.mode&&(e.setPitch(e.getPitch()+l),e.onDragRotating(p)),e._fireEvent("touchactinging")}},e.prototype._startTouching=function(t){var e=this.target;if("zoom"===this.mode||"rotate_zoom"===this.mode){var i=e.getSize();this._Origin=new ae(i.width/2,i.height/2),e.onZoomStart(null,this._Origin)}"rotate"!==this.mode&&"pitch"!==this.mode&&"rotate_zoom"!==this.mode||e.onDragRotateStart(t)},e.prototype._onTouchEnd=function(t){delete this.preY;var e=this.target;if(Ke(document,"touchmove",this._onTouchMove,this),Ke(document,"touchend",this._onTouchEnd,this),"zoom"===this.mode||"rotate_zoom"===this.mode){var i=this._scale,r=e._getResolution(this._startZoom)/i,n=e.getZoomFromRes(r);e.onZoomEnd(n,this._Origin)}"pitch"!==this.mode&&"rotate"!==this.mode&&"rotate_zoom"!==this.mode||e.onDragRotateEnd({domEvent:t}),delete this.mode,e._fireEvent("touchactend")},e}(si);Xi.mergeOptions({touchGesture:!0,touchZoom:!0,touchPitch:!0,touchRotate:!0,touchZoomRotate:!1}),Xi.addOnLoadHook("addHandler","touchGesture",Tr);var Sr={in:function(t){return Math.pow(t,2)},out:function(t){return 1-Sr.in(1-t)},inAndOut:function(t){return 3*t*t-2*t*t*t},linear:function(t){return t},upAndDown:function(t){return t<.5?Sr.inAndOut(2*t):1-Sr.inAndOut(2*(t-.5))}},Or=function t(e,i){p(this,t),this.state=e,this.styles=i},Er=function t(e,i,r){p(this,t),this._animation=e,this.options=i,this._onFrame=r,this.playState="idle",this.ready=!0,this.finished=!1},kr={speed:{slow:2e3,normal:1e3,fast:500},_resolveStyles:function(t){if(!t)return null;function e(t){if(!Array.isArray(t))return kr._resolveStyles(t);for(var e=[],i=[],r=[],n=0;n<t.length;n++){var o=kr._resolveStyles(t[n]);o&&(e.push(o[0]),i.push(o[1]),r.push(o[2]))}return e.length?[e,i,r]:null}function i(t){var e=t,i=void 0;Array.isArray(t)||(e=m(t)?[0,t]:t instanceof ae||t instanceof di?[new(i=t.constructor)(0,0),t]:[t,t]);var r=e[0],n=e[1];return m(r)&&m(n)?r===n?null:[r,n-r,n]:Array.isArray(r)||r instanceof di||r instanceof ae?(Array.isArray(r)?(r=new di(r),n=new di(n)):(r=new(i=r.constructor)(r),n=new i(n)),r.equals(n)?null:[r,n.sub(r),n]):[r,0,n]}var r,n={},o={},s={};for(var a in t)if(t.hasOwnProperty(a)){var h=t[a];if(!h)continue;if(Array.isArray(h)&&(g(h[0])||g(h[1])))continue;var u=void 0;r=h,(u=!Array.isArray(r)&&r.constructor===Object||Array.isArray(r)&&r[0].constructor===Object?e(h):i(h))&&(o[a]=u[0],n[a]=u[1],s[a]=u[2])}return[o,n,s]},framing:function(t,e){e||(e={});var i=e.easing?Sr[e.easing]:Sr.linear;i||(i=Sr.linear);var r=void 0,n=void 0,o=void 0;(t=kr._resolveStyles(t))&&(n=t[0],r=t[1],o=t[2]);return function(t,e){var s=void 0,a=void 0;if(t<0)s={playState:"idle",delta:0},a=n;else if(t<e){var h=i(t/e);s={playState:"running",delta:h},a=function t(e,i,r){if(!i||!r)return null;var n={};for(var s in r)if(r.hasOwnProperty(s)){if(i[s]===o[s]){n[s]=i[s];continue}var a=i[s],h=r[s];if(m(h))n[s]=a+e*h;else if(Array.isArray(h)){for(var u=[],l=0;l<h.length;l++)u.push(t(e,a[l],h[l]));n[s]=u}else h.constructor===Object?n[s]=t(e,a,h):(a instanceof ae||a instanceof di)&&(n[s]=a.add(h.multi(e)))}return n}(h,n,r)}else s={playState:"finished",delta:1},a=o;return s.startStyles=n,s.destStyles=o,s.progress=t,s.remainingMs=e-t,new Or(s,a)}},_requestAnimFrame:function(t){this._frameQueue||(this._frameQueue=[]),this._frameQueue.push(t),this._a()},_a:function(){this._animationFrameId||(this._animationFrameId=O(kr._frameFn))},_run:function(){if(this._frameQueue.length){var t=this._frameQueue;this._frameQueue=[];for(var e=0,i=t.length;e<i;e++)t[e]();this._frameQueue.length?this._animationFrameId=O(kr._frameFn):delete this._animationFrameId}},animate:function(t,e,i){e||(e={});var r=kr.framing(t,e);return new Er(r,e,i)}};kr._frameFn=kr._run.bind(kr),y(Er.prototype,{_prepare:function(){var t=this.options,e=t.speed||t.duration;x(e)&&((e=kr.speed[e])||(e=+e)),e||(e=kr.speed.normal),this.duration=e,this._framer=t.framer||kr._requestAnimFrame.bind(kr)},play:function(){if("idle"!==this.playState&&"paused"!==this.playState)return this;"idle"===this.playState&&(this.currentTime=0,this._prepare());var t=d();if(!this.startTime){var e=this.options;this.startTime=e.startTime?e.startTime:t}return this._playStartTime=Math.max(t,this.startTime),"paused"===this.playState&&(this._playStartTime-=this.currentTime),this.playState="running",this._run(),this},pause:function(){return"paused"===this.playState?this:(this.playState="paused",this._run(),this)},cancel:function(){return"idle"===this.playState?this:(this.playState="idle",this.finished=!1,this._run(),this)},finish:function(){return"finished"===this.playState?this:(this.playState="finished",this.finished=!0,this._run(),this)},reverse:function(){},_run:function(){var t=this,e=this._onFrame,i=d(),r=i-this._playStartTime;if(this.options.repeat&&r>=this.duration&&(this._playStartTime=i,r=0),"running"===this.playState){var n=this._animation(r,this.duration);this.playState=n.state.playState,"idle"===this.playState?this.startTime>i&&setTimeout(this._run.bind(this),this.startTime-i):"running"===this.playState?this._framer(function(){"running"===t.playState&&(t.currentTime=r,e&&e(n),t._run())}):"finished"===this.playState&&(this.finished=!0,e&&e(n))}else if(e){"finished"===this.playState?r=this.duration:"idle"===this.playState&&(r=0);var o=this._animation(r,this.duration);o.state.playState=this.playState,e(o)}}});Object.freeze({Animation:kr,Easing:Sr,Player:Er,Frame:Or});var Lr=Gi(function(t){!function(){function e(t,e,i){var r=e.x,n=e.y,o=i.x-r,s=i.y-n;if(0!==o||0!==s){var a=((t.x-r)*o+(t.y-n)*s)/(o*o+s*s);a>1?(r=i.x,n=i.y):a>0&&(r+=o*a,n+=s*a)}return(o=t.x-r)*o+(s=t.y-n)*s}function i(t,i){var r=t.length-1,n=[t[0]];return function t(i,r,n,o,s){for(var a,h=o,u=r+1;u<n;u++){var l=e(i[u],i[r],i[n]);l>h&&(a=u,h=l)}h>o&&(a-r>1&&t(i,r,a,o,s),s.push(i[a]),n-a>1&&t(i,a,n,o,s))}(t,0,r,i,n),n.push(t[r]),n}function r(t,e,r){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return t=i(t=r?t:function(t,e){for(var i,r,n,o,s,a=t[0],h=[a],u=1,l=t.length;u<l;u++)i=t[u],n=a,o=(r=i).x-n.x,s=r.y-n.y,o*o+s*s>e&&(h.push(i),a=i);return a!==i&&h.push(i),h}(t,n),n)}t.exports=r,t.exports.default=r}()}),Ar=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getOutline=function(){var t=this._getPainter();if(!t)return null;var e=this.getMap(),i=t.getContainerExtent().convertTo(function(t){return e.containerPointToCoord(t)});return new Rr(i.toArray(),{symbol:{lineWidth:1,lineColor:"6b707b"}})},e.prototype.animateShow=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1];this._showPlayer&&this._showPlayer.finish(),w(e)&&(i=e={});var r=this.getCoordinates();if(0===r.length)return this;this._animIdx=0,this._animLenSoFar=0,this.show();var n=!!this.getShell?this.getShell().concat(this.getShell()[0]):this.getCoordinates(),o=this._getProjection();this._aniShowCenter=o.unproject(this._getPrjExtent().getCenter());var s=e.duration||1e3,a=this.getLength(),h=e.easing||"out";this.setCoordinates([]);var u=this._showPlayer=kr.animate({t:s},{duration:s,easing:h},function(e){if(t.getMap()){var o=t._drawAnimShowFrame(e.styles.t,s,a,n);"finished"===e.state.playState&&(delete t._showPlayer,delete t._aniShowCenter,delete t._animIdx,delete t._animLenSoFar,delete t._animTailRatio,t.setCoordinates(r)),i&&i(e,o)}else if("finished"!==u.playState&&(u.finish(),i)){var h=t.getCoordinates();i(e,h[h.length-1])}});return u.play(),u},e.prototype._drawAnimShowFrame=function(t,e,i,r){if(0===t)return r[0];var n,o=this.getMap(),s=t/e*i,a=0,h=void 0;for(h=this._animIdx,n=r.length;h<n-1&&(a=o.computeLength(r[h],r[h+1]),!(this._animLenSoFar+a>s));h++)this._animLenSoFar+=a;if(this._animIdx=h,this._animIdx>=n-1)return this.setCoordinates(r),r[r.length-1];var u=this._animIdx,l=r[u],p=r[u+1],c=(s-this._animLenSoFar)/a;this._animTailRatio=c;var f=l.x+(p.x-l.x)*c,d=l.y+(p.y-l.y)*c,y=new di(f,d),g=!!this.getShell;if(!g&&this.options.smoothness>0){var m=r.slice(0,this._animIdx+3);this.setCoordinates(m)}else{var _=r.slice(0,this._animIdx+1);_.push(y),g?this.setCoordinates([this._aniShowCenter].concat(_)):this.setCoordinates(_)}return y},e.prototype._getCenterInExtent=function(t,e,i){var r=this.getExtent();if(!t.intersects(r))return null;var n=i(e,t);if(0===n.length)return null;var o=0,s=0,a=0;n.forEach(function(t){Array.isArray(t)?t.forEach(function(t){t.point&&(t=t.point),o+=t.x,s+=t.y,a++}):(t.point&&(t=t.point),o+=t.x,s+=t.y,a++)});var h=new di(o,s)._multi(1/a);return h.count=a,h},e.prototype._getPath2DPoints=function(t,e,i){if(!V(t))return[];var r=this.getMap(),n=!e&&this._shouldSimplify(),o=2*r._getResolution(),s=Array.isArray(t[0]);if(delete this._simplified,n&&!s){var a=t.length;t=Lr(t,o,!1),this._simplified=t.length<a}return g(i)&&(i=r.getZoom()),H(t,function(t){return r._prjToPoint(t,i)})},e.prototype._shouldSimplify=function(){var t=this.getLayer(),e=this.getProperties(),i=e&&t.options.enableAltitude&&!g(e[t.options.altitudeProperty]);return t&&t.options.enableSimplify&&!i&&this.options.enableSimplify},e.prototype._setPrjCoordinates=function(t){this._prjCoords=t,this.onShapeChanged()},e.prototype._getPrjCoordinates=function(){return this._getProjection()?(this._verifyProjection(),this._prjCoords||(this._prjCoords=this._projectCoords(this._coordinates)),this._prjCoords):null},e.prototype._updateCache=function(){this._clearCache(),this._getProjection()&&this._prjCoords&&(this._coordinates=this._unprojectCoords(this._getPrjCoordinates()))},e.prototype._clearProjection=function(){this._prjCoords=null,t.prototype._clearProjection.call(this)},e.prototype._projectCoords=function(t){var e=this._getProjection();return e?e.projectCoords(t):[]},e.prototype._unprojectCoords=function(t){var e=this._getProjection();return e?e.unprojectCoords(t):[]},e.prototype._computeCenter=function(){var t=this._coordinates;if(!V(t))return null;for(var e=0,i=0,r=0,n=t.length,o=0;o<n;o++)t[o]&&m(t[o].x)&&m(t[o].y)&&(e+=t[o].x,i+=t[o].y,r++);return new di(e/r,i/r)},e.prototype._computeExtent=function(){var t=this._coordinates;if(!V(t))return null;var e=[t];return this.hasHoles&&this.hasHoles()&&e.push.apply(e,this.getHoles()),this._coords2Extent(e,this._getProjection())},e.prototype._computePrjExtent=function(){var t=[this._getPrjCoordinates()];return this.hasHoles&&this.hasHoles()&&t.push.apply(t,this._getPrjHoles()),this._coords2Extent(t)},e.prototype._get2DLength=function(){for(var t=this._getPath2DPoints(this._getPrjCoordinates(),!0),e=0,i=1,r=t.length;i<r;i++)e+=t[i].distanceTo(t[i-1]);return e},e.prototype._hitTestTolerance=function(){var t=this._getInternalSymbol(),e=void 0;if(Array.isArray(t)){e=0;for(var i=0;i<t.length;i++)m(t[i].lineWidth)&&t[i].lineWidth>e&&(e=t[i].lineWidth)}else e=t.lineWidth;return m(e)?e/2:1.5},e.prototype._coords2Extent=function(t,e){for(var i=new mi(e),r=0,n=t.length;r<n;r++)for(var o=0,s=t[r].length;o<s;o++)i._combine(t[r][o]);return i},e}(br);Ar.mergeOptions({smoothness:0,enableClip:!0,enableSimplify:!0,symbol:{lineColor:"#000",lineWidth:2,lineOpacity:1,polygonFill:"#fff",polygonOpacity:1,opacity:1}});var Rr=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,r));return n.type="Polygon",i&&n.setCoordinates(i),n}return c(e,t),e.prototype.setCoordinates=function(t){if(!t)return this._coordinates=null,this._holes=null,this._projectRings(),this;var e=di.toCoordinates(t),i=e.length;if(Array.isArray(e[0])){if(this._coordinates=this._trimRing(e[0]),i>1){for(var r=[],n=1;n<i;n++)e[n]&&r.push(this._trimRing(e[n]));this._holes=r}}else this._coordinates=this._trimRing(e);return this._projectRings(),this},e.prototype.getCoordinates=function(){if(!this._coordinates)return[];for(var t=this.getHoles(),e=[this._copyAndCloseRing(this._coordinates)],i=0,r=t.length;i<r;i++)e.push(this._copyAndCloseRing(t[i]));return e},e.prototype.getCenterInExtent=function(t){return this._getCenterInExtent(t,this.getShell(),ir)},e.prototype.getShell=function(){return this._coordinates||[]},e.prototype.getHoles=function(){return this._holes||[]},e.prototype.hasHoles=function(){return this.getHoles().length>0},e.prototype._projectRings=function(){this.getMap()?(this._prjCoords=this._projectCoords(this._coordinates),this._prjHoles=this._projectCoords(this._holes),this.onShapeChanged()):this.onShapeChanged()},e.prototype._cleanRing=function(t){for(var e=t.length-1;e>=0;e--)t[e]||t.splice(e,1)},e.prototype._checkRing=function(t){if(this._cleanRing(t),!t||!V(t))return!1;var e=t[t.length-1],i=!0;return t[0].x===e.x&&t[0].y===e.y||(i=!1),i},e.prototype._trimRing=function(t){var e=this._checkRing(t);return V(t)&&e&&t.splice(t.length-1,1),t},e.prototype._copyAndCloseRing=function(t){t=t.slice(0);var e=this._checkRing(t);return V(t)&&!e?(t.push(t[0].copy()),t):t},e.prototype._getPrjShell=function(){return"Polygon"===this.getJSONType()?this._getPrjCoordinates():this._getProjection()?(this._verifyProjection(),this._prjShell||(this._prjShell=this._projectCoords(this.getShell())),this._prjShell):null},e.prototype._getPrjHoles=function(){return this._getProjection()?(this._verifyProjection(),this._prjHoles||(this._prjHoles=this._projectCoords(this.getHoles())),this._prjHoles):null},e.prototype._computeGeodesicLength=function(t){var e=this.getCoordinates();if(!V(e))return 0;for(var i=0,r=0,n=e.length;r<n;r++)i+=t.measureLength(e[r]);return i},e.prototype._computeGeodesicArea=function(t){var e=this.getCoordinates();if(!V(e))return 0;for(var i=t.measureArea(e[0]),r=1,n=e.length;r<n;r++)i-=t.measureArea(e[r]);return i},e.prototype._updateCache=function(){t.prototype._updateCache.call(this),this._prjHoles&&(this._holes=this._unprojectCoords(this._getPrjHoles()))},e.prototype._clearCache=function(){return delete this._prjShell,t.prototype._clearCache.call(this)},e.prototype._clearProjection=function(){this._prjHoles&&(this._prjHoles=null),this._prjShell&&(this._prjShell=null),t.prototype._clearProjection.call(this)},e}(Ar);Rr.registerJSONType("Polygon");var jr=function(t){return function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getCoordinates=function(){return this._coordinates},e.prototype.setCoordinates=function(t){var e=t instanceof di?t:new di(t);if(e.equals(this._coordinates))return this;if(this._coordinates=e,!this.getMap())return this.onPositionChanged(),this;var i=this._getProjection();return this._setPrjCoordinates(i.project(this._coordinates)),this},e.prototype._getCenter2DPoint=function(t){var e=this.getMap();if(!e)return null;var i=g(t)?e.getZoom():e.getGLZoom(),r=this._getPrjCoordinates();return r?e._prjToPoint(r,i):null},e.prototype._getPrjCoordinates=function(){var t=this._getProjection();return t?(this._verifyProjection(),this._pcenter||this._coordinates&&(this._pcenter=t.project(this._coordinates)),this._pcenter):null},e.prototype._setPrjCoordinates=function(t){this._pcenter=t,this.onPositionChanged()},e.prototype._updateCache=function(){this._clearCache();var t=this._getProjection();this._pcenter&&t&&(this._coordinates=t.unproject(this._pcenter))},e.prototype._clearProjection=function(){this._pcenter=null,t.prototype._clearProjection.call(this)},e.prototype._computeCenter=function(){return this._coordinates?this._coordinates.copy():null},e}(t)},Dr=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,r));return n.type="Point",i&&n.setCoordinates(i),n}return c(e,t),e.prototype.getOutline=function(){var t=this._getPainter();if(!t)return null;var i=this.getCoordinates(),r=t.getContainerExtent(),n=this.getMap().coordToContainerPoint(i);return new e(i,{symbol:{markerType:"square",markerWidth:r.getWidth(),markerHeight:r.getHeight(),markerLineWidth:1,markerLineColor:"6b707b",markerFill:"rgba(0, 0, 0, 0)",markerDx:r.xmin-(n.x-r.getWidth()/2),markerDy:r.ymin-(n.y-r.getHeight()/2)}})},e.prototype._isVectorMarker=function(){var t=this._getInternalSymbol();return!Array.isArray(t)&&ur.test(t)},e.prototype._canEdit=function(){var t=this._getInternalSymbol();return!Array.isArray(t)&&(ur.test(t)||yr.test(t)||pr.test(t))},e.prototype._containsPoint=function(e,i){var r=this.getContainerExtent();return i&&(r=r.expand(i)),!!r.contains(e)&&(!this.options.hitTestForEvent||t.prototype._containsPoint.call(this,e,i))},e.prototype._computeExtent=function(){return Ir.call(this,"getCenter")},e.prototype._computePrjExtent=function(){return Ir.call(this,"_getPrjCoordinates")},e.prototype._computeGeodesicLength=function(){return 0},e.prototype._computeGeodesicArea=function(){return 0},e.prototype._getSprite=function(t,e){return this._getPainter()?this._getPainter().getSprite(t,e):new xr(this).getSprite(t,e)},e}(jr(br));function Ir(t){var e=this[t]();return e?new mi(e,e,this._getProjection()):null}Dr.mergeOptions({symbol:{markerType:"path",markerPath:[{path:"M8 23l0 0 0 0 0 0 0 0 0 0c-4,-5 -8,-10 -8,-14 0,-5 4,-9 8,-9l0 0 0 0c4,0 8,4 8,9 0,4 -4,9 -8,14z M3,9 a5,5 0,1,0,0,-0.9Z",fill:"#DE3333"}],markerPathWidth:16,markerPathHeight:23,markerWidth:24,markerHeight:34},hitTestForEvent:!1}),Dr.registerJSONType("Marker");var zr=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,r));return n.type="LineString",i&&n.setCoordinates(i),n}return c(e,t),e.prototype.setCoordinates=function(t){return t?(this._coordinates=di.toCoordinates(t),this.getMap()?this._setPrjCoordinates(this._projectCoords(this._coordinates)):this.onShapeChanged(),this):(this._coordinates=null,this._setPrjCoordinates(null),this)},e.prototype.getCoordinates=function(){return this._coordinates||[]},e.prototype.getCenterInExtent=function(t){return this._getCenterInExtent(t,this.getCoordinates(),$i)},e.prototype._computeGeodesicLength=function(t){return t.measureLength(this.getCoordinates())},e.prototype._computeGeodesicArea=function(){return 0},e}(Ar);zr.mergeOptions({arrowStyle:null,arrowPlacement:"vertex-last"}),zr.registerJSONType("LineString");var Hr=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,r));return n.type="GeometryCollection",n.setGeometries(i),n}return c(e,t),e.prototype.setGeometries=function(t){for(var e=this._checkGeometries(t||[]),i=this._getSymbol(),r=this.config(),n=e.length-1;n>=0;n--)e[n]._initOptions(r),e[n]._setParent(this),e[n]._setEventParent(this),i&&e[n].setSymbol(i);return this._geometries=e,this.getLayer()&&(this._bindGeometriesToLayer(),this.onShapeChanged()),this},e.prototype.getGeometries=function(){return this._geometries||[]},e.prototype.forEach=function(t,e){for(var i=this.getGeometries(),r=0,n=i.length;r<n;r++)i[r]&&(e?t.call(e,i[r],r):t(i[r],r));return this},e.prototype.filter=function(t,i){if(!t)return new e;var r=[],n=w(t),o=n?t:st(t);return this.forEach(function(t){var e=n?t:yt(t);(i?o.call(i,e):o(e))&&r.push(t)},this),new e(r)},e.prototype.translate=function(t){if(!t)return this;if(this.isEmpty())return this;var e=arguments;return this.forEach(function(t){t&&t.translate&&t.translate.apply(t,e)}),this},e.prototype.isEmpty=function(){return!V(this.getGeometries())},e.prototype.remove=function(){return this.forEach(function(t){t._unbind()}),br.prototype.remove.apply(this,arguments)},e.prototype.show=function(){return this.options.visible=!0,this.forEach(function(t){t.show()}),this},e.prototype.hide=function(){return this.options.visible=!1,this.forEach(function(t){t.hide()}),this},e.prototype.onConfig=function(t){this.forEach(function(e){e.config(t)})},e.prototype.getSymbol=function(){var e=t.prototype.getSymbol.call(this);if(!e){var i=[],r=!1;this.forEach(function(t){t.getSymbol()&&!r&&(r=!0),i.push(t.getSymbol())}),r&&(e={children:i})}return e},e.prototype.setSymbol=function(t){if(t&&t.children)this._symbol=null,this.forEach(function(e,i){e.setSymbol(t.children[i])});else{var e=this._prepareSymbol(t);this._symbol=e,this.forEach(function(t){t.setSymbol(e)})}return this.onSymbolChanged(),this},e.prototype._setExternSymbol=function(t){return t=this._prepareSymbol(t),this._externSymbol=t,this.forEach(function(e){e._setExternSymbol(t)}),this.onSymbolChanged(),this},e.prototype._bindLayer=function(){t.prototype._bindLayer.apply(this,arguments),this._bindGeometriesToLayer()},e.prototype._bindGeometriesToLayer=function(){var t=this.getLayer();this.forEach(function(e){e._bindLayer(t)})},e.prototype._checkGeometries=function(t){if(t&&!Array.isArray(t)){if(t instanceof br)return[t];throw new Error("The geometry added to collection is invalid.")}for(var e=0,i=t.length;e<i;e++)if(!this._checkGeo(t[e]))throw new Error("The geometry added to collection is invalid. Index: "+e);return t},e.prototype._checkGeo=function(t){return t instanceof br},e.prototype._updateCache=function(){this._clearCache(),this.isEmpty()||this.forEach(function(t){t&&t._updateCache&&t._updateCache()})},e.prototype._removePainter=function(){this._painter&&this._painter.remove(),delete this._painter,this.forEach(function(t){t._removePainter()})},e.prototype._computeCenter=function(t){if(!t||this.isEmpty())return null;for(var e=0,i=0,r=0,n=this.getGeometries(),o=0,s=n.length;o<s;o++)if(n[o]){var a=n[o]._computeCenter(t);a&&(e+=a.x,i+=a.y,r++)}return 0===r?null:new di(e/r,i/r)},e.prototype._containsPoint=function(t,e){if(this.isEmpty())return!1;for(var i=this.getGeometries(),r=0,n=i.length;r<n;r++)if(i[r]._containsPoint(t,e))return!0;return!1},e.prototype._computeExtent=function(t){return Zr.call(this,t,"_computeExtent")},e.prototype._computePrjExtent=function(t){return Zr.call(this,t,"_computePrjExtent")},e.prototype._computeGeodesicLength=function(t){if(!t||this.isEmpty())return 0;for(var e=this.getGeometries(),i=0,r=0,n=e.length;r<n;r++)e[r]&&(i+=e[r]._computeGeodesicLength(t));return i},e.prototype._computeGeodesicArea=function(t){if(!t||this.isEmpty())return 0;for(var e=this.getGeometries(),i=0,r=0,n=e.length;r<n;r++)e[r]&&(i+=e[r]._computeGeodesicArea(t));return i},e.prototype._exportGeoJSONGeometry=function(){var t=[];if(!this.isEmpty())for(var e=this.getGeometries(),i=0,r=e.length;i<r;i++)e[i]&&t.push(e[i]._exportGeoJSONGeometry());return{type:"GeometryCollection",geometries:t}},e.prototype._clearProjection=function(){if(!this.isEmpty())for(var t=this.getGeometries(),e=0,i=t.length;e<i;e++)t[e]&&t[e]._clearProjection()},e.prototype._getConnectPoints=function(){var t=this.getExtent();return[new di(t.xmin,t.ymax),new di(t.xmax,t.ymin),new di(t.xmin,t.ymin),new di(t.xmax,t.ymax)]},e.prototype._getExternalResources=function(){if(this.isEmpty())return[];for(var t=this.getGeometries(),e=[],i={},r=void 0,n=void 0,o=0,s=t.length;o<s;o++)if(t[o])for(var a=0,h=(r=kt(t[o]._getInternalSymbol())).length;a<h;a++)i[n=r[a].join()]||(e.push(r[a]),i[n]=1);return e},e.prototype.startEdit=function(t){var e=this;if(this.isEmpty())return this;t||(t={}),t.symbol&&(this._originalSymbol=this.getSymbol(),this.setSymbol(t.symbol)),this._draggbleBeforeEdit=this.options.draggable,this.config("draggable",!1);for(var i=this.getGeometries(),r=0,n=i.length;r<n;r++)i[r].startEdit(t);return this._editing=!0,this.hide(),setTimeout(function(){e.fire("editstart")},1),this},e.prototype.endEdit=function(){if(this.isEmpty())return this;for(var t=this.getGeometries(),e=0,i=t.length;e<i;e++)t[e].endEdit();return this._originalSymbol&&(this.setSymbol(this._originalSymbol),delete this._originalSymbol),this._editing=!1,this.show(),this.config("draggable",this._draggbleBeforeEdit),this.fire("editend"),this},e.prototype.isEditing=function(){return!!this._editing},e}(br);function Zr(t,e){if(this.isEmpty())return null;for(var i=this.getGeometries(),r=null,n=0,o=i.length;n<o;n++){var s=i[n];if(s){var a=s[e](t);a&&(r=a.combine(r))}}return r}Hr.registerJSONType("GeometryCollection");var Gr=function(t){function e(i,r,n,o){p(this,e);var s=f(this,t.call(this,null,o));return s.GeometryType=i,s.type=r,s._initData(n),s}return c(e,t),e.prototype.getCoordinates=function(){for(var t=[],e=this.getGeometries(),i=0,r=e.length;i<r;i++)t.push(e[i].getCoordinates());return t},e.prototype.setCoordinates=function(t){for(var e=[],i=0,r=(t=t||[]).length;i<r;i++){var n=new this.GeometryType(t[i],this.config());e.push(n)}return this.setGeometries(e),this},e.prototype._initData=function(t){(t=t||[]).length&&(t[0]instanceof this.GeometryType?this.setGeometries(t):this.setCoordinates(t))},e.prototype._checkGeo=function(t){return t instanceof this.GeometryType},e.prototype._exportGeoJSONGeometry=function(){var t=this.getCoordinates(),e=di.toNumberArrays(t);return{type:this.getType(),coordinates:e}},e}(Hr),Fr=function(t){function e(i,r){return p(this,e),f(this,t.call(this,Dr,"MultiPoint",i,r))}return c(e,t),e}(Gr);Fr.registerJSONType("MultiPoint");var Wr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getCenterInExtent=function(t){var e=0,i=0,r=0;return this.getGeometries().forEach(function(n){var o=n.getCenterInExtent(t);o&&(e+=o.x*o.count,i+=o.y*o.count,r+=o.count)}),0===r?null:new di(e,i)._multi(1/r)},e}(Gr),Nr=function(t){function e(i,r){return p(this,e),f(this,t.call(this,zr,"MultiLineString",i,r))}return c(e,t),e}(Wr);Nr.registerJSONType("MultiLineString");var Br=function(t){function e(i,r){return p(this,e),f(this,t.call(this,Rr,"MultiPolygon",i,r))}return c(e,t),e}(Wr);Br.registerJSONType("MultiPolygon");var Vr={Marker:Dr,LineString:zr,Polygon:Rr,MultiPoint:Fr,MultiLineString:Nr,MultiPolygon:Br},Ur={toGeometry:function(t){if(x(t)&&(t=D(t)),Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var n=Ur._convert(t[i]);Array.isArray(n)?I(e,n):e.push(n)}return e}return Ur._convert(t)},_convert:function(t){if(!t||g(t.type))return null;var e=t.type;if("Feature"===e){var i=t.geometry,r=Ur._convert(i);return r?(r.setId(t.id),r.setProperties(t.properties),r):null}if("FeatureCollection"===e){var n=t.features;return n?Ur.toGeometry(n):null}if(["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"].indexOf(e)>=0)return new Vr["Point"===e?"Marker":e](t.coordinates);if("GeometryCollection"===e){var o=t.geometries;if(!V(o))return new Hr;for(var s=[],a=o.length,h=0;h<a;h++)s.push(Ur._convert(o[h]));return new Hr(s)}return null}},Jr=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,null,n));return i&&o.setCoordinates(i),o._radius=r,o}return c(e,t),e.fromJSON=function(t){var i=t.feature,r=new e(t.coordinates,t.radius,t.options);return r.setProperties(i.properties),r},e.prototype.getRadius=function(){return this._radius},e.prototype.setRadius=function(t){return this._radius=t,this.onShapeChanged(),this},e.prototype.getShell=function(){for(var t=this._getMeasurer(),e=this.getCoordinates(),i=this.options.numberOfShellPoints,r=this.getRadius(),n=[],o=void 0,s=void 0,a=void 0,h=0,u=i-1;h<u;h++){o=360*h/u*Math.PI/180,s=r*Math.cos(o),a=r*Math.sin(o);var l=t.locate(e,s,a);n.push(l)}return n.push(n[0]),n},e.prototype.getHoles=function(){return[]},e.prototype.animateShow=function(){return this.show()},e.prototype._containsPoint=function(e,i){var r=this.getMap();if(r.getPitch())return t.prototype._containsPoint.call(this,e,i);var n=r._pointToContainerPoint(this._getCenter2DPoint()),o=this.getSize(),s=g(i)?this._hitTestTolerance():i;return or(e,n,n.add(o.width/2,o.height/2),s)},e.prototype._computePrjExtent=function(t){var e=this._getMinMax(t);if(!e)return null;var i=this._getPrjCoordinates(),r=e.map(function(e){return t.project(e)}),n=Math.min(Math.abs(r[0].x-i.x),Math.abs(r[1].x-i.x)),o=Math.min(Math.abs(r[2].y-i.y),Math.abs(r[3].y-i.y));return new mi(i.sub(n,o),i.add(n,o))},e.prototype._computeExtent=function(t){var e=this._getMinMax(t);return e?new mi(e[0].x,e[2].y,e[1].x,e[3].y,this._getProjection()):null},e.prototype._getMinMax=function(t){if(!t||!this._coordinates||g(this._radius))return null;var e=this._radius;return[t.locate(this._coordinates,-e,0),t.locate(this._coordinates,e,0),t.locate(this._coordinates,0,e),t.locate(this._coordinates,0,-e)]},e.prototype._computeGeodesicLength=function(){return g(this._radius)?0:2*Math.PI*this._radius},e.prototype._computeGeodesicArea=function(){return g(this._radius)?0:Math.PI*Math.pow(this._radius,2)},e.prototype._exportGeoJSONGeometry=function(){return{type:"Polygon",coordinates:di.toNumberArrays([this.getShell()])}},e.prototype._toJSON=function(t){var e=this.getCenter(),i=y({},t);i.geometry=!1;var r=this.toGeoJSON(i);return r.geometry={type:"Polygon"},{feature:r,subType:"Circle",coordinates:[e.x,e.y],radius:this.getRadius()}},e}(jr(Rr));Jr.mergeOptions({numberOfShellPoints:60}),Jr.registerJSONType("Circle");var qr=function(t){function e(i,r,n,o){p(this,e);var s=f(this,t.call(this,null,o));return i&&s.setCoordinates(i),s.width=r,s.height=n,s}return c(e,t),e.fromJSON=function(t){var i=t.feature,r=new e(t.coordinates,t.width,t.height,t.options);return r.setProperties(i.properties),r},e.prototype.getWidth=function(){return this.width},e.prototype.setWidth=function(t){return this.width=t,this.onShapeChanged(),this},e.prototype.getHeight=function(){return this.height},e.prototype.setHeight=function(t){return this.height=t,this.onShapeChanged(),this},e.prototype.getShell=function(){for(var t=this._getMeasurer(),e=this.getCoordinates(),i=this.options.numberOfShellPoints,r=this.getWidth(),n=this.getHeight(),o=[],s=Math.pow(r/2,2)*Math.pow(n/2,2),a=Math.pow(r/2,2),h=Math.pow(n/2,2),u=void 0,l=void 0,p=void 0,c=void 0,f=0;f<i;f++){l=(u=360*f/i)*Math.PI/180,p=Math.sqrt(s/(a*Math.pow(Math.tan(l),2)+h)),c=Math.sqrt(s/(h*Math.pow(1/Math.tan(l),2)+a)),u>90&&u<270&&(p*=-1),u>180&&u<360&&(c*=-1);var d=t.locate(e,p,c);o.push(d)}return o},e.prototype.getHoles=function(){return[]},e.prototype.animateShow=function(){return this.show()},e.prototype._containsPoint=function(e,i){var r=this.getMap();if(r.isTransforming())return t.prototype._containsPoint.call(this,e,i);var n=r.getProjection(),o=g(i)?this._hitTestTolerance():i,s=n.projectCoords([this._coordinates,r.locate(this._coordinates,this.getWidth()/2,this.getHeight()/2)]);return or(e,r._prjToContainerPoint(s[0]),r._prjToContainerPoint(s[1]),o)},e.prototype._computePrjExtent=function(){return Jr.prototype._computePrjExtent.apply(this,arguments)},e.prototype._computeExtent=function(){return Jr.prototype._computeExtent.apply(this,arguments)},e.prototype._getMinMax=function(t){if(!t||!this._coordinates||g(this.width)||g(this.height))return null;var e=this.getWidth(),i=this.getHeight();return[t.locate(this._coordinates,-e/2,0),t.locate(this._coordinates,e/2,0),t.locate(this._coordinates,0,-i/2),t.locate(this._coordinates,0,i/2)]},e.prototype._computeGeodesicLength=function(){if(g(this.width)||g(this.height))return 0;var t=this.width>this.height?this.width:this.height;return 2*Math.PI*t/2-4*Math.abs(this.width-this.height)},e.prototype._computeGeodesicArea=function(){return g(this.width)||g(this.height)?0:Math.PI*this.width*this.height/4},e.prototype._exportGeoJSONGeometry=function(){return{type:"Polygon",coordinates:di.toNumberArrays([this.getShell()])}},e.prototype._toJSON=function(t){var e=y({},t),i=this.getCenter();e.geometry=!1;var r=this.toGeoJSON(e);return r.geometry={type:"Polygon"},{feature:r,subType:"Ellipse",coordinates:[i.x,i.y],width:this.getWidth(),height:this.getHeight()}},e}(jr(Rr));qr.mergeOptions({numberOfShellPoints:80}),qr.registerJSONType("Ellipse");var Yr=function(t){function e(i,r,n,o){p(this,e);var s=f(this,t.call(this,null,o));return i&&s.setCoordinates(i),s._width=r,s._height=n,s}return c(e,t),e.fromJSON=function(t){var i=t.feature,r=new e(t.coordinates,t.width,t.height,t.options);return r.setProperties(i.properties),r},e.prototype.getCoordinates=function(){return this._coordinates},e.prototype.setCoordinates=function(t){if(this._coordinates=t instanceof di?t:new di(t),!this._coordinates||!this.getMap())return this.onPositionChanged(),this;var e=this._getProjection();return this._setPrjCoordinates(e.project(this._coordinates)),this},e.prototype.getWidth=function(){return this._width},e.prototype.setWidth=function(t){return this._width=t,this.onShapeChanged(),this},e.prototype.getHeight=function(){return this._height},e.prototype.setHeight=function(t){return this._height=t,this.onShapeChanged(),this},e.prototype.getShell=function(){var t=this._getMeasurer(),e=this._coordinates,i=this.getMap(),r=1,n=-1;if(i){var o=i.getFullExtent();o.left>o.right&&(r=-1),o.bottom>o.top&&(n=1)}var s=[];return s.push(e),s.push(t.locate(e,r*this._width,0)),s.push(t.locate(e,r*this._width,n*this._height)),s.push(t.locate(e,0,n*this._height)),s.push(e),s},e.prototype.getHoles=function(){return[]},e.prototype.animateShow=function(){return this.show()},e.prototype._getPrjCoordinates=function(){var t=this._getProjection();return t?(this._verifyProjection(),this._pnw||this._coordinates&&(this._pnw=t.project(this._coordinates)),this._pnw):null},e.prototype._setPrjCoordinates=function(t){this._pnw=t,this.onPositionChanged()},e.prototype._getPrjShell=function(){var e=t.prototype._getPrjShell.call(this),i=this._getProjection();if(!i.isSphere())return e;for(var r=i.getSphereExtent(),n=r.sx,o=r.sy,s=this._getProjection().getCircum(),a=e[0],h=1,u=e.length;h<u;h++){var l=e[h],p=0,c=0;n*(a.x-l.x)>0&&(p=s.x*n),o*(a.y-l.y)<0&&(c=s.y*o),e[h]._add(p,c)}return e},e.prototype._updateCache=function(){this._clearCache();var t=this._getProjection();this._pnw&&t&&(this._coordinates=t.unproject(this._pnw))},e.prototype._clearProjection=function(){this._pnw=null,t.prototype._clearProjection.call(this)},e.prototype._computeCenter=function(t){return t.locate(this._coordinates,this._width/2,-this._height/2)},e.prototype._containsPoint=function(e,i){var r=this.getMap();if(r.isTransforming())return t.prototype._containsPoint.call(this,e,i);var n=g(i)?this._hitTestTolerance():i,o=r._getResolution()*n,s=this._getPrjExtent().expand(o),a=r._containerPointToPrj(e);return s.contains(a)},e.prototype._computePrjExtent=function(t){var e=this._getSouthEast(t);if(!e)return null;var i=t.projectCoords([new di(this._coordinates.x,e.y),new di(e.x,this._coordinates.y)]);return new mi(i[0],i[1])},e.prototype._computeExtent=function(t){var e=this._getSouthEast(t);return e?new mi(this._coordinates,e,this._getProjection()):null},e.prototype._getSouthEast=function(t){if(!t||!this._coordinates||g(this._width)||g(this._height))return null;var e=this.getWidth(),i=-this.getHeight();if(t.fullExtent){var r=t.fullExtent;e*=r.right>r.left?1:-1,i*=r.top>r.bottom?1:-1}return t.locate(this._coordinates,e,i)},e.prototype._computeGeodesicLength=function(){return g(this._width)||g(this._height)?0:2*(this._width+this._height)},e.prototype._computeGeodesicArea=function(){return g(this._width)||g(this._height)?0:this._width*this._height},e.prototype._exportGeoJSONGeometry=function(){return{type:"Polygon",coordinates:di.toNumberArrays([this.getShell()])}},e.prototype._toJSON=function(t){var e=y({},t),i=this.getCoordinates();e.geometry=!1;var r=this.toGeoJSON(e);return r.geometry={type:"Polygon"},{feature:r,subType:"Rectangle",coordinates:[i.x,i.y],width:this.getWidth(),height:this.getHeight()}},e}(Rr);Yr.registerJSONType("Rectangle");var Xr=function(t){function e(i,r,n,o,s){p(this,e);var a=f(this,t.call(this,i,r,s));return a.startAngle=n,a.endAngle=o,a}return c(e,t),e.fromJSON=function(t){var i=t.feature,r=new e(t.coordinates,t.radius,t.startAngle,t.endAngle,t.options);return r.setProperties(i.properties),r},e.prototype.getStartAngle=function(){return this.startAngle},e.prototype.setStartAngle=function(t){return this.startAngle=t,this.onShapeChanged(),this},e.prototype.getEndAngle=function(){return this.endAngle},e.prototype.setEndAngle=function(t){return this.endAngle=t,this.onShapeChanged(),this},e.prototype.getShell=function(){for(var t=this._getMeasurer(),e=this.getCoordinates(),i=this.options.numberOfShellPoints-2,r=this.getRadius(),n=[e.copy()],o=this.getStartAngle(),s=this.getEndAngle()-o,a=void 0,h=void 0,u=void 0,l=0;l<i;l++){a=(s*l/(i-1)+o)*Math.PI/180,h=r*Math.cos(a),u=r*Math.sin(a);var p=t.locate(e,h,u);n.push(p)}return n.push(e.copy()),n},e.prototype._containsPoint=function(e,i){var r=this.getMap();if(r.isTransforming())return t.prototype._containsPoint.call(this,e,i);var n=r._pointToContainerPoint(this._getCenter2DPoint()),o=g(i)?this._hitTestTolerance():i,s=this.getSize(),a=n,h=e,u=h.x-a.x,l=a.y-h.y,p=Math.atan2(l,u),c=p<0?360*(p+2*Math.PI)/(2*Math.PI):360*p/(2*Math.PI),f=this.startAngle%360,d=this.endAngle%360,y=!1;return y=f>d?!(c>d&&c<f):c>=f&&c<=d,h.distanceTo(a)<=s.width/2+o&&y},e.prototype._computeGeodesicLength=function(){return g(this._radius)?0:2*Math.PI*this._radius*Math.abs(this.startAngle-this.endAngle)/360+2*this._radius},e.prototype._computeGeodesicArea=function(){return g(this._radius)?0:Math.PI*Math.pow(this._radius,2)*Math.abs(this.startAngle-this.endAngle)/360},e.prototype._toJSON=function(t){var e=y({},t),i=this.getCenter();e.geometry=!1;var r=this.toGeoJSON(e);return r.geometry={type:"Polygon"},{feature:r,subType:"Sector",coordinates:[i.x,i.y],radius:this.getRadius(),startAngle:this.getStartAngle(),endAngle:this.getEndAngle()}},e}(Jr);Xr.mergeOptions({numberOfShellPoints:60}),Xr.registerJSONType("Sector");var Kr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype._arc=function(t,e,i){for(var r=this.options.arcDegree*Math.PI/180,n=1,o=e.length;n<o;n++){var s=ti._arcBetween(t,e[n-1],e[n],r),a=[e[n-1].x+e[n].x-s[0],e[n-1].y+e[n].y-s[1]];e[n-1].nextCtrlPoint=a,e[n].prevCtrlPoint=a,ti._stroke(t,i)}},e.prototype._quadraticCurve=function(t,e){if(e.length<=2)ti._path(t,e);else{var i,r=void 0;for(r=2,i=e.length;r<i;r+=2)t.quadraticCurveTo(e[r-1].x,e[r-1].y,e[r].x,e[r].y);if((r-=1)<i)for(;r<i;r++)t.lineTo(e[r].x,e[r].y)}},e.prototype._bezierCurve=function(t,e){if(e.length<=3)ti._path(t,e);else{var i,r=void 0;for(r=1,i=e.length;r+2<i;r+=3)t.bezierCurveTo(e[r].x,e[r].y,e[r+1].x,e[r+1].y,e[r+2].x,e[r+2].y);if(r<i)for(;r<i;r++)t.lineTo(e[r].x,e[r].y)}},e.prototype._getCurveArrowPoints=function(t,e,i,r,n,o){var s=e.length,a=void 0;for(a=o;a<s;a+=o)t.push(this._getArrowShape(e[a-1],e[a],i,r,n));if((a-=o)<s-1)for(a+=1;a<s;a++)t.push(this._getArrowShape(e[a-1],e[a],i,r,n))},e}(zr);Kr.mergeOptions({enableSimplify:!1,enableClip:!1});var Qr=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"ArcCurve"}},e.prototype._paintOn=function(t,e,i){t.beginPath(),this._arc(t,e,i),ti._stroke(t,i),this._paintArrow(t,e,i)},e.fromJSON=function(t){var i=t.feature,r=new e(i.geometry.coordinates,t.options);return r.setProperties(i.properties),r},e}(Kr);Qr.registerJSONType("ArcCurve"),Qr.mergeOptions({arcDegree:90});var $r=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.fromJSON=function(t){var i=t.feature,r=new e(i.geometry.coordinates,t.options);return r.setProperties(i.properties),r},e.prototype._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"CubicBezierCurve"}},e.prototype._paintOn=function(t,e,i){t.beginPath(),t.moveTo(e[0].x,e[0].y),this._bezierCurve(t,e),ti._stroke(t,i),this._paintArrow(t,e,i)},e.prototype._getArrowPoints=function(t,e,i,r,n){return this._getCurveArrowPoints(t,e,i,r,n,3)},e}(Kr);$r.registerJSONType("CubicBezierCurve");var tn=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.fromJSON=function(t){var i=t.feature,r=new e(i.geometry.coordinates,t.options);return r.setProperties(i.properties),r},e.prototype._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"QuadBezierCurve"}},e.prototype._paintOn=function(t,e,i){t.beginPath(),t.moveTo(e[0].x,e[0].y),this._quadraticCurve(t,e,i),ti._stroke(t,i),this._paintArrow(t,e,i)},e.prototype._getArrowPoints=function(t,e,i,r,n){return this._getCurveArrowPoints(t,e,i,r,n,2)},e}(Kr);tn.registerJSONType("QuadBezierCurve");var en={textFaceName:"monospace",textSize:12,textLineSpacing:8,textWrapCharacter:"\n",textHorizontalAlignment:"middle",textVerticalAlignment:"middle"},rn={markerType:"square",markerLineColor:"#000",markerLineWidth:2,markerLineOpacity:1,markerFill:"#fff",markerOpacity:1},nn=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getContent=function(){return this._content},e.prototype.setContent=function(t){var e=this._content;return this._content=pe(t),this._refresh(),this._fireEvent("contentchange",{old:e,new:t}),this},e.prototype.onAdd=function(){this._refresh()},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return delete e.symbol,e},e.prototype.setSymbol=function(e){if(this._refreshing||!e)return t.prototype.setSymbol.call(this,e);var i=this._parseSymbol(e);if(this.setTextStyle){var r=this.getTextStyle()||{};r.symbol=i[0],this.setTextStyle(r)}else this.setTextSymbol&&this.setTextSymbol(i[0]);if(this.setBoxStyle){var n=this.getBoxStyle()||{};n.symbol=i[1],this.setBoxStyle(n)}else this.setBoxSymbol&&this.setBoxSymbol(i[1]);return this},e.prototype._parseSymbol=function(t){var e={},i={};for(var r in t)C(t,r)&&(0===r.indexOf("text")?e[r]=t[r]:i[r]=t[r]);return[e,i]},e.prototype._getTextSize=function(t){return Ce(this._content,t).size},e.prototype._getInternalSymbol=function(){return this._symbol},e.prototype._getDefaultTextSymbol=function(){return y({},en)},e.prototype._getDefaultBoxSymbol=function(){return y({},rn)},e.prototype._getDefaultPadding=function(){return[12,8]},e}(Dr),on=function(t){function e(i,r,n,o){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};p(this,e);var a=f(this,t.call(this,r,s));return a._content=pe(i),a._width=g(n)?100:n,a._height=g(o)?40:o,s.boxSymbol&&a.setBoxSymbol(s.boxSymbol),s.textStyle&&a.setTextStyle(s.textStyle),a._refresh(),a}return c(e,t),e.prototype.getWidth=function(){return this._width},e.prototype.setWidth=function(t){return this._width=t,this._refresh(),this},e.prototype.getHeight=function(){return this._height},e.prototype.setHeight=function(t){return this._height=t,this._refresh(),this},e.prototype.getBoxSymbol=function(){return y({},this.options.boxSymbol)},e.prototype.setBoxSymbol=function(t){return this.options.boxSymbol=t?y({},t):t,this.getSymbol()&&this._refresh(),this},e.prototype.getTextStyle=function(){return this.options.textStyle?y({},this.options.textStyle):null},e.prototype.setTextStyle=function(t){return this.options.textStyle=t?y({},t):t,this.getSymbol()&&this._refresh(),this},e.fromJSON=function(t){var i=t.feature,r=new e(t.content,i.geometry.coordinates,t.width,t.height,t.options);return r.setProperties(i.properties),r.setId(i.id),t.symbol&&r.setSymbol(t.symbol),r},e.prototype._toJSON=function(t){return{feature:this.toGeoJSON(t),width:this.getWidth(),height:this.getHeight(),subType:"TextBox",content:this._content}},e.prototype._refresh=function(){var t=this.getTextStyle()||{},e=t.padding||[12,8],i=this._width-2*e[0],r=this._height-2*e[1],n=y({},t.symbol||this._getDefaultTextSymbol(),this.options.boxSymbol||this._getDefaultBoxSymbol(),{textName:this._content,markerWidth:this._width,markerHeight:this._height,textHorizontalAlignment:"middle",textVerticalAlignment:"middle",textMaxWidth:i,textMaxHeight:r});t.wrap&&!n.textWrapWidth&&(n.textWrapWidth=i);var o=t.horizontalAlignment;n.textDx=n.markerDx||0;var s=n.markerWidth/2-e[0];"left"===o?(n.textHorizontalAlignment="right",n.textDx=n.textDx-s):"right"===o&&(n.textHorizontalAlignment="left",n.textDx=n.textDx+s);var a=t.verticalAlignment;n.textDy=n.markerDy||0;var h=n.markerHeight/2-e[1];"top"===a?(n.textVerticalAlignment="bottom",n.textDy-=h):"bottom"===a&&(n.textVerticalAlignment="top",n.textDy+=h),this._refreshing=!0,this.updateSymbol(n),delete this._refreshing},e}(nn);on.mergeOptions({textStyle:{wrap:!0,padding:[12,8],verticalAlignment:"middle",horizontalAlignment:"middle"},boxSymbol:null}),on.registerJSONType("TextBox");var sn=function(t){function e(i,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};p(this,e);var o=f(this,t.call(this,r,n));return n.textSymbol&&o.setTextSymbol(n.textSymbol),n.boxStyle&&o.setBoxStyle(n.boxStyle),o._content=pe(i),o._refresh(),o}return c(e,t),e.prototype.getBoxStyle=function(){return this.options.boxStyle?y({},this.options.boxStyle):null},e.prototype.setBoxStyle=function(t){return this.options.boxStyle=t?y({},t):t,this._refresh(),this},e.prototype.getTextSymbol=function(){return y({},this._getDefaultTextSymbol(),this.options.textSymbol)},e.prototype.setTextSymbol=function(t){return this.options.textSymbol=t?y({},t):t,this._refresh(),this},e.fromJSON=function(t){var i=t.feature,r=new e(t.content,i.geometry.coordinates,t.options);return r.setProperties(i.properties),r.setId(i.id),t.symbol&&r.setSymbol(t.symbol),r},e.prototype._canEdit=function(){return!1},e.prototype._toJSON=function(t){return{feature:this.toGeoJSON(t),subType:"Label",content:this._content}},e.prototype._refresh=function(){var t=y({},this.getTextSymbol(),{textName:this._content}),e=this.getBoxStyle();if(e){y(t,e.symbol);var i=this._getBoxSize(t),r=i[1],n=e.padding||this._getDefaultPadding(),o=i[0];t.markerWidth=o.width,t.markerHeight=o.height;var s=t.textDx||0,a=t.textDy||0,h=we(r,t.textHorizontalAlignment,t.textVerticalAlignment)._add(s,a),u=e.horizontalAlignment||"middle";t.markerDx=h.x,"left"===u?t.markerDx+=t.markerWidth/2-n[0]:"right"===u?t.markerDx-=t.markerWidth/2-r.width-n[0]:t.markerDx+=r.width/2;var l=e.verticalAlignment||"middle";t.markerDy=h.y,"top"===l?t.markerDy+=t.markerHeight/2-n[1]:"bottom"===l?t.markerDy-=t.markerHeight/2-r.height-n[1]:t.markerDy+=r.height/2}this._refreshing=!0,this.updateSymbol(t),delete this._refreshing},e.prototype._getBoxSize=function(t){t.markerType||(t.markerType="square");var e=this.getBoxStyle(),i=this._getTextSize(t),r=void 0,n=void 0,o=e.padding||this._getDefaultPadding();return r=i.width+2*o[0],n=i.height+2*o[1],e.minWidth&&(!r||r<e.minWidth)&&(r=e.minWidth),e.minHeight&&(!n||n<e.minHeight)&&(n=e.minHeight),[new he(r,n),i]},e}(nn);sn.mergeOptions({boxStyle:null,textSymbol:null}),sn.registerJSONType("Label");var an=function(t){return function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e._hasConnectors=function(t){return!g(t.__connectors)&&t.__connectors.length>0},e._getConnectors=function(t){return t.__connectors},e.prototype.getConnectSource=function(){return this._connSource},e.prototype.setConnectSource=function(t){var e=this._connTarget;return this.onRemove(),this._connSource=t,this._connTarget=e,this.onAdd(),this},e.prototype.getConnectTarget=function(){return this._connTarget},e.prototype.setConnectTarget=function(t){var e=this._connSource;return this.onRemove(),this._connSource=e,this._connTarget=t,this._updateCoordinates(),this._registerEvents(),this},e.prototype._updateCoordinates=function(){var t=this.getMap();if(!t&&this._connSource&&(t=this._connSource.getMap()),!t&&this._connTarget&&(t=this._connTarget.getMap()),t&&this._connSource&&this._connTarget){for(var e=this._connSource._getConnectPoints(),i=this._connTarget._getConnectPoints(),r=0,n=this.getCoordinates(),o=void 0,s=void 0,a=0,h=e.length;a<h;a++)for(var u=e[a],l=0,p=i.length;l<p;l++){var c=i[l],f=t.computeLength(u,c);0===a&&0===l?(o=u,s=c,r=f):f<r&&(o=u,s=c)}V(n)&&n[0].equals(o)&&n[1].equals(s)||this.setCoordinates([o,s])}},e.prototype.onAdd=function(){this._registerEvents(),this._updateCoordinates()},e.prototype.onRemove=function(){if(this._connSource&&(this._connSource.__connectors&&z(this,this._connSource.__connectors),this._connSource.off("dragging positionchange",this._updateCoordinates,this).off("remove",this.onRemove,this),this._connSource.off("dragstart mousedown mouseover",this._showConnect,this),this._connSource.off("dragend mouseup mouseout",this.hide,this),this._connSource.off("show",this._showConnect,this).off("hide",this.hide,this),delete this._connSource),this._connTarget&&(z(this,this._connTarget.__connectors),this._connTarget.off("dragging positionchange",this._updateCoordinates,this).off("remove",this.onRemove,this),this._connTarget.off("show",this._showConnect,this).off("hide",this.hide,this),delete this._connTarget),!(this._connSource instanceof br&&this._connTarget instanceof br)){var t=this.getMap();t&&t.off("movestart moving moveend zoomstart zooming zoomend rotate pitch fovchange spatialreferencechange",this._updateCoordinates,this)}},e.prototype._showConnect=function(){this._connSource&&this._connTarget&&this._connSource.isVisible()&&this._connTarget.isVisible()&&(this._updateCoordinates(),this.show())},e.prototype._registerEvents=function(){if(this._connSource&&this._connTarget){this._connSource.__connectors||(this._connSource.__connectors=[]),this._connTarget.__connectors||(this._connTarget.__connectors=[]),this._connSource.__connectors.push(this),this._connTarget.__connectors.push(this),this._connSource.on("dragging positionchange",this._updateCoordinates,this).on("remove",this.remove,this),this._connTarget.on("dragging positionchange",this._updateCoordinates,this).on("remove",this.remove,this),this._connSource.on("show",this._showConnect,this).on("hide",this.hide,this),this._connTarget.on("show",this._showConnect,this).on("hide",this.hide,this);var t=this.options.showOn;if(this.hide(),"moving"===t?(this._connSource.on("dragstart",this._showConnect,this).on("dragend",this.hide,this),this._connTarget.on("dragstart",this._showConnect,this).on("dragend",this.hide,this)):"click"===t?(this._connSource.on("mousedown",this._showConnect,this).on("mouseup",this.hide,this),this._connTarget.on("mousedown",this._showConnect,this).on("mouseup",this.hide,this)):"mouseover"===t?(this._connSource.on("mouseover",this._showConnect,this).on("mouseout",this.hide,this),this._connTarget.on("mouseover",this._showConnect,this).on("mouseout",this.hide,this)):this._showConnect(),!(this._connSource instanceof br&&this._connTarget instanceof br)){var e=this.getMap();e&&e.on("movestart moving moveend zoomstart zooming zoomend rotate pitch fovchange spatialreferencechange",this._updateCoordinates,this)}}},e}(t)},hn={showOn:"always"},un=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,null,n));return 1===arguments.length&&(n=i,i=null,r=null),o._connSource=i,o._connTarget=r,o}return c(e,t),e}(an(zr));un.mergeOptions(hn),un.registerJSONType("ConnectorLine");var ln=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,null,n));return 1===arguments.length&&(n=i,i=null,r=null),o._connSource=i,o._connTarget=r,o}return c(e,t),e}(an(Qr));ln.mergeOptions(hn),ln.registerJSONType("ArcConnectorLine");var pn=function(t){function e(i,r,n){p(this,e),r&&!(r instanceof br)&&!Array.isArray(r)&&o.indexOf(r.type)<0&&(n=r,r=null);var s=f(this,t.call(this,i,n));return s._maxZIndex=0,s._minZIndex=0,s._initCache(),r&&s.addGeometry(r),s}return c(e,t),e.prototype.getGeometryById=function(t){return g(t)||""===t?null:this._geoMap[t]?this._geoMap[t]:null},e.prototype.getGeometries=function(t,e){if(!t)return this._geoList.slice(0);for(var i=[],r=void 0,n=0,o=this._geoList.length;n<o;n++)r=this._geoList[n],(e?t.call(e,r):t(r))&&i.push(r);return i},e.prototype.getFirstGeometry=function(){return this._geoList.length?this._geoList[0]:null},e.prototype.getLastGeometry=function(){var t=this._geoList.length;return 0===t?null:this._geoList[t-1]},e.prototype.getCount=function(){return this._geoList.length},e.prototype.getExtent=function(){if(0===this.getCount())return null;var t=new mi(this.getProjection());return this.forEach(function(e){t._combine(e.getExtent())}),t},e.prototype.forEach=function(t,e){for(var i=this._geoList.slice(0),r=0,n=i.length;r<n;r++)e?t.call(e,i[r],r):t(i[r],r);return this},e.prototype.filter=function(){return Hr.prototype.filter.apply(this,arguments)},e.prototype.isEmpty=function(){return!this._geoList.length},e.prototype.addGeometry=function(t,e){if(!t)return this;if("FeatureCollection"===t.type)return this.addGeometry(Ur.toGeometry(t),e);if(!Array.isArray(t)){var i=arguments.length,r=arguments[i-1];return t=Array.prototype.slice.call(arguments,0,i-1),e=r,v(r)&&(t.push(r),e=!1),this.addGeometry(t,e)}if(0===t.length)return this;this._initCache();var n=void 0;!0===e&&(n=new mi),this._toSort=this._maxZIndex>0;for(var o=[],s=0,a=t.length;s<a;s++){var h=t[s];if(!h)throw new Error("Invalid geometry to add to layer("+this.getId()+") at index:"+s);if(!(h instanceof br)&&(h=br.fromJSON(h),Array.isArray(h)))for(var u=0,l=h.length;u<l;u++)this._add(h[u],n,s),o.push(h[u]);Array.isArray(h)||(this._add(h,n,s),o.push(h))}var p=this.getMap();if(p&&(this._getRenderer().onGeometryAdd(o),!0===e&&!g(n.xmin))){var c=p.getFitZoom(n);p.setCenterAndZoom(n.getCenter(),c)}return this.fire("addgeo",{geometries:t}),this},e.prototype.getGeoMinZIndex=function(){return this._minZIndex},e.prototype.getGeoMaxZIndex=function(){return this._maxZIndex},e.prototype._add=function(t,e,i){this._toSort||(this._toSort=0!==t.getZIndex()),this._updateZIndex(t.getZIndex());var r=t.getId();if(!g(r)){if(!g(this._geoMap[r]))throw new Error("Duplicate geometry id in layer("+this.getId()+"):"+r+", at index:"+i);this._geoMap[r]=t}var n=R();t._setInternalId(n),this._geoList.push(t),this.onAddGeometry&&this.onAddGeometry(t),t._bindLayer(this),t.onAdd&&t.onAdd(),e&&e._combine(t.getExtent()),t._fireEvent("add",{layer:this})},e.prototype.removeGeometry=function(t){if(!Array.isArray(t))return this.removeGeometry([t]);for(var e=t.length-1;e>=0;e--)t[e]instanceof br||(t[e]=this.getGeometryById(t[e])),t[e]&&this===t[e].getLayer()&&t[e].remove();return this.fire("removegeo",{geometries:t}),this},e.prototype.clear=function(){this._clearing=!0,this.forEach(function(t){t.remove()}),this._geoMap={};var t=this._geoList;return this._geoList=[],this._getRenderer()&&this._getRenderer().onGeometryRemove(t),this._clearing=!1,this.fire("clear"),this},e.prototype.onRemoveGeometry=function(t){if(t&&!this._clearing&&(this===t.getLayer()&&!g(t._getInternalId()))){var e=t.getId();g(e)||delete this._geoMap[e];var i=this._findInList(t);i>=0&&this._geoList.splice(i,1),this._getRenderer()&&this._getRenderer().onGeometryRemove([t])}},e.prototype.hide=function(){for(var t=0,e=this._geoList.length;t<e;t++)this._geoList[t].onHide();return Vi.prototype.hide.call(this)},e.prototype.identify=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._hitGeos(this._geoList,t,e)},e.prototype._hitGeos=function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.filter,n=i.tolerance,o=[],s=this.getMap(),a=s.coordToPoint(e),h=s._pointToContainerPoint(a),u=t.length-1;u>=0;u--){var l=t[u];if(l&&l.isVisible()&&l._getPainter()){if(!(l instanceof zr&&(l._getArrowStyle()||l instanceof Kr))){var p=l.getContainerExtent();if(n&&(p=p.expand(n)),!p||!p.contains(h))continue}if(l._containsPoint(h,n)&&(!r||r(l))&&(o.push(l),i.count&&o.length>=i.count))break}}return o},e.prototype._initCache=function(){this._geoList||(this._geoList=[],this._geoMap={})},e.prototype._updateZIndex=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i];this._maxZIndex=Math.max(this._maxZIndex,Math.max.apply(Math,e)),this._minZIndex=Math.min(this._minZIndex,Math.min.apply(Math,e))},e.prototype._sortGeometries=function(){var t=this;this._toSort&&(this._maxZIndex=0,this._minZIndex=0,this._geoList.sort(function(e,i){return t._updateZIndex(e.getZIndex(),i.getZIndex()),t._compare(e,i)}),this._toSort=!1)},e.prototype._compare=function(t,e){return t.getZIndex()===e.getZIndex()?t._getInternalId()-e._getInternalId():t.getZIndex()-e.getZIndex()},e.prototype._findInList=function(t){var e=this._geoList.length;if(0===e)return-1;for(var i=0,r=e-1,n=void 0;i<=r;){if(n=Math.floor((i+r)/2),this._geoList[n]===t)return n;this._compare(this._geoList[n],t)>0?r=n-1:i=n+1}return-1},e.prototype._onGeometryEvent=function(t){if(t&&t.target){var e=t.type;"idchange"===e?this._onGeometryIdChange(t):"zindexchange"===e?this._onGeometryZIndexChange(t):"positionchange"===e?this._onGeometryPositionChange(t):"shapechange"===e?this._onGeometryShapeChange(t):"symbolchange"===e?this._onGeometrySymbolChange(t):"show"===e?this._onGeometryShow(t):"hide"===e?this._onGeometryHide(t):"propertieschange"===e&&this._onGeometryPropertiesChange(t)}},e.prototype._onGeometryIdChange=function(t){if(t.new!==t.old||!this._geoMap[t.old]||this._geoMap[t.old]!==t.target){if(!g(t.new)){if(this._geoMap[t.new])throw new Error("Duplicate geometry id in layer("+this.getId()+"):"+t.new);this._geoMap[t.new]=t.target}g(t.old)||t.new===t.old||delete this._geoMap[t.old]}},e.prototype._onGeometryZIndexChange=function(t){t.old!==t.new&&(this._updateZIndex(t.new),this._toSort=!0,this._getRenderer()&&this._getRenderer().onGeometryZIndexChange(t))},e.prototype._onGeometryPositionChange=function(t){this._getRenderer()&&this._getRenderer().onGeometryPositionChange(t)},e.prototype._onGeometryShapeChange=function(t){this._getRenderer()&&this._getRenderer().onGeometryShapeChange(t)},e.prototype._onGeometrySymbolChange=function(t){this._getRenderer()&&this._getRenderer().onGeometrySymbolChange(t)},e.prototype._onGeometryShow=function(t){this._getRenderer()&&this._getRenderer().onGeometryShow(t)},e.prototype._onGeometryHide=function(t){this._getRenderer()&&this._getRenderer().onGeometryHide(t)},e.prototype._onGeometryPropertiesChange=function(t){this._getRenderer()&&this._getRenderer().onGeometryPropertiesChange(t)},e}(Vi);pn.mergeOptions({drawImmediate:!1});var cn={debug:!1,enableSimplify:!0,geometryEvents:!0,defaultIconSize:[20,20],cacheVectorOnCanvas:!0,cacheSvgOnCanvas:oe.gecko,enableAltitude:!1,altitudeProperty:"altitude",drawAltitude:!1},fn=function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,r,n)),s=o.options.style;return delete o.options.style,s&&o.setStyle(s),o}return c(e,t),e.prototype.getStyle=function(){return this._style?this._style:null},e.prototype.setStyle=function(t){return this._style=t,this._cookedStyles=gt(t),this.forEach(function(t){this._styleGeometry(t)},this),this.fire("setstyle",{style:t}),this},e.prototype.removeStyle=function(){return this._style?(delete this._style,delete this._cookedStyles,this.forEach(function(t){t._setExternSymbol(null)},this),this.fire("removestyle"),this):this},e.prototype.onAddGeometry=function(t){this.getStyle()&&this._styleGeometry(t)},e.prototype.onConfig=function(e){if(t.prototype.onConfig.call(this,e),e.enableAltitude||e.drawAltitude||e.altitudeProperty){var i=this.getRenderer();i&&i.setToRedraw&&i.setToRedraw()}},e.prototype._styleGeometry=function(t){if(!this._cookedStyles)return!1;for(var e=yt(t),i=0,r=this._cookedStyles.length;i<r;i++)if(!0===this._cookedStyles[i].filter(e))return t._setExternSymbol(this._cookedStyles[i].symbol),!0;return!1},e.prototype.identify=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRenderer();return i.onlyVisible&&r&&r.identify?r.identify(e,i):t.prototype.identify.call(this,e,i)},e.prototype.toJSON=function(t){t||(t={});var e={type:this.getJSONType(),id:this.getId(),options:this.config()};if((g(t.style)||t.style)&&this.getStyle()&&(e.style=this.getStyle()),g(t.geometries)||t.geometries){var i=void 0;if(t.clipExtent){var r=this.getMap(),n=r?r.getProjection():null;i=new mi(t.clipExtent,n)}for(var o=[],s=this.getGeometries(),a=0,h=s.length;a<h;a++){var u=s[a],l=u.getExtent();if(l&&(!i||i.intersects(l))){var p=u.toJSON(t.geometries);o.push(p)}}e.geometries=o}return e},e.fromJSON=function(t){if(!t||"VectorLayer"!==t.type)return null;for(var i=new e(t.id,t.options),r=t.geometries,n=[],o=0;o<r.length;o++){var s=br.fromJSON(r[o]);s&&n.push(s)}return i.addGeometry(n),t.style&&i.setStyle(t.style),i},e}(pn);fn.mergeOptions(cn),fn.registerJSONType("VectorLayer");var dn="_map_tool",yn=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.addTo=function(t){return t?(this._map=t,t[dn]&&t[dn].disable(),this.onAdd&&this.onAdd(),this.enable(),t[dn]=this,this._fireEvent("add"),this):this},e.prototype.getMap=function(){return this._map},e.prototype.enable=function(){return!this._map||this._enabled?this:(this._enabled=!0,this._switchEvents("off"),this._registerEvents(),this.onEnable&&this.onEnable(),this._fireEvent("enable"),this)},e.prototype.disable=function(){return this._enabled&&this._map?(this._enabled=!1,this._switchEvents("off"),this.onDisable&&this.onDisable(),this._fireEvent("disable"),this):this},e.prototype.isEnabled=function(){return!!this._enabled},e.prototype.remove=function(){return this._map?(this.disable(),this._map&&(delete this._map[dn],delete this._map),this._fireEvent("remove"),this):this},e.prototype._registerEvents=function(){this._switchEvents("on")},e.prototype._switchEvents=function(t){var e=this.getEvents();e&&this._map[t](e,this)},e.prototype._fireEvent=function(t,e){e||(e={}),this.fire(t,e)},e}(oi(ai)),gn={},mn=function(t){function e(i){p(this,e);var r=f(this,t.call(this,i));return r._checkMode(),r._events={click:r._firstClickHandler,mousemove:r._mouseMoveHandler,dblclick:r._doubleClickHandler,mousedown:r._mouseDownHandler,mouseup:r._mouseUpHandler},r}return c(e,t),e.registerMode=function(t,e){gn[t.toLowerCase()]=e},e.getRegisterMode=function(t){return gn[t.toLowerCase()]},e.prototype.getMode=function(){return this.options.mode?this.options.mode.toLowerCase():null},e.prototype.setMode=function(t){return this._geometry&&(this._geometry.remove(),delete this._geometry),this._clearStage(),this._switchEvents("off"),this.options.mode=t,this._checkMode(),this.isEnabled()&&(this._switchEvents("on"),this._restoreMapCfg(),this._saveMapCfg()),this},e.prototype.getSymbol=function(){var t=this.options.symbol;return It(t||this.options.symbol)},e.prototype.setSymbol=function(t){return t?(this.options.symbol=t,this._geometry&&this._geometry.setSymbol(t),this):this},e.prototype.getCurrentGeometry=function(){return this._geometry},e.prototype.onAdd=function(){this._checkMode()},e.prototype.onEnable=function(){return this._saveMapCfg(),this._drawToolLayer=this._getDrawLayer(),this._clearStage(),this._loadResources(),this},e.prototype.onDisable=function(){var t=this.getMap();return this._restoreMapCfg(),this.endDraw(),this._map&&t.removeLayer(this._getDrawLayer()),this},e.prototype.undo=function(){var t=this._getRegisterMode(),e=t.action;if(!this._shouldRecordHistory(e)||!this._historyPointer)return this;var i=this._clickCoords.slice(0,--this._historyPointer);return t.update(i,this._geometry),this},e.prototype.redo=function(){var t=this._getRegisterMode(),e=t.action;if(!this._shouldRecordHistory(e)||g(this._historyPointer)||this._historyPointer===this._clickCoords.length)return this;var i=this._clickCoords.slice(0,++this._historyPointer);return t.update(i,this._geometry),this},e.prototype._shouldRecordHistory=function(t){return Array.isArray(t)&&"click"===t[0]&&"mousemove"===t[1]&&"dblclick"===t[2]},e.prototype._checkMode=function(){this._getRegisterMode()},e.prototype._saveMapCfg=function(){var t=this.getMap();if(this._mapDoubleClickZoom=t.options.doubleClickZoom,t.config({doubleClickZoom:this.options.doubleClickZoom}),this._getRegisterMode().action.indexOf("mousedown")>-1){var e=this.getMap();this._mapDraggable=e.options.draggable,e.config({draggable:!1})}},e.prototype._restoreMapCfg=function(){var t=this.getMap();t.config({doubleClickZoom:this._mapDoubleClickZoom}),g(this._mapDraggable)||t.config("draggable",this._mapDraggable),delete this._mapDraggable,delete this._mapDoubleClickZoom},e.prototype._loadResources=function(){var t=kt(this.getSymbol());t.length>0&&this._drawToolLayer._getRenderer().loadResources(t)},e.prototype._getProjection=function(){return this._map.getProjection()},e.prototype._getRegisterMode=function(){var t=this.getMode(),i=e.getRegisterMode(t);if(!i)throw new Error(t+" is not a valid mode of DrawTool.");return i},e.prototype.getEvents=function(){var t=this._getRegisterMode().action,e={};if(Array.isArray(t)){for(var i=0;i<t.length;i++)e[t[i]]=this._events[t[i]];return e}return null},e.prototype._mouseDownHandler=function(t){this._createGeometry(t)},e.prototype._mouseUpHandler=function(t){this.endDraw(t)},e.prototype._firstClickHandler=function(t){var e=this._getRegisterMode(),i=t.coordinate;this._geometry?(g(this._historyPointer)||(this._clickCoords=this._clickCoords.slice(0,this._historyPointer)),this._clickCoords.push(i),this._historyPointer=this._clickCoords.length,e.clickLimit&&e.clickLimit===this._historyPointer?(e.update([i],this._geometry,t),this.endDraw(t)):e.update(this._clickCoords,this._geometry,t),this._fireEvent("drawvertex",t)):this._createGeometry(t)},e.prototype._createGeometry=function(t){var e=this.getMode(),i=this._getRegisterMode(),r=t.coordinate,n=this.getSymbol();this._geometry||(this._clickCoords=[r],this._geometry=i.create(this._clickCoords,t),n&&"point"!==e?this._geometry.setSymbol(n):this.options.hasOwnProperty("symbol")&&this._geometry.setSymbol(this.options.symbol),this._addGeometryToStage(this._geometry),this._fireEvent("drawstart",t)),"point"===e&&this.endDraw(t)},e.prototype._mouseMoveHandler=function(t){var e=this.getMap(),i=t.coordinate;if(this._geometry&&e&&!e.isInteracting()){var r=this._getMouseContainerPoint(t);if(this._isValidContainerPoint(r)){var n=this._getRegisterMode();if(this._shouldRecordHistory(n.action)){var o=this._clickCoords.slice(0,this._historyPointer);if(o&&o.length>0&&i.equals(o[o.length-1]))return;null!==this._historyPointer&&(this._clickCoords=this._clickCoords.slice(0,this._historyPointer)),this._historyPointer=this._clickCoords.length,n.update(o.concat([i]),this._geometry,t)}else n.update([i],this._geometry,t);this._fireEvent("mousemove",t)}}},e.prototype._doubleClickHandler=function(t){if(this._geometry){var e=this._getMouseContainerPoint(t);if(this._isValidContainerPoint(e)){var i=this._getRegisterMode(),r=this._clickCoords;if(!(r.length<2)){for(var n=[r[0]],o=1,s=r.length;o<s;o++)r[o].x===r[o-1].x&&r[o].y===r[o-1].y||n.push(r[o]);n.length<2||this._geometry&&this._geometry instanceof Rr&&n.length<3||(i.update(n,this._geometry,t),this.endDraw(t))}}}},e.prototype._addGeometryToStage=function(t){this._getDrawLayer().addGeometry(t)},e.prototype.endDraw=function(t){if(!this._geometry||this._ending)return this;this._ending=!0;var e=this._geometry;return this._clearStage(),t=t||{},this._geometry=e,this._fireEvent("drawend",t),delete this._geometry,this.options.once&&this.disable(),delete this._ending,this},e.prototype._clearStage=function(){this._getDrawLayer().clear(),delete this._geometry,delete this._clickCoords},e.prototype._getMouseContainerPoint=function(t){return"mousedown"===this._getRegisterMode().action&&Ie(t.domEvent),t.containerPoint},e.prototype._isValidContainerPoint=function(t){var e=this._map.getSize(),i=e.width,r=e.height;return!(t.x<0||t.y<0)&&!(t.x>i||t.y>r)},e.prototype._getDrawLayer=function(){var t="_maptalks__internal_layer_drawtool",e=this._map.getLayer(t);return e||(e=new fn(t,{enableSimplify:!1}),this._map.addLayer(e)),e},e.prototype._fireEvent=function(t,e){e||(e={}),this._geometry&&(e.geometry=this._getRegisterMode().generate(this._geometry).copy()),yn.prototype._fireEvent.call(this,t,e)},e}(yn);mn.mergeOptions({symbol:{lineColor:"#000",lineWidth:2,lineOpacity:1,polygonFill:"#fff",polygonOpacity:.3},doubleClickZoom:!1,mode:null,once:!1,ignoreMouseleave:!0});var _n=function(t){function e(i){p(this,e);var r=f(this,t.call(this,i));return r.drawTool=new mn({mode:"boxZoom",ignoreMouseleave:!1}),r}return c(e,t),e.prototype.addHooks=function(){this.target.on("_mousedown",this._onMouseDown,this)},e.prototype.removeHooks=function(){this.target.off("_mousedown",this._onMouseDown,this),this.drawTool.isEnabled()&&this.drawTool.remove()},e.prototype._onMouseDown=function(t){this.target.options.boxZoom&&t.domEvent.shiftKey&&this.drawTool.setSymbol(this.target.options.boxZoomSymbol).on("drawend",this._boxZoom,this).addTo(this.target)},e.prototype._boxZoom=function(t){var e=this.target;this.drawTool.remove();var i=t.geometry,r=i.getCenter(),n=i.getSymbol(),o=n.markerWidth,s=n.markerHeight,a=new mi(r,e.locateByPoint(r,o,s),e.getProjection()),h=e.getFitZoom(a);e.animateTo({center:a.getCenter(),zoom:h})},e}(si);Xi.mergeOptions({boxZoom:!0,boxZoomSymbol:{markerType:"rectangle",markerLineWidth:3,markerLineColor:"#1bbc9b",markerLineDasharray:[10,5],markerFillOpacity:.1,markerFill:"#1bbc9b",markerWidth:1,markerHeight:1}}),Xi.addOnLoadHook("addHandler","boxZoom",_n),Xi.include({animateTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];this._stopAnim(this._animPlayer),w(i)&&(r=i,i={});var n=this.getProjection(),o=this.getView(),s={},a=!0;for(var h in t)if(C(t,h)&&!g(o[h]))if(a=!1,"center"===h){var u=new di(o[h]).toFixed(7),l=new di(t[h]).toFixed(7);u.equals(l)||(s.center=[u,l])}else o[h]!==t[h]&&"around"!==h&&(s[h]=[o[h],t[h]]);if(a)return null;var p=t.around||new ae(this.width/2,this.height/2),c=this.getView(),f=this._getRenderer(),d=this._animPlayer=kr.animate(s,{easing:i.easing||"out",duration:i.duration||this.options.zoomAnimationDuration,framer:function(t){f.callInNextFrame(t)}},function(t){if(e.isRemoved())d.finish();else{if("running"===d.playState){var o=e.getView();if(!i.continueOnViewChanged&&!function(t,e){for(var i in t)if(C(t,i))if("center"===i){if(t[i][0]!==e[i][0]||t[i][1]!==e[i][1])return!1}else if(t[i]!==e[i])return!1;return!0}(o,c))return void e._stopAnim(d);if(t.styles.center){var a=t.styles.center;e._setPrjCenter(n.project(a)),e.onMoving(e._parseEventFromCoord(e.getCenter()))}g(t.styles.zoom)||e.onZooming(t.styles.zoom,p),g(t.styles.pitch)||e.setPitch(t.styles.pitch),g(t.styles.bearing)||e.setBearing(t.styles.bearing),c=e.getView(),e._fireEvent("animating")}else"finished"===d.playState&&(d._interupted||(s.center&&e._setPrjCenter(n.project(s.center[1])),g(s.pitch)||e.setPitch(s.pitch[1]),g(s.bearing)||e.setBearing(s.bearing[1])),e._endAnim(d,s,p,i),c=e.getView());r&&r(t)}});return this._startAnim(s,p),d},isAnimating:function(){return!!this._animPlayer},isRotating:function(){return this.isDragRotating()||!!this._animRotating},_endAnim:function(t,e,i,r){delete this._animRotating;var n=t._interupted?"animateinterupted":"animateend";if(t===this._animPlayer&&delete this._animPlayer,e.center){var o=void 0;o=t._interupted?this.getCenter():e.center[1],this.onMoveEnd(this._parseEventFromCoord(o))}g(e.zoom)||(t._interupted?this.onZoomEnd(this.getZoom(),i):r.wheelZoom?this.onZooming(e.zoom[1],i):this.onZoomEnd(e.zoom[1],i)),n&&this._fireEvent(n)},_startAnim:function(t,e){this._animPlayer&&(t.center&&this.onMoveStart(),t.zoom&&!this.isZooming()&&this.onZoomStart(t.zoom[1],e),(t.pitch||t.bearing)&&(this._animRotating=!0),this._fireEvent("animatestart"),this._animPlayer.play())},_stopAnim:function(t){t&&"finished"!==t.playState&&(t._interupted=!0,t.finish())}});var vn="mousedown mouseup mouseover mouseout mouseenter mouseleave mousemove click dblclick contextmenu keypress touchstart touchmove touchend ";function xn(t,e,i){var r,n,o,s,a,h,u,l,p,c,f,d,y=i[0],g=i[1],m=i[2];return e===t?(t[12]=e[0]*y+e[4]*g+e[8]*m+e[12],t[13]=e[1]*y+e[5]*g+e[9]*m+e[13],t[14]=e[2]*y+e[6]*g+e[10]*m+e[14],t[15]=e[3]*y+e[7]*g+e[11]*m+e[15]):(r=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],p=e[8],c=e[9],f=e[10],d=e[11],t[0]=r,t[1]=n,t[2]=o,t[3]=s,t[4]=a,t[5]=h,t[6]=u,t[7]=l,t[8]=p,t[9]=c,t[10]=f,t[11]=d,t[12]=r*y+a*g+p*m+e[12],t[13]=n*y+h*g+c*m+e[13],t[14]=o*y+u*g+f*m+e[14],t[15]=s*y+l*g+d*m+e[15]),t}function wn(t,e,i){var r=i[0],n=i[1],o=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function bn(t,e,i){var r=e[0],n=e[1],o=e[2],s=e[3],a=e[4],h=e[5],u=e[6],l=e[7],p=e[8],c=e[9],f=e[10],d=e[11],y=e[12],g=e[13],m=e[14],_=e[15],v=i[0],x=i[1],w=i[2],b=i[3];return t[0]=v*r+x*a+w*p+b*y,t[1]=v*n+x*h+w*c+b*g,t[2]=v*o+x*u+w*f+b*m,t[3]=v*s+x*l+w*d+b*_,v=i[4],x=i[5],w=i[6],b=i[7],t[4]=v*r+x*a+w*p+b*y,t[5]=v*n+x*h+w*c+b*g,t[6]=v*o+x*u+w*f+b*m,t[7]=v*s+x*l+w*d+b*_,v=i[8],x=i[9],w=i[10],b=i[11],t[8]=v*r+x*a+w*p+b*y,t[9]=v*n+x*h+w*c+b*g,t[10]=v*o+x*u+w*f+b*m,t[11]=v*s+x*l+w*d+b*_,v=i[12],x=i[13],w=i[14],b=i[15],t[12]=v*r+x*a+w*p+b*y,t[13]=v*n+x*h+w*c+b*g,t[14]=v*o+x*u+w*f+b*m,t[15]=v*s+x*l+w*d+b*_,t}function Cn(t,e){var i=e[0],r=e[1],n=e[2],o=e[3],s=e[4],a=e[5],h=e[6],u=e[7],l=e[8],p=e[9],c=e[10],f=e[11],d=e[12],y=e[13],g=e[14],m=e[15],_=i*a-r*s,v=i*h-n*s,x=i*u-o*s,w=r*h-n*a,b=r*u-o*a,C=n*u-o*h,P=l*y-p*d,M=l*g-c*d,T=l*m-f*d,S=p*g-c*y,O=p*m-f*y,E=c*m-f*g,k=_*E-v*O+x*S+w*T-b*M+C*P;return k?(k=1/k,t[0]=(a*E-h*O+u*S)*k,t[1]=(n*O-r*E-o*S)*k,t[2]=(y*C-g*b+m*w)*k,t[3]=(c*b-p*C-f*w)*k,t[4]=(h*T-s*E-u*M)*k,t[5]=(i*E-n*T+o*M)*k,t[6]=(g*x-d*C-m*v)*k,t[7]=(l*C-c*x+f*v)*k,t[8]=(s*O-a*T+u*P)*k,t[9]=(r*T-i*O-o*P)*k,t[10]=(d*b-y*x+m*_)*k,t[11]=(p*x-l*b-f*_)*k,t[12]=(a*M-s*S-h*P)*k,t[13]=(i*S-r*M+n*P)*k,t[14]=(y*v-d*w-g*_)*k,t[15]=(l*w-p*v+c*_)*k,t):null}function Pn(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mn(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t}function Tn(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Sn(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function On(t,e){var i=e[0],r=e[1],n=e[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function En(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function kn(t,e,i){var r=e[0],n=e[1],o=e[2],s=i[0],a=i[1],h=i[2];return t[0]=n*h-o*a,t[1]=o*s-r*h,t[2]=r*a-n*s,t}function Ln(t,e,i){var r=e[0],n=e[1],o=e[2],s=1/(i[3]*r+i[7]*n+i[11]*o+i[15]);return t[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])*s,t[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])*s,t[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])*s,t}Xi.include({_registerDomEvents:function(){Ae(this._panels.mapWrapper||this._containerDOM,vn,this._handleDOMEvent,this)},_removeDomEvents:function(){Re(this._panels.mapWrapper||this._containerDOM,vn,this._handleDOMEvent)},_handleDOMEvent:function(t){var e=t.type;if("contextmenu"===e&&De(t),!this._ignoreEvent(t)){var i=!1;if("mousedown"===e||"touchstart"===e&&1===t.touches.length)this._mouseDownTime=d();else if("click"===e||"touchend"===e||"contextmenu"===e){if(!this._mouseDownTime)return;var r=this._mouseDownTime;if(delete this._mouseDownTime,d()-r>300){if("click"===e||"contextmenu"===e)return}else"touchend"===e&&(i=!0)}this._fireDOMEvent(this,t,e),i&&(this._clickTime&&d()-this._clickTime<=300?(delete this._clickTime,this._fireDOMEvent(this,t,"dblclick")):(this._clickTime=d(),this._fireDOMEvent(this,t,"click")))}},_ignoreEvent:function(t){if(!t||!this._panels.control)return!1;if(this._isEventOutMap(t))return!0;var e=t.srcElement||t.target,i=void 0;if(e)for(;e&&e!==this._containerDOM;){if(e.className&&e.className.indexOf&&(e.className.indexOf("maptalks-control")>=0||e.className.indexOf("maptalks-ui")>=0&&!i.eventsPropagation))return!0;i=e,e=e.parentNode}return!1},_isEventOutMap:function(t){if(this.getPitch()>this.options.maxVisualPitch){var e=Ge(this._getActualEvent(t),this._containerDOM);if(!this.getContainerExtent().contains(e))return!0}return!1},_parseEvent:function(t,e){if(!t)return null;var i={domEvent:t};if("keypress"!==e){var r=this._getActualEvent(t);if(r){var n=Ge(r,this._containerDOM);i=y(i,{coordinate:this.containerPointToCoord(n),containerPoint:n,viewPoint:this.containerPointToViewPoint(n),point2d:this._containerPointToPoint(n)})}}return i},_parseEventFromCoord:function(t){var e=this.coordToContainerPoint(t);return{coordinate:t,containerPoint:e,viewPoint:this.containerPointToViewPoint(e),point2d:this.coordToPoint(t)}},_getActualEvent:function(t){return t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t},_fireDOMEvent:function(t,e,i){if(!this.isRemoved()){var r=this._parseEvent(e,i);this._fireEvent(i,r)}}}),Xi.addOnLoadHook("_registerDomEvents"),Xi.include({isFullScreen:function(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)},requestFullScreen:function(t){return this._fireEvent("fullscreenstart"),this._requestFullScreen(t||this._containerDOM),this._fireEvent("fullscreenend"),this},cancelFullScreen:function(){return this._cancelFullScreen(),this._fireEvent("cancelfullscreen"),this},_requestFullScreen:function(t){if(t.requestFullScreen)t.requestFullScreen();else if(t.mozRequestFullScreen)t.mozRequestFullScreen();else if(t.webkitRequestFullScreen)t.webkitRequestFullScreen();else if(t.msRequestFullScreen)t.msRequestFullScreen();else{var e="fullscreen=1,status=no,resizable=yes,top=0,left=0,scrollbars=no,titlebar=no,menubar=no,location=no,toolbar=no,z-look=yes,width="+(screen.availWidth-8)+",height="+(screen.availHeight-45);null!==window.open(location.href,"_blank",e)&&(window.opener=null,window.close())}},_cancelFullScreen:function(){if(document.cancelFullScreen)document.cancelFullScreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else{null!==window.open(location.href,"_blank","fullscreen=no,status=yes,resizable=yes,scrollbars=no,titlebar=no,menubar=yes,location=yes,toolbar=yes,z-look=yes")&&(window.opener=null,window.close())}}}),Xi.include({panTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments[2];return t?(w(e)&&(i=e,e={}),t=new di(t),void 0===e.animation||e.animation?this._panAnimation(t,e.duration,i):(this.setCenter(t),this)):this},panBy:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments[2];if(!t)return this;if(w(e)&&(i=e,e={}),t=new ae(t).multi(-1),this.onMoveStart(),void 0===e.animation||e.animation){var r=this.locateByPoint(this.getCenter(),t.x,t.y);this._panAnimation(r,e.duration,i)}else this._offsetCenterByPixel(t),this.onMoveEnd(this._parseEventFromCoord(this.getCenter()));return this},_panAnimation:function(t,e,i){return this.animateTo({center:t},{duration:e||this.options.panAnimationDuration},i)}}),br.fromJSON=function(t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var n=br.fromJSON(t[i]);Array.isArray(t)?e=e.concat(n):e.push(n)}return e}if(t&&!t.feature)return Ur.toGeometry(t);var o=void 0;return t.subType?(o=br.getJSONClass(t.subType).fromJSON(t),g(t.feature.id)||o.setId(t.feature.id)):(o=Ur.toGeometry(t.feature),t.options&&o.config(t.options)),t.symbol&&o.setSymbol(t.symbol),t.infoWindow&&o.setInfoWindow(t.infoWindow),o},Vi.fromJSON=function(t){if(!t)return null;var e=t.type,i=Vi.getJSONClass(e);if(!i||!i.fromJSON)throw new Error("unsupported layer type:"+e);return i.fromJSON(t)},Xi.include({JSON_VERSION:"1.0",toJSON:function(t){t||(t={});var e={version:this.JSON_VERSION,extent:this.getExtent().toJSON()};e.options=this.config(),e.options.center=this.getCenter(),e.options.zoom=this.getZoom();var i=this.getBaseLayer();(g(t.baseLayer)||t.baseLayer)&&i&&(e.baseLayer=i.toJSON(t.baseLayer));var r={};t.clipExtent&&(!0===t.clipExtent?r.clipExtent=this.getExtent():r.clipExtent=t.clipExtent);var n=[];if(g(t.layers)||t.layers&&!Array.isArray(t.layers)){for(var o=this.getLayers(),s=0,a=o.length;s<a;s++)if(o[s].toJSON){var h=y({},v(t.layers)?t.layers:{},r);n.push(o[s].toJSON(h))}e.layers=n}else if(V(t.layers)){for(var u=t.layers,l=0;l<u.length;l++){var p=u[l],c=this.getLayer(p.id);if(c.toJSON){var f=y({},p.options,r);n.push(c.toJSON(f))}}e.layers=n}else e.layers=[];return e}}),Xi.fromJSON=function(t,e,i){if(!t||!e)return null;i||(i={});var r=new Xi(t,e.options);if(g(i.baseLayer)||i.baseLayer){var n=Vi.fromJSON(e.baseLayer);n&&r.setBaseLayer(n)}if(g(i.layers)||i.layers){for(var o=[],s=e.layers,a=0;a<s.length;a++){var h=Vi.fromJSON(s[a]);o.push(h)}r.addLayer(o)}return r},Xi.include({computeLength:function(t,e){if(!this.getProjection())return null;var i=new di(t),r=new di(e);return i.equals(r)?0:this.getProjection().measureLength(i,r)},computeGeometryLength:function(t){return t._computeGeodesicLength(this.getProjection())},computeGeometryArea:function(t){return t._computeGeodesicArea(this.getProjection())},identify:function(t,e){if(!t)return this;var i=t.layers;if(!V(i))return this;for(var r=[],n=0,o=i.length;n<o;n++)x(i[n])?r.push(this.getLayer(i[n])):r.push(i[n]);for(var s=new di(t.coordinate),a=y({},t),h=[],u=r.length-1;u>=0&&!(t.count&&h.length>=t.count);u--){var l=r[u];if(l&&l.getMap()&&(t.includeInvisible||l.isVisible())&&(t.includeInternals||!(l.getId().indexOf("_maptalks__internal_layer_")>=0))){var p=l.identify(s,a);p&&(Array.isArray(p)?I(h,p):h.push(p))}}return e.call(this,h),this}}),Xi.include({_zoom:function(t,e){this.options.zoomable&&!this.isZooming()&&(e=this._checkZoomOrigin(e),t=this._checkZoom(t),this.onZoomStart(t,e),this._frameZoom=this.getZoom(),this.onZoomEnd(t,e))},_zoomAnimation:function(t,e,i){this.options.zoomable&&!this.isZooming()&&(t=this._checkZoom(t),this.getZoom()!==t&&(e=this._checkZoomOrigin(e),this._startZoomAnim(t,e,i)))},_checkZoomOrigin:function(t){return t&&!this.options.zoomInCenter||(t=new ae(this.width/2,this.height/2)),t},_startZoomAnim:function(t,e,i){g(i)&&(i=1);var r=this._getResolution(this._startZoomVal)/this._getResolution(t),n=this.options.zoomAnimationDuration*Math.abs(r-i)/Math.abs(r-1);this._frameZoom=this._startZoomVal,this.animateTo({zoom:t,around:e},{continueOnViewChanged:!0,duration:n})},onZoomStart:function(t,e){this.options.zoomable&&!this.isZooming()&&(this._zooming=!0,this._startZoomVal=this.getZoom(),this._startZoomCoord=this._containerPointToPrj(e),this._fireEvent("zoomstart",{from:this._startZoomVal,to:t}))},onZooming:function(t,e,i){if(this.options.zoomable&&this._frameZoom!==t){g(i)&&(i=1),this._zoomTo(t,e);var r=this.getResolution(t),n=this.getResolution(this._startZoomVal)/r/i,o=this._prjToContainerPoint(this._startZoomCoord,this._startZoomVal),s=this.getViewPoint();if(!this.isRotating()&&!o.equals(e)&&1!==n){var a=this.getPitch(),h=o._sub(e)._multi(1/(1-n));a&&(h.y/=Math.cos(a*Math.PI/180)),e=e.add(h)}var u={view:[n,0,0,n,(e.x-s.x)*(1-n),(e.y-s.y)*(1-n)]};oe.retina&&(e=e.multi(2)),u.container=[n,0,0,n,e.x*(1-n),e.y*(1-n)],this._fireEvent("zooming",{from:this._startZoomVal,to:t,origin:e,matrix:u}),this._frameZoom=t}},onZoomEnd:function(t,e){if(this.options.zoomable){var i=this._startZoomVal;this._zoomTo(t,e),this._zooming=!1,this._getRenderer().onZoomEnd(),this._fireEvent("zoomend",{from:i,to:t}),this._verifyExtent(this.getCenter())||this.panTo(this.getMaxExtent().getCenter())}},_zoomTo:function(t,e){this._zoomLevel=t,this._calcMatrices(),e&&this._setPrjCoordAtContainerPoint(this._startZoomCoord,e)},_checkZoom:function(t){var e=this.getMaxZoom(),i=this.getMinZoom();return t<i&&(t=i),t>e&&(t=e),t}});var An,Rn,jn,Dn,In,zn,Hn,Zn,Gn,Fn,Wn,Nn,Bn,Vn=Math.PI/180;function Un(){return Pn(new Array(16))}Xi.include({getFov:function(){return this._fov||(this._fov=.6435011087932844),this._fov/Vn},setFov:function(t){if(this.isZooming())return this;if(t=Math.max(.01,Math.min(60,t)),this._fov===t)return this;var e=this.getFov();return this._fov=t*Vn,this._calcMatrices(),this._renderLayers(),this._fireEvent("fovchange",{from:e,to:this.getFov()}),this},getBearing:function(){return this._angle?-this._angle/Vn:0},setBearing:function(t){if(oe.ie9)throw new Error("map can't rotate in IE9.");var e=-N(t,-180,180)*Vn;if(this._angle===e)return this;var i=this.getBearing();return this._fireEvent("rotatestart",{from:i,to:e}),this._angle=e,this._calcMatrices(),this._renderLayers(),this._fireEvent("rotate",{from:i,to:e}),this._fireEvent("rotateend",{from:i,to:e}),this},getPitch:function(){return this._pitch?this._pitch/Math.PI*180:0},setPitch:function(t){if(oe.ie9)throw new Error("map can't tilt in IE9.");var e=B(t,0,this.options.maxPitch)*Vn;if(this._pitch===e)return this;var i=this.getPitch();return this._fireEvent("pitchstart",{from:i,to:e}),this._pitch=e,this._calcMatrices(),this._renderLayers(),this._fireEvent("pitch",{from:i,to:e}),this._fireEvent("pitchend",{from:i,to:e}),this},isTransforming:function(){return!(!this._pitch&&!this._angle)},getFrustumAltitude:function(){var t=90-this.getPitch(),e=this.getFov()/2,i=this.cameraPosition?this.cameraPosition[2]:0;if(e<=t)return i;e=Math.PI*e/180;var r=new ae(this.cameraPosition).distanceTo(new ae(this.cameraLookAt)),n=i*Math.tan(2*e);return i+Math.tan(e)*(r+n)},_pointToContainerPoint:(Bn=[0,0,0],function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(t=this._pointToPoint(t,e),this.isTransforming()||i){i*=this.getResolution(e)/this.getResolution();var r=this._glScale;Mn(Bn,t.x*r,t.y*r,i*r);var n=this._projIfBehindCamera(Bn,this.cameraPosition,this.cameraForward);Ln(n,n,this.projViewMatrix);var o=this.width/2,s=this.height/2;return n[0]=n[0]*o+o,n[1]=-n[1]*s+s,new ae(n[0],n[1])}var a=this._prjToPoint(this._getPrjCenter());return t._sub(a)._add(this.width/2,this.height/2)}),_projIfBehindCamera:(Gn=new Array(3),Fn=new Array(3),Wn=new Array(3),Nn=new Array(3),function(t,e,i){var r,n,o;if(Tn(Gn,t,e),En(i,On(Fn,Gn))<=0){var s=En(i,Gn);n=i,o=1.01*s,(r=Wn)[0]=n[0]*o,r[1]=n[1]*o,r[2]=n[2]*o,function(t,e,i){t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2]}(t,e,Tn(Nn,Gn,Wn))}return t}),_containerPointToPoint:(zn=[0,0,0],Hn=[0,0,0,1],Zn=[0,0,0,1],function(t,e){if(this.isTransforming()){var i=this.width/2||1,r=this.height/2||1;Mn(zn,(t.x-i)/i,(r-t.y)/r,0),Mn(Hn,zn[0],zn[1],0),Mn(Zn,zn[0],zn[1],1),Hn[3]=Zn[3]=1,Ln(Hn,Hn,this.projViewMatrixInverse),Ln(Zn,Zn,this.projViewMatrixInverse);var n=Hn[0],o=Zn[0],s=Hn[1],a=Zn[1],h=Hn[2],u=Zn[2],l=h===u?0:(0-h)/(u-h),p=new ae(W(n,o,l),W(s,a,l))._multi(1/this._glScale);return void 0===e||this.getZoom()===e?p:this._pointToPointAtZoom(p,e)}var c=this._prjToPoint(this._getPrjCenter(),e),f=void 0!==e?this._getResolution()/this._getResolution(e):1,d=f*(t.x-this.width/2),y=f*(t.y-this.height/2);return c._add(d,y)}),_calcMatrices:(Dn=oe.ie9?null:Un(),In=oe.ie9?null:Un(),function(){if(!oe.ie9){var t=this.getSize(),e=t.width||1,i=t.height||1;this._glScale=this.getGLScale();var r,n,o,s,a,h,u,l=this.getFov()*Math.PI/180,p=this.getScale(this.getMinZoom())/this.getScale(this.getMaxNativeZoom())*i/2/this._getFovRatio()*1.4,c=this.projMatrix||Un();r=c,n=l,o=e/i,s=.1,a=p,h=1/Math.tan(n/2),u=1/(s-a),r[0]=h/o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=h,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(a+s)*u,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*a*s*u,r[15]=0,this.projMatrix=c;var f=this._getCameraWorldMatrix();this.viewMatrix=Cn(Dn,f),this.projViewMatrix=bn(this.projViewMatrix||Un(),c,this.viewMatrix),this.projViewMatrixInverse=bn(this.projViewMatrixInverse||Un(),f,Cn(In,c)),this.domCssMatrix=this._calcDomMatrix()}}),_calcDomMatrix:(An=oe.ie9?null:Un(),Rn=[1,-1,1],jn=[0,0,0],function(){var t,e,i,r,n,o,s,a,h,u,l,p,c,f=.5/Math.tan(this._fov/2)*this.height;wn(An,this.projMatrix,Rn),xn(An,An,Mn(jn,0,0,-f)),this._pitch&&(t=An,e=An,i=this._pitch,r=Math.sin(i),n=Math.cos(i),o=e[4],s=e[5],a=e[6],h=e[7],u=e[8],l=e[9],p=e[10],c=e[11],e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+u*r,t[5]=s*n+l*r,t[6]=a*n+p*r,t[7]=h*n+c*r,t[8]=u*n-o*r,t[9]=l*n-s*r,t[10]=p*n-a*r,t[11]=c*n-h*r),this._angle&&function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[0],s=e[1],a=e[2],h=e[3],u=e[4],l=e[5],p=e[6],c=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+u*r,t[1]=s*n+l*r,t[2]=a*n+p*r,t[3]=h*n+c*r,t[4]=u*n-o*r,t[5]=l*n-s*r,t[6]=p*n-a*r,t[7]=c*n-h*r}(An,An,this._angle);var d=Un();return wn(d,d,Mn(jn,this.width/2,-this.height/2,1)),bn(this.domCssMatrix||Un(),d,An)}),_getCameraWorldMatrix:function(){var t={},e=[1,-1,1];return function(){var i=this.getGLZoom(),r=this.getSize(),n=this.getGLScale(),o=this._prjToPoint(this._prjCenter,i);this.cameraLookAt=Mn(this.cameraLookAt||[0,0,0],o.x,o.y,0);var s=this.getPitch()*Vn,a=-this.getBearing()*Vn,h=this._getFovRatio(),u=n*(r.height||1)/2/h,l=u*Math.cos(s),p=Math.sin(s)*u,c=o.x+p*Math.sin(a),f=o.y+p*Math.cos(a);this.cameraPosition=Mn(this.cameraPosition||[0,0,0],c,f,l);var d=p||1,y=this.cameraUp=Mn(this.cameraUp||[0,0,0],Math.sin(a)*d,Math.cos(a)*d,0),g=this.cameraWorldMatrix=this.cameraWorldMatrix||Un();!function(t,e,i,r){var n=[0,0,0],o=[0,0,0],s=[0,0,0];Tn(s,e,i),0===Sn(s)&&(s[2]=1),On(s,s),kn(n,r,s),0===Sn(s)&&(1===Math.abs(r[2])?s[0]+=1e-4:s[2]+=1e-4,On(s,s),kn(n,r,s)),On(n,n),kn(o,s,n),t[0]=n[0],t[4]=o[0],t[8]=s[0],t[1]=n[1],t[5]=o[1],t[9]=s[1],t[2]=n[2],t[6]=o[2],t[10]=s[2]}(g,this.cameraPosition,this.cameraLookAt,y);var m,_,v,x=this.cameraForward||[0,0,0];return Tn(x,this.cameraLookAt,this.cameraPosition),this.cameraForward=On(x,x),function(t,e){var i=e[0],r=e[4],n=e[8],o=e[1],s=e[5],a=e[9],h=e[2],u=e[6],l=e[10],p=i+s+l,c=void 0;p>0?(c=.5/Math.sqrt(p+1),t.w=.25/c,t.x=(u-a)*c,t.y=(n-h)*c,t.z=(o-r)*c):i>s&&i>l?(c=2*Math.sqrt(1+i-s-l),t.w=(u-a)/c,t.x=.25*c,t.y=(r+o)/c,t.z=(n+h)/c):s>l?(c=2*Math.sqrt(1+s-i-l),t.w=(n-h)/c,t.x=(r+o)/c,t.y=.25*c,t.z=(a+u)/c):(c=2*Math.sqrt(1+l-i-s),t.w=(o-r)/c,t.x=(n+h)/c,t.y=(a+u)/c,t.z=.25*c)}(t,g),function(t,e){var i=t,r=e.x,n=e.y,o=e.z,s=e.w,a=r+r,h=n+n,u=o+o,l=r*a,p=r*h,c=r*u,f=n*h,d=n*u,y=o*u,g=s*a,m=s*h,_=s*u;i[0]=1-(f+y),i[4]=p-_,i[8]=c+m,i[1]=p+_,i[5]=1-(l+y),i[9]=d-g,i[2]=c-m,i[6]=d+g,i[10]=1-(l+f),i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1}(g,t),m=g,_=this.cameraPosition,(v=m)[12]=_[0],v[13]=_[1],v[14]=_[2],wn(g,g,e),g}}(),_getFovRatio:function(){var t=this.getFov();return Math.tan(t/2*Vn)},_renderLayers:function(){this.isInteracting()||this._getLayers().forEach(function(t){if(t){var e=t._getRenderer();e&&e.setToRedraw&&e.setToRedraw()}})}}),Xi.include({_onViewChange:function(t){this._viewHistory||(this._viewHistory=[],this._viewHistoryPointer=0);for(var e=this._getCurrentView(),i=this._viewHistory.length-1;i>=0;i--)if(it(t,this._viewHistory[i]))return this._viewHistoryPointer=i,void this._fireViewChange(e,t);this._viewHistoryPointer<this._viewHistory.length-1&&this._viewHistory.splice(this._viewHistoryPointer+1),this._viewHistory.push(t);var r=this.options.viewHistoryCount;r>0&&this._viewHistory.length>r&&this._viewHistory.splice(0,this._viewHistory.length-r),this._viewHistoryPointer=this._viewHistory.length-1,this._fireViewChange(e,t)},zoomToPreviousView:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.hasPreviousView())return null;var e=this._viewHistory[--this._viewHistoryPointer];return this._zoomToView(e,t),e},hasPreviousView:function(){return!(!this._viewHistory||0===this._viewHistoryPointer)},zoomToNextView:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.hasNextView())return null;var e=this._viewHistory[++this._viewHistoryPointer];return this._zoomToView(e,t),e},hasNextView:function(){return!(!this._viewHistory||this._viewHistoryPointer===this._viewHistory.length-1)},_zoomToView:function(t,e){var i=this,r=this.getView();e.animation?this.animateTo(t,{duration:e.duration},function(e){"finished"===e.state.playState&&i._fireViewChange(r,t)}):(this.setView(t),this._fireViewChange(r,t))},getViewHistory:function(){return this._viewHistory},_fireViewChange:function(t,e){this._fireEvent("viewchange",{old:t,new:e})},_getCurrentView:function(){return this._viewHistory?this._viewHistory[this._viewHistoryPointer]:null}}),Xi.mergeOptions({viewHistory:!0,viewHistoryCount:10});var Jn=function(t){function e(i){p(this,e);var r=f(this,t.call(this,i));return r.on("enable",r._afterEnable,r).on("disable",r._afterDisable,r),r._measureLayers=[],r}return c(e,t),e.prototype.clear=function(){if(V(this._measureLayers))for(var t=0;t<this._measureLayers.length;t++)this._measureLayers[t].remove();return delete this._lastMeasure,delete this._lastVertex,this._measureLayers=[],this},e.prototype.getMeasureLayers=function(){return this._measureLayers},e.prototype.getLastMeasure=function(){return this._lastMeasure?this._lastMeasure:0},e.prototype._measure=function(t){var e=this.getMap(),i=void 0;t instanceof br?i=e.computeGeometryLength(t):Array.isArray(t)&&(i=e.getProjection().measureLength(t)),this._lastMeasure=i;var r=void 0;r="zh-CN"===this.options.language?[" 米"," 公里"," 英尺"," 英里"]:[" m"," km"," feet"," mile"];var n="";return this.options.metric&&(n+=i<1e3?i.toFixed(0)+r[0]:(i/1e3).toFixed(2)+r[1]),this.options.imperial&&(i*=3.2808399,n.length>0&&(n+="\n"),n+=i<5280?i.toFixed(0)+r[2]:(i/5280).toFixed(2)+r[3]),n},e.prototype._registerMeasureEvents=function(){this.on("drawstart",this._msOnDrawStart,this).on("drawvertex",this._msOnDrawVertex,this).on("mousemove",this._msOnMouseMove,this).on("drawend",this._msOnDrawEnd,this)},e.prototype._afterEnable=function(){this._registerMeasureEvents()},e.prototype._afterDisable=function(){this.off("drawstart",this._msOnDrawStart,this).off("drawvertex",this._msOnDrawVertex,this).off("mousemove",this._msOnMouseMove,this).off("drawend",this._msOnDrawEnd,this)},e.prototype._msOnDrawStart=function(t){var e=this.getMap(),i=R(),r="distancetool_"+i,n="distancetool_markers_"+i;e.getLayer(r)?(this._measureLineLayer=e.getLayer(r),this._measureMarkerLayer=e.getLayer(n)):(this._measureLineLayer=new fn(r).addTo(e),this._measureMarkerLayer=new fn(n).addTo(e)),this._measureLayers.push(this._measureLineLayer),this._measureLayers.push(this._measureMarkerLayer),new Dr(t.coordinate,{symbol:this.options.vertexSymbol}).addTo(this._measureMarkerLayer);var o="zh-CN"===this.options.language?"起点":"start",s=new sn(o,t.coordinate,this.options.labelOptions);this._measureMarkerLayer.addGeometry(s)},e.prototype._msOnMouseMove=function(t){var e=this._measure(this._msGetCoordsToMeasure(t));if(!this._tailMarker){var i=It(this.options.vertexSymbol);i.markerWidth/=2,i.markerHeight/=2,this._tailMarker=new Dr(t.coordinate,{symbol:i}).addTo(this._measureMarkerLayer),this._tailLabel=new sn(e,t.coordinate,this.options.labelOptions).addTo(this._measureMarkerLayer)}this._tailMarker.setCoordinates(t.coordinate),this._tailLabel.setContent(e),this._tailLabel.setCoordinates(t.coordinate)},e.prototype._msGetCoordsToMeasure=function(t){return t.geometry.getCoordinates().concat([t.coordinate])},e.prototype._msOnDrawVertex=function(t){var e=t.geometry;new Dr(t.coordinate,{symbol:this.options.vertexSymbol}).addTo(this._measureMarkerLayer);var i=this._measure(e),r=new sn(i,t.coordinate,this.options.labelOptions);this._measureMarkerLayer.addGeometry(r),this._lastVertex=r},e.prototype._msOnDrawEnd=function(t){this._clearTailMarker();var e=this._lastVertex.getSize();e||(e=new he(10,10)),this._addClearMarker(this._lastVertex.getCoordinates(),e.width);var i=t.geometry.copy();i.addTo(this._measureLineLayer),this._lastMeasure=i.getLength()},e.prototype._addClearMarker=function(t,e){var i=this.options.clearButtonSymbol,r={markerDx:(i.markerDx||0)+e,textDx:(i.textDx||0)+e};Array.isArray(i)&&(r=i.map(function(t){return t?{markerDx:(t.markerDx||0)+e,textDx:(t.textDx||0)+e}:null})),i=It(i,r);var n=new Dr(t,{symbol:i}),o=this._measureLineLayer,s=this._measureMarkerLayer;n.on("click",function(){return o.remove(),s.remove(),!1},this),n.addTo(this._measureMarkerLayer)},e.prototype._clearTailMarker=function(){this._tailMarker&&(this._tailMarker.remove(),delete this._tailMarker),this._tailLabel&&(this._tailLabel.remove(),delete this._tailLabel)},e}(mn);Jn.mergeOptions({mode:"LineString",language:"zh-CN",metric:!0,imperial:!1,symbol:{lineColor:"#000",lineWidth:3,lineOpacity:1},vertexSymbol:{markerType:"ellipse",markerFill:"#fff",markerLineColor:"#000",markerLineWidth:3,markerWidth:11,markerHeight:11},labelOptions:{textSymbol:{textFaceName:"monospace",textLineSpacing:1,textHorizontalAlignment:"right",textDx:15},boxStyle:{padding:[6,2],symbol:{markerType:"square",markerFill:"#fff",markerFillOpacity:.9,markerLineColor:"#b4b3b3"}}},clearButtonSymbol:[{markerType:"square",markerFill:"#fff",markerLineColor:"#b4b3b3",markerLineWidth:2,markerWidth:15,markerHeight:15,markerDx:20},{markerType:"x",markerWidth:10,markerHeight:10,markerDx:20}]});function qn(t){for(var e=t.tileInfo,i=[e.cols,e.rows],r=[],n=e.lods,o=0,s=n.length;o<s;o++)r.push(n[o].resolution);var a=t.fullExtent,h=e.origin,u=[1,-1,h.x,h.y];return delete a.spatialReference,{spatialReference:{resolutions:r,fullExtent:a},tileSystem:u,tileSize:i}}(function(t){function e(i){p(this,e);var r=f(this,t.call(this,i));return r.on("enable",r._afterEnable,r).on("disable",r._afterDisable,r),r._measureLayers=[],r}return c(e,t),e.prototype._measure=function(t){var e=this.getMap(),i=void 0;t instanceof br?i=e.computeGeometryArea(t):Array.isArray(t)&&(i=e.getProjection().measureArea(t)),this._lastMeasure=i;var r=void 0;r="zh-CN"===this.options.language?[" 平方米"," 平方公里"," 平方英尺"," 平方英里"]:[" sq.m"," sq.km"," sq.ft"," sq.mi"];var n="";if(this.options.metric&&(n+=i<1e6?i.toFixed(0)+r[0]:(i/1e6).toFixed(2)+r[1]),this.options.imperial){i*=3.2808399,n.length>0&&(n+="\n");n+=i<27878400?i.toFixed(0)+r[2]:(i/27878400).toFixed(2)+r[3]}return n},e.prototype._msGetCoordsToMeasure=function(t){return t.geometry.getShell().concat([t.coordinate])},e.prototype._msOnDrawVertex=function(t){var e=new Dr(t.coordinate,{symbol:this.options.vertexSymbol}).addTo(this._measureMarkerLayer);this._measure(t.geometry),this._lastVertex=e},e.prototype._msOnDrawEnd=function(t){this._clearTailMarker();var e=this._measure(t.geometry),i=new sn(e,t.coordinate,this.options.labelOptions).addTo(this._measureMarkerLayer).getSize();i||(i=new he(10,10)),this._addClearMarker(t.coordinate,i.width);var r=t.geometry.copy();r.addTo(this._measureLineLayer),this._lastMeasure=r.getArea()},e})(Jn).mergeOptions({mode:"Polygon",symbol:{lineColor:"#000000",lineWidth:2,lineOpacity:1,lineDasharray:"",polygonFill:"#ffffff",polygonOpacity:.5}}),mn.registerMode("circle",{clickLimit:2,action:["click","mousemove","click"],create:function(t){return new Jr(t[0],0)},update:function(t,e){var i=e.getMap().computeLength(e.getCenter(),t[t.length-1]);e.setRadius(i)},generate:function(t){return t}}),mn.registerMode("freeHandCircle",{action:["mousedown","mousemove","mouseup"],create:function(t){return new Jr(t[0],0)},update:function(t,e){var i=e.getMap().computeLength(e.getCenter(),t[t.length-1]);e.setRadius(i)},generate:function(t){return t}}),mn.registerMode("ellipse",{clickLimit:2,action:["click","mousemove","click"],create:function(t){return new qr(t[0],0,0)},update:function(t,e){var i=e.getMap(),r=e.getCenter(),n=i.computeLength(r,new di({x:t[t.length-1].x,y:r.y})),o=i.computeLength(r,new di({x:r.x,y:t[t.length-1].y}));e.setWidth(2*n),e.setHeight(2*o)},generate:function(t){return t}}),mn.registerMode("freeHandEllipse",{action:["mousedown","mousemove","mouseup"],create:function(t){return new qr(t[0],0,0)},update:function(t,e){var i=e.getMap(),r=e.getCenter(),n=i.computeLength(r,new di({x:t[t.length-1].x,y:r.y})),o=i.computeLength(r,new di({x:r.x,y:t[t.length-1].y}));e.setWidth(2*n),e.setHeight(2*o)},generate:function(t){return t}}),mn.registerMode("rectangle",{clickLimit:2,action:["click","mousemove","click"],create:function(t){var e=new Rr([]);return e._firstClick=t[0],e},update:function(t,e,i){var r=e.getMap(),n=i.containerPoint,o=r.coordToContainerPoint(e._firstClick),s=[[o.x,o.y],[n.x,o.y],[n.x,n.y],[o.x,n.y]];e.setCoordinates(s.map(function(t){return r.containerPointToCoord(new ae(t))}))},generate:function(t){return t}}),mn.registerMode("freeHandRectangle",{action:["mousedown","mousemove","mouseup"],create:function(t){var e=new Rr([]);return e._firstClick=t[0],e},update:function(t,e){var i=e._firstClick,r=[[i.x,i.y],[t[0].x,i.y],[t[0].x,t[0].y],[i.x,t[0].y]];e.setCoordinates(r)},generate:function(t){return t}}),mn.registerMode("point",{clickLimit:1,action:["click"],create:function(t){return new Dr(t[0])},generate:function(t){return t}}),mn.registerMode("polygon",{action:["click","mousemove","dblclick"],create:function(t){return new zr(t)},update:function(t,e){var i=e.getSymbol();e.setCoordinates(t);var r=e.getLayer();if(r){var n=r.getGeometryById("polygon");if(!n&&t.length>=3){if(n=new Rr([t],{id:"polygon"}),i){var o=It(i,{lineOpacity:0});n.setSymbol(o)}n.addTo(r)}n&&n.setCoordinates(t)}},generate:function(t){return new Rr(t.getCoordinates(),{symbol:t.getSymbol()})}}),mn.registerMode("freeHandPolygon",{action:["mousedown","mousemove","mouseup"],create:function(t){return new zr(t)},update:function(t,e){var i=e.getCoordinates(),r=e.getSymbol();e.setCoordinates(i.concat(t));var n=e.getLayer();if(n){var o=n.getGeometryById("polygon");if(!o&&t.length>=3){if(o=new Rr([t],{id:"polygon"}),r){var s=It(r,{lineOpacity:0});o.setSymbol(s)}o.addTo(n)}o&&o.setCoordinates(t)}},generate:function(t){return new Rr(t.getCoordinates(),{symbol:t.getSymbol()})}}),mn.registerMode("linestring",{action:["click","mousemove","dblclick"],create:function(t){return new zr(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),mn.registerMode("freeHandLinestring",{action:["mousedown","mousemove","mouseup"],create:function(t){return new zr(t)},update:function(t,e){var i=e.getCoordinates();e.setCoordinates(i.concat(t))},generate:function(t){return t}}),mn.registerMode("arccurve",{action:["click","mousemove","dblclick"],create:function(t){return new Qr(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),mn.registerMode("quadbeziercurve",{action:["click","mousemove","dblclick"],create:function(t){return new tn(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),mn.registerMode("cubicbeziercurve",{action:["click","mousemove","dblclick"],create:function(t){return new $r(t)},update:function(t,e){e.setCoordinates(t)},generate:function(t){return t}}),mn.registerMode("boxZoom",{action:["mousedown","mousemove","mouseup"],create:function(t){var e=new Dr(t[0]);return e._firstClick=t[0],e},update:function(t,e,i){var r=e.getMap(),n=r.coordToContainerPoint(e._firstClick),o=i.containerPoint,s=r.containerPointToCoordinate(new di(Math.min(n.x,o.x),Math.min(n.y,o.y)));e.setCoordinates(s).updateSymbol({markerWidth:Math.abs(n.x-o.x),markerHeight:Math.abs(n.y-o.y)})},generate:function(t){return t}}),qi.loadArcgis=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{jsonp:!0};if(x(t)&&"{"!==t.substring(0,1))Qe.getJSON(t,function(t,i){if(t)e(t);else{var r=qn(i);e(null,r)}},i);else{x(t)&&(t=D(t));var r=qn(t);e(null,r)}return this};var Yn=function(t){function e(i){return p(this,e),f(this,t.call(this,i))}return c(e,t),e.prototype.addTo=function(t){return this._owner=t,this._switchEvents("on"),this.onAdd&&this.onAdd(),this.fire("add"),this},e.prototype.getMap=function(){return this._owner?this._owner.getBaseLayer?this._owner:this._owner.getMap():null},e.prototype.show=function(t){var e=this.getMap();if(!e)return this;this._mapEventsOn||this._switchMapEvents("on"),t=t||this._coordinate||this._owner.getCenter();var i=this.isVisible();this.fire("showstart");var r=this._getUIContainer();this._coordinate=t,this._removePrevDOM();var n=this.__uiDOM=this.buildOn(e);if(n.eventsPropagation=this.options.eventsPropagation,!n)return this.fire("showend"),this;this._measureSize(n),this._singleton()&&(e[this._uiDomKey()]=n),this._setPosition(),n.style[Se]=null,r.appendChild(n);var o=this._getAnimation();if(i&&(o.ok=!1),o.ok&&(o.fade&&(n.style.opacity=0),o.scale)){if(this.getTransformOrigin){var s=this.getTransformOrigin();n.style[Te]=s}n.style[Me]=Xn(this._pos)+" scale(0)"}n.style.display="",this.options.eventsToStop&&Xe(n,this.options.eventsToStop,Ie),this.options.autoPan&&this._autoPan();var a=o.transition;return o.ok&&a&&(n.offsetHeight,a&&(n.style[Se]=a),o.fade&&(n.style.opacity=1),o.scale&&(n.style[Me]=Xn(this._pos)+" scale(1)")),this.fire("showend"),this},e.prototype.hide=function(){if(!this.getDOM()||!this.getMap())return this;var t=this._getAnimation(),e=this.getDOM();return this.options.animationOnHide||(t.ok=!1),t.ok?(e.offsetHeight,e.style[Se]=t.transition,setTimeout(function(){e.style.display="none"},this.options.animationDuration)):e.style.display="none",t.fade&&(e.style.opacity=0),t.scale&&(e.style[Me]=Xn(this._pos)+" scale(0)"),this.fire("hide"),this},e.prototype.isVisible=function(){var t=this.getDOM();return this.getMap()&&t&&t.parentNode&&"none"!==t.style.display},e.prototype.remove=function(){return delete this._mapEventsOn,this._owner?(this.hide(),this._switchEvents("off"),this.onRemove&&this.onRemove(),!this._singleton()&&this.__uiDOM&&this._removePrevDOM(),delete this._owner,this.fire("remove"),this):this},e.prototype.getSize=function(){return this._size?this._size.copy():null},e.prototype.getOwner=function(){return this._owner},e.prototype.getDOM=function(){return this.__uiDOM},e.prototype.getPosition=function(){if(!this.getMap())return null;var t=this._getViewPoint()._round();if(this.getOffset){var e=this.getOffset()._round();e&&t._add(e)}return t},e.prototype._getAnimation=function(){for(var t={fade:!1,scale:!1},e=this.options.animation?this.options.animation.split(","):[],i=0;i<e.length;i++){var r=ue(e[i]);"fade"===r?t.fade=!0:"scale"===r&&(t.scale=!0)}var n=null;return t.fade&&(n="opacity "+this.options.animationDuration+"ms"),t.scale&&(n=n?n+",":"",n+=Me+" "+this.options.animationDuration+"ms"),t.transition=n,t.ok=null!==n,t},e.prototype._getViewPoint=function(){return this.getMap().coordToViewPoint(this._coordinate)._add(this.options.dx,this.options.dy)},e.prototype._autoPan=function(){var t=this.getMap(),e=this.getDOM();if(!t.isMoving()){var i=this._pos,r=t.getSize(),n=r.width,o=r.height,s=t.viewPointToContainerPoint(i),a=parseInt(e.clientWidth),h=parseInt(e.clientHeight),u=0,l=0;s.x<0?u=-(s.x-a/2):s.x+a-35>n&&(u=n-(s.x+3*a/2)),s.y<0?l=50-s.y:s.y>o&&(l=o-s.y-h-30),0===l&&0===u||t.panBy(new ae(u,l),{duration:this.options.autoPanDuration})}},e.prototype._measureSize=function(t){var e=this._getUIContainer();t.style.position="absolute",t.style.left="-99999px";var i=t.style.bottom?"bottom":"top";return t.style[i]="-99999px",t.style.display="",e.appendChild(t),this._size=new he(t.clientWidth,t.clientHeight),t.style.display="none",t.style.left="0px",t.style[i]="0px",this._size},e.prototype._removePrevDOM=function(){this.onDomRemove&&this.onDomRemove();var t=this.options.eventsToStop;if(this._singleton()){var e=this.getMap(),i=this._uiDomKey();e[i]&&(t&&Ke(e[i],t,Ie),Le(e[i]),delete e[i]),delete this.__uiDOM}else this.__uiDOM&&(t&&Ke(this.__uiDOM,t,Ie),Le(this.__uiDOM),delete this.__uiDOM)},e.prototype._uiDomKey=function(){return"__ui_"+this._getClassName()},e.prototype._singleton=function(){return this.options.single},e.prototype._getUIContainer=function(){return this.getMap()._panels.ui},e.prototype._getClassName=function(){return"UIComponent"},e.prototype._switchMapEvents=function(t){var e=this.getMap();if(e){this._mapEventsOn="on"===t;var i=this._getDefaultEvents();if(this.getEvents&&y(i,this.getEvents()),i)for(var r in i)i.hasOwnProperty(r)&&e[t](r,i[r],this)}},e.prototype._switchEvents=function(t){this._switchMapEvents(t);var e=this._getOwnerEvents();if(this._owner)for(var i in e)e.hasOwnProperty(i)&&this._owner[t](i,e[i],this)},e.prototype._getDefaultEvents=function(){return{"zooming rotate pitch":this.onEvent,zoomend:this.onZoomEnd,moving:this.onMoving}},e.prototype._getOwnerEvents=function(){var t={};return this._owner&&this._owner instanceof br&&(t.positionchange=this.onGeometryPositionChange),this.getOwnerEvents&&y(t,this.getOwnerEvents()),t},e.prototype.onGeometryPositionChange=function(t){this._owner&&this.isVisible()&&this.show(t.target.getCenter())},e.prototype.onMoving=function(){this.isVisible()&&this.getMap().isTransforming()&&this._updatePosition()},e.prototype.onEvent=function(){this.isVisible()&&this._updatePosition()},e.prototype.onZoomEnd=function(){this.isVisible()&&this._setPosition()},e.prototype._updatePosition=function(){this.getMap()._getRenderer().callInNextFrame(this._setPosition.bind(this))},e.prototype._setPosition=function(){var t=this.getDOM(),e=this.getPosition();this._pos=e,t.style[Se]=null,t.style[Me]=Xn(e)+" scale(1)"},e}(oi(ai));function Xn(t){return t?oe.any3d?"translate3d("+t.x+"px,"+t.y+"px, 0px)":"translate("+t.x+"px,"+t.y+"px)":""}Yn.mergeOptions({eventsPropagation:!1,eventsToStop:null,dx:0,dy:0,autoPan:!1,autoPanDuration:600,single:!0,animation:"scale",animationOnHide:!0,animationDuration:500});var Kn="mousedown mouseup mouseenter mouseover mouseout mousemove click dblclick contextmenu keypress touchstart touchmove touchend",Qn=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,r));return n._markerCoord=new di(i),n}return c(e,t),e.prototype._getClassName=function(){return"UIMarker"},e.prototype.setCoordinates=function(t){return this._markerCoord=t,this.fire("positionchange"),this.isVisible()&&(this._coordinate=this._markerCoord,this._setPosition()),this},e.prototype.getCoordinates=function(){return this._markerCoord},e.prototype.setContent=function(t){var e=this.options.content;return this.options.content=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.show(),this},e.prototype.getContent=function(){return this.options.content},e.prototype.onAdd=function(){this.show()},e.prototype.show=function(){return t.prototype.show.call(this,this._markerCoord)},e.prototype.flash=function(t,e,i,r){return nt.call(this,t,e,i,r)},e.prototype.buildOn=function(){var t=void 0;return x(this.options.content)?(t=Ee("div")).innerHTML=this.options.content:t=this.options.content,this._registerDOMEvents(t),t},e.prototype.getOffset=function(){var t=this.getSize();return new ae(-t.width/2,-t.height/2)},e.prototype.getTransformOrigin=function(){return"center center"},e.prototype.onDomRemove=function(){var t=this.getDOM();this._removeDOMEvents(t)},e.prototype.isDragging=function(){return!!this.draggable&&this.draggable.isDragging()},e.prototype._registerDOMEvents=function(t){Xe(t,Kn,this._onDomEvents,this)},e.prototype._onDomEvents=function(t){var e=this.getMap()._parseEvent(t,t.type);this.fire(t.type,e)},e.prototype._removeDOMEvents=function(t){Ke(t,Kn,this._onDomEvents,this)},e.prototype._getConnectPoints=function(){var t=this.getMap(),e=t.coordToContainerPoint(this.getCoordinates()),i=this.getSize(),r=i.width,n=i.height;return[t.containerPointToCoordinate(e.add(-r/2,0)),t.containerPointToCoordinate(e.add(r/2,0)),t.containerPointToCoordinate(e.add(0,n/2)),t.containerPointToCoordinate(e.add(0,-n/2))]},e}(li(Yn));Qn.mergeOptions({eventsPropagation:!0,draggable:!1,single:!1,content:null});var $n=oe.touch?"touchstart mousedown":"mousedown",to=function(t){function e(i){return p(this,e),f(this,t.call(this,i))}return c(e,t),e.prototype.addHooks=function(){this.target.on($n,this._startDrag,this)},e.prototype.removeHooks=function(){this.target.off($n,this._startDrag,this)},e.prototype._startDrag=function(t){var e=t.domEvent;e.touches&&e.touches.length>1||2===e.button||this.isDragging()||(this.target.on("click",this._endDrag,this),this._lastCoord=t.coordinate,this._lastPoint=t.containerPoint,this._prepareDragHandler(),this._dragHandler.onMouseDown(t.domEvent),this.target.fire("dragstart",t))},e.prototype._prepareDragHandler=function(){this._dragHandler=new fi(this.target.getDOM(),{cancelOn:this._cancelOn.bind(this),ignoreMouseleave:!0}),this._dragHandler.on("mousedown",this._onMouseDown,this),this._dragHandler.on("dragging",this._dragging,this),this._dragHandler.on("mouseup",this._endDrag,this),this._dragHandler.enable()},e.prototype._cancelOn=function(t){var e=(t.srcElement||t.target).tagName.toLowerCase();return"button"===e||"input"===e||"select"===e||"option"===e||"textarea"===e},e.prototype._onMouseDown=function(t){Ie(t.domEvent)},e.prototype._dragging=function(t){var e=this.target,i=e.getMap()._parseEvent(t.domEvent),r=i.domEvent;if(!(r.touches&&r.touches.length>1))if(this._isDragging){var n=i.coordinate,o=i.containerPoint;this._lastCoord||(this._lastCoord=n),this._lastPoint||(this._lastPoint=o);var s=n.sub(this._lastCoord),a=o.sub(this._lastPoint);this._lastCoord=n,this._lastPoint=o,this.target.setCoordinates(this.target.getCoordinates().add(s)),i.coordOffset=s,i.pointOffset=a,e.fire("dragging",i)}else this._isDragging=!0},e.prototype._endDrag=function(t){var e=this.target,i=e.getMap();if(this._dragHandler&&(e.off("click",this._endDrag,this),this._dragHandler.disable(),delete this._dragHandler),delete this._lastCoord,delete this._lastPoint,this._isDragging=!1,i){var r=i._parseEvent(t.domEvent);e.fire("dragend",r)}},e.prototype.isDragging=function(){return!!this._isDragging},e}(si);Qn.addInitHook("addHandler","draggable",to);var eo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype._getClassName=function(){return"InfoWindow"},e.prototype.addTo=function(e){return e instanceof br&&(e.getInfoWindow()&&e.getInfoWindow()!==this&&e.removeInfoWindow(),e._infoWindow=this),t.prototype.addTo.call(this,e)},e.prototype.setContent=function(t){var e=this.options.content;return this.options.content=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.show(this._coordinate),this},e.prototype.getContent=function(){return this.options.content},e.prototype.setTitle=function(t){var e=t;return this.options.title=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.show(this._coordinate),this},e.prototype.getTitle=function(){return this.options.title},e.prototype.buildOn=function(){if(this.options.custom){if(x(this.options.content)){var t=Ee("div");return t.innerHTML=this.options.content,t}return this.options.content}var e=Ee("div");e.className="maptalks-msgBox",e.style.width=this._getWindowWidth()+"px",e.style.bottom="0px";var i='<em class="maptalks-ico"></em>';this.options.title&&(i+="<h2>"+this.options.title+"</h2>");var r="\"this.parentNode.style.display='none';return false;\"";return i+='<a href="javascript:void(0);" onclick='+r+" ontouchend="+r+' class="maptalks-close"></a><div class="maptalks-msgContent">'+this.options.content+"</div>",e.innerHTML=i,e},e.prototype.getTransformOrigin=function(){return this.getSize().width/2+"px bottom"},e.prototype.getOffset=function(){var t=this.getSize(),e=new ae(-t.width/2,0);this.options.custom||e._sub(4,12);var i=this.getOwner();if(i instanceof Dr){var r=i._getPainter();if(r){var n=i.getSize(),o=r.getFixedExtent();e._add(o.xmax-n.width/2,o.ymin)}}return e},e.prototype.show=function(e){return this.getMap()&&this.getMap().options.enableInfoWindow?t.prototype.show.call(this,e):this},e.prototype.getEvents=function(){if(!this.options.autoCloseOn)return null;var t={};return t[this.options.autoCloseOn]=this.hide,t},e.prototype.getOwnerEvents=function(){var t=this.getOwner();if(!this.options.autoOpenOn||!t)return null;var e={};return e[this.options.autoOpenOn]=this._onAutoOpen,e},e.prototype._onAutoOpen=function(t){var e=this,i=this.getOwner();setTimeout(function(){i instanceof Dr?e.show(i.getCoordinates()):e.show(t.coordinate)},1)},e.prototype._getWindowWidth=function(){var t=this.options.width;return t||(t=300),t},e}(Yn);eo.mergeOptions({autoPan:!0,autoCloseOn:null,autoOpenOn:"click",width:300,minHeight:120,custom:!1,title:null,content:null});var io={width:0,height:0,animation:"fade",cssName:"maptalks-tooltip",showTimeout:400},ro=function(t){function e(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(this,e);var n=f(this,t.call(this,r));return n._content=i,n}return c(e,t),e.prototype._getClassName=function(){return"ToolTip"},e.prototype.addTo=function(e){if(e instanceof br)return e.on("mousemove",this.onMouseMove,this),e.on("mouseout",this.onMouseOut,this),t.prototype.addTo.call(this,e);throw new Error("Invalid geometry the tooltip is added to.")},e.prototype.setStyle=function(t){return this.options.cssName=t,this},e.prototype.getStyle=function(){return this.options.cssName},e.prototype.getContent=function(){return this._content},e.prototype.buildOn=function(){var t=Ee("div");io.height&&(t.style.height=io.height+"px"),io.width&&(t.style.width=io.width+"px");var e=this.options.cssName;return!e&&io.height&&(t.style.lineHeight=io.height+"px"),t.innerHTML='<div class="'+e+'">'+this._content+"</div>",t},e.prototype.onMouseOut=function(){clearTimeout(this._timeout),this.isVisible()&&this._removePrevDOM()},e.prototype.onMouseMove=function(t){var e=this;clearTimeout(this._timeout);var i=this.getMap();if(i){var r=i.locateByPoint(t.coordinate,-5,25);0===this.options.showTimeout?this.show(r):this._timeout=setTimeout(function(){i&&e.show(r)},this.options.showTimeout)}},e.prototype.onRemove=function(){clearTimeout(this._timeout),this._owner&&(this._owner.off("mouseover",this.onMouseOver,this),this._owner.off("mouseout",this.onMouseOut,this))},e}(Yn);ro.mergeOptions(io);var no=function(t){function e(i){return p(this,e),f(this,t.call(this,i))}return c(e,t),e.prototype._getClassName=function(){return"Menu"},e.prototype.addTo=function(t){return t._menu&&t._menu!==this&&t.removeMenu(),t._menu=this,Yn.prototype.addTo.apply(this,arguments)},e.prototype.setItems=function(t){return this.options.items=t,this},e.prototype.getItems=function(){return this.options.items||[]},e.prototype.buildOn=function(){if(this.options.custom){if(x(this.options.items)){var t=Ee("div");return t.innerHTML=this.options.items,t}return this.options.items}var e=Ee("div");Ne(e,"maptalks-menu"),e.style.width=this._getMenuWidth()+"px";var i=this._createMenuItemDom();return e.appendChild(i),Xe(e,"contextmenu",De),e},e.prototype.getOffset=function(){if(!this.getMap())return null;var t=this.getMap().getSize(),e=this.getMap().viewPointToContainerPoint(this._getViewPoint()),i=this.getSize(),r=0,n=0;return e.x+i.width>t.width&&(r=-i.width),e.y+i.height>t.height&&(n=-i.height),new ae(r,n)},e.prototype.getTransformOrigin=function(){var t=this.getOffset()._multi(-1);return t.x+"px "+t.y+"px"},e.prototype.getEvents=function(){return{"_zoomstart _zoomend _movestart _dblclick _click":this._removePrevDOM}},e.prototype._createMenuItemDom=function(){var t=this,e=this.getMap(),i=Ee("ul");Ne(i,"maptalks-menu-items");var r=this.getItems();function n(i){return function(r){var n=e._parseEvent(r,"click");n.target=t,n.owner=t._owner,n.index=i,!1!==this._callback(n)&&t.hide()}}for(var o=void 0,s=void 0,a=0,h=r.length;a<h;a++){if("-"===(o=r[a])||"_"===o)Ne(s=Ee("li"),"maptalks-menu-splitter");else{s=Ee("li");var u=o.item;w(u)&&(u=u({owner:this._owner,index:a})),s.innerHTML=u,s._callback=o.click,Xe(s,"click",n(a))}i.appendChild(s)}var l=this.options.maxHeight||0;return l>0&&Fe(i,"max-height: "+l+"px; overflow-y: auto;"),i},e.prototype._getMenuWidth=function(){return this.options.width||160},e}(Yn);no.mergeOptions({animation:null,animationDelay:10,animationOnHide:!1,autoPan:!1,width:160,maxHeight:0,custom:!1,items:[]});var oo={setMenu:function(t){return this._menuOptions=t,this._menu?this._menu.setOptions(t):this.on("contextmenu",this._defaultOpenMenu,this),this},openMenu:function(t){var e=this instanceof Xi?this:this.getMap();return t||(t=this.getCenter()),this._menu?this._menu.show(t):this._menuOptions&&e&&(this._bindMenu(this._menuOptions),this._menu.show(t)),this},setMenuItems:function(t){return this._menuOptions||(this._menuOptions={}),Array.isArray(t)&&(this._menuOptions.custom=!1),this._menuOptions.items=t,this.setMenu(this._menuOptions),this},getMenuItems:function(){return this._menu?this._menu.getItems():this._menuOptions&&this._menuOptions.items||[]},closeMenu:function(){return this._menu&&this._menu.hide(),this},removeMenu:function(){return this.off("contextmenu",this._defaultOpenMenu,this),this._unbindMenu(),delete this._menuOptions,this},_bindMenu:function(t){return this._menu=new no(t),this._menu.addTo(this),this},_unbindMenu:function(){return this._menu&&(this.closeMenu(),this._menu.remove(),delete this._menu),this},_defaultOpenMenu:function(t){return this.listens("contextmenu")>1||(this.openMenu(t.coordinate),!1)}};Xi.include(oo),br.include(oo);Object.freeze({UIComponent:Yn,UIMarker:Qn,InfoWindow:eo,ToolTip:ro,Menuable:oo,Menu:no});var so=function(t){function e(i){return p(this,e),i&&i.position&&!x(i.position)&&(i.position=y({},i.position)),f(this,t.call(this,i))}return c(e,t),e.prototype.addTo=function(t){if(this.remove(),!t.options.control)return this;this._map=t;var e=t._panels.control;return this.__ctrlContainer=Ee("div"),Fe(this.__ctrlContainer,"position:absolute;overflow:visible;"),this.update(),e.appendChild(this.__ctrlContainer),this.onAdd&&this.onAdd(),this.fire("add",{dom:e}),this},e.prototype.update=function(){return this.__ctrlContainer.innerHTML="",this._controlDom=this.buildOn(this.getMap()),this._controlDom&&(this._updatePosition(),this.__ctrlContainer.appendChild(this._controlDom)),this},e.prototype.getMap=function(){return this._map},e.prototype.getPosition=function(){return y({},this._parse(this.options.position))},e.prototype.setPosition=function(t){return x(t)?this.options.position=t:this.options.position=y({},t),this._updatePosition(),this},e.prototype.getContainerPoint=function(){var t=this.getPosition(),e=this.getMap().getSize(),i=void 0,r=void 0;return g(t.left)?g(t.right)||(i=e.width-parseInt(t.right)):i=parseInt(t.left),g(t.top)?g(t.bottom)||(r=e.height-parseInt(t.bottom)):r=parseInt(t.top),new ae(i,r)},e.prototype.getContainer=function(){return this.__ctrlContainer},e.prototype.getDOM=function(){return this._controlDom},e.prototype.show=function(){return this.__ctrlContainer.style.display="",this},e.prototype.hide=function(){return this.__ctrlContainer.style.display="none",this},e.prototype.isVisible=function(){return this.__ctrlContainer&&""===this.__ctrlContainer.style.display},e.prototype.remove=function(){return this._map?(Le(this.__ctrlContainer),this.onRemove&&this.onRemove(),delete this._map,delete this.__ctrlContainer,delete this._controlDom,this.fire("remove"),this):this},e.prototype._parse=function(t){var i=t;return x(t)&&(i=e.positions[i]),i},e.prototype._updatePosition=function(){var t=this.getPosition();for(var e in t||(t={top:20,left:20}),t)t.hasOwnProperty(e)&&(t[e]=parseInt(t[e]),this.__ctrlContainer.style[e]=t[e]+"px");this.fire("positionchange",{position:y({},t)})},e}(oi(ai));so.positions={"top-left":{top:20,left:20},"top-right":{top:20,right:20},"bottom-left":{bottom:20,left:20},"bottom-right":{bottom:20,right:20}},Xi.mergeOptions({control:!0}),Xi.include({addControl:function(t){return this._containerDOM.getContext?this:(t.addTo(this),this)},removeControl:function(t){return t&&t.getMap()===this?(t.remove(),this):this}});var ao="addlayer removelayer setbaselayer baselayerremove",ho=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(){return this._attributionContainer=Ee("div"),this._attributionContainer.className="maptalks-attribution",this._update(),this._attributionContainer},e.prototype.onAdd=function(){this.getMap().on(ao,this._update,this)},e.prototype.onRemove=function(){this.getMap().off(ao,this._update,this)},e.prototype._update=function(){var t=this.getMap();if(t){var e=t._getLayers(function(t){return t.options.attribution}).reverse().map(function(t){return t.options.attribution}),i=this.options.content+(e.length>0?" - "+e.join(", "):"");this._attributionContainer.innerHTML='<span style="padding:0px 4px">'+i+"</span>"}},e}(so);ho.mergeOptions({position:{bottom:0,left:0},content:'<a href="http://maptalks.org" target="_blank">maptalks</a>'}),Xi.mergeOptions({attribution:!0}),Xi.addOnLoadHook(function(){var t=this.options.attribution||this.options.attributionControl;t&&(this.attributionControl=new ho(t),this.addControl(this.attributionControl))});var uo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(){var t=this.container=Ee("div",this.options.containerClass),e=this.panel=Ee("div","panel"),i=this.button=Ee("button");return t.appendChild(i),t.appendChild(e),t},e.prototype.onAdd=function(){Xe(this.button,"mouseover",this._show,this),Xe(this.panel,"mouseleave",this._hide,this),Xe(this.getMap(),"click",this._hide,this)},e.prototype.onRemove=function(){this.panel&&(Ke(this.button,"mouseover",this._show,this),Ke(this.panel,"mouseleave",this._hide,this),Ke(this.getMap(),"click",this._hide,this),Le(this.panel),Le(this.button),delete this.panel,delete this.button,delete this.container)},e.prototype._show=function(){We(this.container,"shown")||(Ne(this.container,"shown"),this._createPanel())},e.prototype._hide=function(t){this.panel.contains(t.toElement||t.relatedTarget)||Be(this.container,this.options.containerClass)},e.prototype._createPanel=function(){this.panel.innerHTML="";var t=Ee("ul");this.panel.appendChild(t),this._renderLayers(this.getMap(),t)},e.prototype._renderLayers=function(t,e){var i=t.getBaseLayer(),r=t.getLayers(),n=r.length;if(i){var o=i.layers||[i],s=Ee("li","group"),a=Ee("ul"),h=Ee("label");h.innerHTML=this.options.baseTitle,s.appendChild(h);for(var u=0,l=o.length;u<l;u++){var p=o[u];this._isExcluded(p)&&(a.appendChild(this._renderLayer(o[u],!0)),s.appendChild(a),e.appendChild(s))}}if(n){var c=Ee("li","group"),f=Ee("ul"),d=Ee("label");d.innerHTML=this.options.overlayTitle,c.appendChild(d);for(var y=0;y<n;y++){var g=r[y];this._isExcluded(g)&&f.appendChild(this._renderLayer(g))}c.appendChild(f),e.appendChild(c)}},e.prototype._isExcluded=function(t){var e=t.getId(),i=this.options.excludeLayers;return!(i.length&&i.indexOf(e)>=0)},e.prototype._renderLayer=function(t,e){var i=this,r=Ee("li","layer"),n=Ee("label"),o=Ee("input"),s=this.getMap(),a=t.options.visible;t.options.visible=!0;var h=t.isVisible();return t.options.visible=a,r.className="layer",e?(o.type="radio",o.name="base"):o.type="checkbox",o.checked=a&&h,h||o.setAttribute("disabled","disabled"),o.onchange=function(e){if("radio"===e.target.type){var r=s.getBaseLayer(),n=r.layers;if(n)for(var o=0,a=n.length;o<a;o++){var h=n[o];h[h===t?"show":"hide"]()}else r.isVisible()||r.show();s._fireEvent("setbaselayer")}else t[e.target.checked?"show":"hide"]();i.fire("layerchange",{target:t})},r.appendChild(o),n.innerHTML=t.getId(),r.appendChild(n),r},e}(so);uo.mergeOptions({position:"top-right",baseTitle:"Base Layers",overlayTitle:"Layers",excludeLayers:[],containerClass:"maptalks-layer-switcher"}),Xi.mergeOptions({layerSwitcherControl:!1}),Xi.addOnLoadHook(function(){this.options.layerSwitcherControl&&(this.layerSwitcherControl=new uo(this.options.layerSwitcherControl),this.addControl(this.layerSwitcherControl))});var lo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(){var t=this.options.size;this.options.maximize||(t=[0,0]);var e=Ee("div"),i=this.mapContainer=Ee("div");i.style.width=t[0]+"px",i.style.height=t[1]+"px",i.className=this.options.containerClass;var r=this.button=Ee("div");return r.className=this.options.buttonClass,e.appendChild(i),e.appendChild(r),e},e.prototype.onAdd=function(){this.options.maximize&&this._createOverview(),this.getMap().on("resize moving zooming rotate dragrotating viewchange",this._update,this).on("setbaselayer",this._updateBaseLayer,this).on("spatialreferencechange",this._updateSpatialReference,this),Xe(this.button,"click",this._onButtonClick,this),this._updateButtonText()},e.prototype.onRemove=function(){this.getMap().off("resize moving zooming rotate dragrotating viewchange",this._update,this).off("setbaselayer",this._updateBaseLayer,this).off("spatialreferencechange",this._updateSpatialReference,this),this._overview&&(this._overview.remove(),delete this._overview,delete this._perspective),Ke(this.button,"click",this._onButtonClick,this)},e.prototype.maxmize=function(){var t=this.options.size,e=this.mapContainer;e.style.width=t[0]+"px",e.style.height=t[1]+"px",this._createOverview()},e.prototype.minimize=function(){this._overview&&this._overview.remove(),delete this._overview,delete this._perspective;var t=this.mapContainer;t.style.width="0px",t.style.height="0px"},e.prototype._onButtonClick=function(){this._overview?this.minimize():this.maxmize(),this._updateButtonText()},e.prototype._updateButtonText=function(){this._overview?this.button.innerHTML="-":this.button.innerHTML="+"},e.prototype._createOverview=function(){var t=this.getMap(),e=this.mapContainer,i=t.config();y(i,{center:t.getCenter(),zoom:this._getOverviewZoom(),zoomAnimationDuration:150,pitch:0,bearing:0,scrollWheelZoom:!1,checkSize:!1,doubleClickZoom:!1,touchZoom:!1,control:!1,draggable:!1,maxExtent:null}),this._overview=new Xi(e,i),this._updateBaseLayer(),this._perspective=new Rr(this._getPerspectiveCoords(),{draggable:!0,cursor:"move",symbol:this.options.symbol}).on("dragend",this._onDragEnd,this),new fn("perspective_layer",this._perspective).addTo(this._overview),this.fire("load")},e.prototype._getOverviewZoom=function(){var t=this.getMap(),e=t.getZoom(),i=t.getMinZoom(),r=this.options.level;if(r>0){for(var n=r;n>0;n--)if(e-n>=i)return e-n}else for(var o=r;o<0;o++)if(e-o>=i)return e-o;return e},e.prototype._onDragEnd=function(){var t=this._perspective.getCenter();this._overview.setCenter(t),this.getMap().panTo(t)},e.prototype._getPerspectiveCoords=function(){var t=this.getMap();return t.getContainerExtent().toArray().map(function(e){return t.containerPointToCoordinate(e)})},e.prototype._update=function(){if(this._overview){var t=this._getPerspectiveCoords();this._perspective.setCoordinates(t),this._overview.setCenterAndZoom(this.getMap().getCenter(),this._getOverviewZoom())}},e.prototype._updateSpatialReference=function(){if(this._overview){var t=this.getMap().options.spatialReference;this._overview.setSpatialReference(t)}},e.prototype._updateBaseLayer=function(){if(this._overview){var t=this.getMap().getBaseLayer();if(t){var e=t.layers,i=0;if(e)for(var r=0,n=e.length;r<n;r++){if(e[r].isVisible()){i=r;break}}var o=t.toJSON(),s=null;e?(s=o.layers[i].options).visible=!0:s=o.options,this._overview.setMinZoom(s.minZoom||null).setMaxZoom(s.maxZoom||null),delete s.minZoom,delete s.maxZoom,delete o.options.canvas,o.options.visible=!0,o.options.renderer="canvas";var a=Vi.fromJSON(o);for(var h in t)w(t[h])&&t.hasOwnProperty(h)&&t[h]!==t.constructor.prototype[h]&&(a[h]=t[h]);this._overview.setBaseLayer(a)}else this._overview.setBaseLayer(null)}},e}(so);lo.mergeOptions({level:4,position:{right:1,bottom:1},size:[300,200],maximize:!0,symbol:{lineWidth:3,lineColor:"#1bbc9b",polygonFill:"#1bbc9b",polygonOpacity:.4},containerClass:"maptalks-overview",buttonClass:"maptalks-overview-button"}),Xi.mergeOptions({overviewControl:!1}),Xi.addOnLoadHook(function(){this.options.overviewControl&&(this.overviewControl=new lo(this.options.overviewControl),this.addControl(this.overviewControl))});var po=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(){var t=void 0;if(this.options.custom)x(this.options.content)?(t=Ee("div")).innerHTML=this.options.content:t=this.options.content;else{if(t=Ee("div","maptalks-panel"),this.options.closeButton){var e=Ee("a","maptalks-close");e.href="javascript:;",e.onclick=function(){t.style.display="none"},t.appendChild(e)}var i=Ee("div","maptalks-panel-content");i.innerHTML=this.options.content,t.appendChild(i)}return this.draggable=new fi(t,{cancelOn:this._cancelOn.bind(this),ignoreMouseleave:!0}),this.draggable.on("dragstart",this._onDragStart,this).on("dragging",this._onDragging,this).on("dragend",this._onDragEnd,this),this.options.draggable&&this.draggable.enable(),t},e.prototype.update=function(){return this.draggable&&(this.draggable.disable(),delete this.draggable),so.prototype.update.call(this)},e.prototype.setContent=function(t){var e=this.options.content;return this.options.content=t,this.fire("contentchange",{old:e,new:t}),this.isVisible()&&this.update(),this},e.prototype.getContent=function(){return this.options.content},e.prototype._cancelOn=function(t){var e=(t.srcElement||t.target).tagName.toLowerCase();return"button"===e||"input"===e||"select"===e||"option"===e||"textarea"===e},e.prototype._onDragStart=function(t){this._startPos=t.mousePos,this._startPosition=y({},this.getPosition()),this.fire("dragstart",t)},e.prototype._onDragging=function(t){var e=t.mousePos.sub(this._startPos),i=this._startPosition,r=this.getPosition();g(r.top)||(r.top=parseInt(i.top)+e.y),g(r.bottom)||(r.bottom=parseInt(i.bottom)-e.y),g(r.left)||(r.left=parseInt(i.left)+e.x),g(r.right)||(r.right=parseInt(i.right)-e.x),this.setPosition(r),this.fire("dragging",t)},e.prototype._onDragEnd=function(t){delete this._startPos,delete this._startPosition,this.fire("dragend",t)},e.prototype._getConnectPoints=function(){var t=this.getMap(),e=this.getContainerPoint(),i=this.getDOM(),r=parseInt(i.clientWidth),n=parseInt(i.clientHeight);return[t.containerPointToCoordinate(e.add(r/2,0)),t.containerPointToCoordinate(e.add(r,n/2)),t.containerPointToCoordinate(e.add(r/2,n)),t.containerPointToCoordinate(e.add(0,n/2))]},e}(so);po.mergeOptions({position:"top-right",draggable:!0,custom:!1,content:"",closeButton:!0});var co=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(t){return this._map=t,this._scaleContainer=Ee("div"),this._addScales(),t.on("zoomend",this._update,this),this._map._loaded&&this._update(),this._scaleContainer},e.prototype.onRemove=function(){this.getMap().off("zoomend",this._update,this)},e.prototype._addScales=function(){var t="border: 2px solid #000000;border-top: none;line-height: 1.1;padding: 2px 5px 1px;color: #000000;font-size: 11px;text-align:center;white-space: nowrap;overflow: hidden;-moz-box-sizing: content-box;box-sizing: content-box;background: #fff; background: rgba(255, 255, 255, 0);";this.options.metric&&(this._mScale=ke("div",t,this._scaleContainer)),this.options.imperial&&(this._iScale=ke("div",t,this._scaleContainer))},e.prototype._update=function(){var t=this._map.pixelToDistance(this.options.maxWidth,0);this._updateScales(t)},e.prototype._updateScales=function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},e.prototype._updateMetric=function(t){var e=this._getRoundNum(t),i=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,i,e/t)},e.prototype._updateImperial=function(t){var e=3.2808399*t,i=void 0,r=void 0,n=void 0;e>5280?(i=e/5280,r=this._getRoundNum(i),this._updateScale(this._iScale,r+" mile",r/i)):(n=this._getRoundNum(e),this._updateScale(this._iScale,n+" feet",n/e))},e.prototype._updateScale=function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},e.prototype._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)},e}(so);co.mergeOptions({position:"bottom-left",maxWidth:100,metric:!0,imperial:!1}),Xi.mergeOptions({scaleControl:!1}),Xi.addOnLoadHook(function(){this.options.scaleControl&&(this.scaleControl=new co(this.options.scaleControl),this.addControl(this.scaleControl))});var fo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(t){this._map=t;var e=Ee("div"),i=Ee("ul","maptalks-toolbar-hx");e.appendChild(i),this.options.vertical?Ne(e,"maptalks-toolbar-vertical"):Ne(e,"maptalks-toolbar-horizonal");var r=this;function n(t,e,i,n){var o=r._getItems()[e];return function(r){return Ie(r),t({target:o,index:e,childIndex:i,dom:n})}}var o=this.options.items;if(V(o))for(var s=0,a=o.length;s<a;s++){var h=o[s],u=Ee("li");if(28!==this.options.height&&(u.style.lineHeight=this.options.height+"px"),u.style.height=this.options.height+"px",u.style.cursor="pointer",Je(h.item)){u.style.textAlign="center";var l=qe("div",h.item);u.innerHTML='<div style="margin-top:'+(this.options.height-l.height)/2+'px;">'+h.item+"</div>"}else u.innerHTML=h.item;if(h.click&&Xe(u,"click",n(h.click,s,null,u)),V(h.children)){var p=this._createDropMenu(s);u.appendChild(p),u._menu=p,Xe(u,"mouseover",function(){this._menu.style.display=""}),Xe(u,"mouseout",function(){this._menu.style.display="none"})}i.appendChild(u)}return e},e.prototype._createDropMenu=function(t){var e=this;function i(t,i,r){var n=e._getItems()[i].children[r];return function(e){return Ie(e),t({target:n,index:i,childIndex:r})}}var r=Ee("div","maptalks-dropMenu"),n=this._getItems(),o=n.length,s=Ee("ul"),a=n[t].children;t===o-1&&a&&(r.style.cssText="right: 0px;",s.style.cssText="right: 0px;position: absolute;",this.options.reverseMenu&&(s.style.bottom=0)),r.appendChild(Ee("em","maptalks-ico"));for(var h=0,u=0,l=a.length;u<l;u++){var p=ge(a[u].item,"12px");p.width>h&&(h=p.width)}for(var c=0,f=a.length;c<f;c++){var d=a[c],y=Ee("li");y.innerHTML='<a href="javascript:;">'+d.item+"</a>",y.style.cursor="pointer",y.style.width=h+24+"px",Xe(y.childNodes[0],"click",i(d.click,t,c)),s.appendChild(y)}if(this.options.vertical){var g=h<95?95:h;this.options.reverseMenu?r.style.right=-(g+20)+"px":r.style.left=-(g+20)+"px"}else this.options.reverseMenu?r.style.bottom="28px":r.style.top="28px";return r.appendChild(s),r.style.display="none",r},e.prototype._getItems=function(){return this.options.items||[]},e}(so);fo.mergeOptions({height:28,vertical:!1,position:"top-right",reverseMenu:!1,items:{}});var yo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.buildOn=function(t){var e=this.options,i=Ee("div","maptalks-zoom");if(e.zoomLevel){var r=Ee("span","maptalks-zoom-zoomlevel");i.appendChild(r),this._levelDOM=r}var n=Ee("div","maptalks-zoom-slider"),o=Ee("a","maptalks-zoom-zoomin");if(o.href="javascript:;",o.innerHTML="+",n.appendChild(o),this._zoomInButton=o,e.slider){var s=Ee("div","maptalks-zoom-slider-box"),a=Ee("div","maptalks-zoom-slider-ruler"),h=Ee("span","maptalks-zoom-slider-reading"),u=Ee("span","maptalks-zoom-slider-dot");a.appendChild(h),s.appendChild(a),s.appendChild(u),n.appendChild(s),this._sliderBox=s,this._sliderRuler=a,this._sliderReading=h,this._sliderDot=u}var l=Ee("a","maptalks-zoom-zoomout");return l.href="javascript:;",l.innerHTML="-",n.appendChild(l),this._zoomOutButton=l,i.appendChild(n),t.on("_zoomend _zoomstart _spatialreferencechange",this._update,this),this._update(),this._registerDomEvents(),i},e.prototype.onRemove=function(){this.getMap().off("_zoomend _zoomstart _spatialreferencechange",this._update,this),this._zoomInButton&&Ke(this._zoomInButton,"click",this._onZoomInClick,this),this._zoomOutButton&&Ke(this._zoomOutButton,"click",this._onZoomOutClick,this),this._sliderRuler&&(Ke(this._sliderRuler,"click",this._onClickRuler,this),this.dotDragger.disable(),delete this.dotDragger)},e.prototype._update=function(){var t=this.getMap();if(this._sliderBox){var e=10*(t.getMaxZoom()-t.getMinZoom());this._sliderBox.style.height=e+16+"px",this._sliderRuler.style.height=e+8+"px",this._sliderRuler.style.cursor="pointer";var i=10*(t.getMaxZoom()-t.getZoom());this._sliderReading.style.height=10*(t.getZoom()-t.getMinZoom()+1)+"px",this._sliderDot.style.top=i+"px"}this._updateText()},e.prototype._updateText=function(){if(this._levelDOM){var t=this.getMap().getZoom();_(t)||(t=t.toFixed(1)),this._levelDOM.innerHTML=t}},e.prototype._registerDomEvents=function(){this._zoomInButton&&Xe(this._zoomInButton,"click",this._onZoomInClick,this),this._zoomOutButton&&Xe(this._zoomOutButton,"click",this._onZoomOutClick,this),this._sliderRuler&&(Xe(this._sliderRuler,"click",this._onClickRuler,this),this.dotDragger=new fi(this._sliderDot,{ignoreMouseleave:!0}),this.dotDragger.on("dragstart",this._onDotDragstart,this).on("dragging dragend",this._onDotDrag,this).enable())},e.prototype._onZoomInClick=function(t){De(t),this.getMap().zoomIn()},e.prototype._onZoomOutClick=function(t){De(t),this.getMap().zoomOut()},e.prototype._onClickRuler=function(t){De(t);var e=this.getMap(),i=Ge(t,this._sliderRuler).y,r=e.getMaxZoom(),n=Math.floor(r-i/10);e.setZoom(n)},e.prototype._onDotDragstart=function(t){De(t.domEvent);var e=this.getMap(),i=e.getSize().toPoint()._multi(.5);e.onZoomStart(e.getZoom(),i)},e.prototype._onDotDrag=function(t){De(t.domEvent);var e=this.getMap(),i=e.getSize().toPoint()._multi(.5),r=Ge(t.domEvent,this._sliderRuler),n=e.getMaxZoom(),o=e.getMinZoom(),s=r.y,a=n-s/10;n<a?(a=n,s=0):o>a&&(a=o,s=10*(n-o)),"dragging"===t.type?e.onZooming(a,i,1):"dragend"===t.type&&(this.options.seamless?e.onZoomEnd(a,i):e.onZoomEnd(Math.round(a),i)),this._sliderDot.style.top=s+"px",this._sliderReading.style.height=10*(e.getZoom()-o+1)+"px",this._updateText()},e}(so);yo.mergeOptions({position:"top-left",slider:!0,zoomLevel:!0,seamless:!1}),Xi.mergeOptions({zoomControl:!1}),Xi.addOnLoadHook(function(){this.options.zoomControl&&(this.zoomControl=new yo(this.options.zoomControl),this.addControl(this.zoomControl))});Object.freeze({Control:so,Attribution:ho,LayerSwitcher:uo,Overview:lo,Panel:po,Scale:co,Toolbar:fo,Zoom:yo});var go=function(){function t(e,i,r,n){p(this,t),Array.isArray(e)?(this.scale={x:e[0],y:e[1]},this.origin={x:e[2],y:e[3]}):(this.scale={x:e,y:i},this.origin={x:r,y:n})}return t.getDefault=function(t){return"baidu"===t.code.toLowerCase()?"baidu":t.code.toLowerCase()==="EPSG:4326".toLowerCase()?"tms-global-geodetic":"identity"===t.code.toLowerCase()?[1,-1,0,0]:"web-mercator"},t}(),mo=6378137*Math.PI;y(go,{"web-mercator":new go([1,-1,-mo,mo]),"tms-global-mercator":new go([1,1,-mo,-mo]),"tms-global-geodetic":new go([1,1,-180,-90]),baidu:new go([1,1,0,0])});var _o=function(){function t(e,i,r){p(this,t),this.tileSize=r,this.fullExtent=i,this.prepareTileInfo(e,i)}return t.prototype.prepareTileInfo=function(t,e){if(x(t)?t=go[t.toLowerCase()]:Array.isArray(t)&&(t=new go(t)),!t)throw new Error("Invalid TileSystem");this.tileSystem=t;var i=e.right>e.left?1:-1,r=e.top>e.bottom?-1:1,n=t.origin.x,o=t.origin.y;this.transformation=new vi([i,r,n,o])},t.prototype._getTileNum=function(t,e){var i=this.tileSystem,r=this.tileSize,n=Math.floor(1e-7+t.x/(r.width*e)),o=-Math.floor(1e-7+t.y/(r.height*e));return{x:i.scale.x*n,y:i.scale.y*o}},t.prototype.getTileIndex=function(t,e){var i=this.tileSystem,r=this.transformation.transform(t,1),n=this._getTileNum(r,e);return i.scale.x<0&&(n.x-=1),i.scale.y>0&&(n.y-=1),this.getNeighorTileIndex(n.x,n.y,0,0,!0)},t.prototype.getNeighorTileIndex=function(t,e,i,r,n,o){var s=this.tileSystem,a=t+s.scale.x*i,h=e-s.scale.y*r,u=a,l=h;if(o){var p=this._getTileFullIndex(n);a<p.xmin?(a=p.xmax-(p.xmin-a)%(p.xmax-p.xmin))===p.xmax&&(a=p.xmin):a>=p.xmax&&(a=p.xmin+(a-p.xmin)%(p.xmax-p.xmin)),h>=p.ymax?h=p.ymin+(h-p.ymin)%(p.ymax-p.ymin):h<p.ymin&&(h=p.ymax-(p.ymin-h)%(p.ymax-p.ymin))===p.ymax&&(h=p.ymin)}return{x:a,y:h,idx:u,idy:l}},t.prototype._getTileFullIndex=function(t){var e=this.fullExtent,i=this.transformation,r=this._getTileNum(i.transform(new di(e.left,e.top),1),t),n=this._getTileNum(i.transform(new di(e.right,e.bottom),1),t);return new mi(r,n)},t.prototype.getTilePrjNW=function(t,e,i){var r=this.tileSystem,n=this.tileSize,o=r.origin.y+r.scale.y*(e+(1===r.scale.y?1:0))*(i*n.height),s=r.scale.x*(t+(1===r.scale.x?0:1))*i*n.width+r.origin.x;return new di(s,o)},t.prototype.getTilePrjSE=function(t,e,i){var r=this.tileSystem,n=this.tileSize,o=r.origin.y+r.scale.y*(e+(1===r.scale.y?0:1))*(i*n.height),s=r.scale.x*(t+(1===r.scale.x?1:0))*i*n.width+r.origin.x;return new di(s,o)},t.prototype.getTilePrjExtent=function(t,e,i){var r=this.getTilePrjNW(t,e,i),n=this.getTilePrjSE(t,e,i);return new mi(r,n)},t}(),vo={urlTemplate:null,subdomains:null,repeatWorld:!0,background:!0,backgroundZoomDiff:6,loadingLimitOnInteracting:3,placeholder:!1,crossOrigin:null,tileSize:[256,256],offset:[0,0],tileSystem:null,fadeAnimation:!S,debug:!1,spatialReference:null,maxCacheSize:256,renderer:oe.webgl?"gl":"canvas",clipByPitch:!0,maxAvailableZoom:null,cascadeTiles:!0,minPitchToCascade:35},xo=/\{ *([\w_]+) *\}/g,wo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.fromJSON=function(t){return t&&"TileLayer"===t.type?new e(t.id,t.options):null},e.prototype.getTileSize=function(){return new he(this.options.tileSize)},e.prototype.getTiles=function(t){var e=this.getMap(),i=e.getContainerExtent(),r=[],n=0,o=this.getMinZoom(),s=this.options.minPitchToCascade,a=g(t)?this._getTileZoom(e.getZoom()):t;if(!g(t)||!this.options.cascadeTiles||e.getPitch()<=s||!g(o)&&a<=o){var h=this._getTiles(a,i);return h&&(n+=h.tiles.length,r.push(h)),{tileGrids:r,count:n}}var u=Math.floor(e._getVisualHeight(s)),l=new _i(0,e.height-u,e.width,e.height),p=this._getTiles(a,l,0);n+=p?p.tiles.length:0;var c=new _i(0,i.ymin,e.width,l.ymin),f=e.getSpatialReference().getZoomDirection(),d=this._getTiles(a-f,c,1);return n+=d?d.tiles.length:0,r.push(p,d),{tileGrids:r,count:n}},e.prototype.getTileUrl=function(t,e,i){var r=this.options.urlTemplate,n="";if(this.options.subdomains){var o=this.options.subdomains;if(V(o)){var s=(t+e)%o.length;s<0&&(s=0),n=o[s]}}if(w(r))return r(t,e,i,n);var a={x:t,y:e,z:i,s:n};return r.replace(xo,function(t,e){var i=a[e];if(void 0===i)throw new Error("No value provided for variable "+t);return"function"==typeof i&&(i=i(a)),i})},e.prototype.clear=function(){return this._renderer&&this._renderer.clear(),this.fire("clear"),this},e.prototype.toJSON=function(){return{type:this.getJSONType(),id:this.getId(),options:this.config()}},e.prototype.getSpatialReference=function(){var t=this.getMap();return!t||this.options.spatialReference&&!qi.equals(this.options.spatialReference,t.options.spatialReference)?(this._sr=this._sr||new qi(this.options.spatialReference),this._sr):t.getSpatialReference()},e.prototype._getTileZoom=function(t){var e=this.getMap();_(t)||(t=e.isZooming()?t>e._frameZoom?Math.floor(t):Math.ceil(t):Math.round(t));var i=this.options.maxAvailableZoom;return!g(i)&&t>i&&(t=i),t},e.prototype._getTiles=function(t,e,i){var r=this.getMap();if(!(r&&this.isVisible()&&r.width&&r.height))return null;var n=this.getMinZoom(),o=this.getMaxZoom();if(!g(n)&&t<n||!g(o)&&t>o)return null;var s=this._getTileConfig();if(!s)return null;var a=t,h=this.getSpatialReference(),u=r.getSpatialReference(),l=h.getResolution(a),p={zoom:a,extent:null,tiles:[]},c=this._getTileOffset(a),f=c[0]||c[1],d=e.convertTo(function(t){return r._containerPointToPoint(t)})._add(c),y=this._getInnerExtent(a,e,d),m=this._getMask2DExtent();if(m){var _=m.intersection(d);if(!_)return p;e=_.convertTo(function(t){return r._pointToContainerPoint(t)})}var v=r._containerPointToPrj(e.getCenter()),x=void 0;x=f?this._project(r._pointToPrj(r._prjToPoint(v)._add(c))):this._project(v);for(var w=this._project(r._pointToPrj(d.getMin())),b=this._project(r._pointToPrj(d.getMax())),C=s.getTileIndex(x,l),P=s.getTileIndex(w,l),M=s.getTileIndex(b,l),T=Math.ceil(Math.abs(C.y-P.y)),S=Math.ceil(Math.abs(C.x-P.x)),O=Math.ceil(Math.abs(C.y-M.y)),E=Math.ceil(Math.abs(C.x-M.x)),k=this.getId(),L=this.getRenderer(),A=this.getTileSize(),R=this._getTileConfig().tileSystem.scale,j=[],D=new _i,I=-S;I<=E;I++)for(var z=-T;z<=O;z++){var H=s.getNeighorTileIndex(C.x,C.y,I,z,l,this.options.repeatWorld),Z=s.getTilePrjNW(H.x,H.y,l),G=r._prjToPoint(this._unproject(Z),a),F=void 0,W=void 0;if(h===u)F=A.width,W=A.height;else{var N=s.getTilePrjSE(H.x,H.y,l),B=r._prjToPoint(this._unproject(N),a);F=Math.abs(Math.round(B.x-G.x)),W=Math.abs(Math.round(B.y-G.y))}var V=R.x*(H.idx-H.x)*F,U=-R.y*(H.idy-H.y)*W;(V||U)&&G._add(V,U),h!==u&&(F++,W++),f&&G._sub(c);var J=new _i(G,G.add(F,W)),q={point:G,z:a,x:H.x,y:H.y,extent2d:J,mask:i};(y.intersects(J)||!y.equals(d)&&this._isTileInExtent(q,e))&&(f&&(q.point._add(c),q.extent2d._add(c)),q.size=[F,W],q.dupKey=G.round().toArray().join()+","+F+","+W+","+k,q.id=this._getTileId(H,a),q.layer=k,L&&L.isTileCachedOrLoading(q.id)||(q.url=this.getTileUrl(H.x,H.y,a)),j.push(q),D._combine(J))}var Y=r._containerPointToPoint(e.getCenter(),a)._add(c);return j.sort(function(t,e){return t.point.distanceTo(Y)-e.point.distanceTo(Y)}),{offset:c,zoom:a,extent:D,tiles:j}},e.prototype._getInnerExtent=function(t,e,i){var r=this.getMap(),n=r.getResolution(t),o=r.getResolution()/n,s=i.getCenter()._multi(o),a=r.getBearing()*Math.PI/180,h=e.getHeight()/2*o,u=e.getWidth()/2*o,l=Math.abs(Math.cos(a)*h)||h,p=Math.abs(Math.sin(a)*h)||u;return new _i(s.sub(p,l),s.add(p,l))},e.prototype._getTileOffset=function(t){var e=this.getMap(),i=e._getResolution()/e._getResolution(t),r=this.options.offset;return w(r)&&(r=r(this)),r[0]*=i,r[1]*=i,r},e.prototype._getTileId=function(t,e,i){return[i||this.getId(),t.idy,t.idx,e].join("__")},e.prototype._project=function(t){var e=this.getMap(),i=this.getSpatialReference();return i!==e.getSpatialReference()?i.getProjection().project(e.getProjection().unproject(t)):t},e.prototype._unproject=function(t){var e=this.getMap(),i=this.getSpatialReference();return i!==e.getSpatialReference()?e.getProjection().project(i.getProjection().unproject(t)):t},e.prototype._initTileConfig=function(){var t=this.getMap(),e=this.getTileSize(),i=this.getSpatialReference(),r=i.getProjection(),n=i.getFullExtent();if(this._defaultTileConfig=new _o(go.getDefault(r),n,e),this.options.tileSystem&&(this._tileConfig=new _o(this.options.tileSystem,n,e)),t&&!this._tileConfig&&t.getSpatialReference()===i&&t.getBaseLayer()&&t.getBaseLayer()!==this&&t.getBaseLayer()._getTileConfig){var o=t.getBaseLayer()._getTileConfig();this._tileConfig=new _o(o.tileSystem,o.fullExtent,e)}},e.prototype._getTileConfig=function(){return this._defaultTileConfig||this._initTileConfig(),this._tileConfig||this._defaultTileConfig},e.prototype._bindMap=function(e){var i=e.getBaseLayer();return i===this&&(i.options.hasOwnProperty("forceRenderOnMoving")||this.config({forceRenderOnMoving:!0})),t.prototype._bindMap.apply(this,arguments)},e.prototype._isTileInExtent=function(t,e){var i=this.getMap();if(!i)return!1;var r=t.z,n=t.extent2d.convertTo(function(t){return i._pointToContainerPoint(t,r)});return!(n.getWidth()<5||n.getHeight()<5)&&e.intersects(n)},e.prototype.getEvents=function(){return{spatialreferencechange:this._onSpatialReferenceChange}},e.prototype._onSpatialReferenceChange=function(){delete this._tileConfig,delete this._defaultTileConfig,delete this._sr},e}(Vi);wo.registerJSONType("TileLayer"),wo.mergeOptions(vo),function(t){function e(i,r,n){p(this,e);var o=f(this,t.call(this,i,n));return o.layers=r||[],o._checkChildren(),o.layerMap={},o._groupChildren=[],o}return c(e,t),e.fromJSON=function(t){if(!t||"GroupTileLayer"!==t.type)return null;var i=t.layers.map(function(t){return Vi.fromJSON(t)});return new e(t.id,i,t.options)},e.prototype.getLayers=function(){return this.layers},e.prototype.toJSON=function(){return{type:this.getJSONType(),id:this.getId(),layers:this.layers.map(function(t){return t.toJSON()}),options:this.config()}},e.prototype.getTiles=function(t){for(var e=this.layers,i=[],r=0,n=0,o=e.length;n<o;n++){var s=e[n];if(s.options.visible){var a=s.getTiles(t);a&&0!==a.count&&(r+=a.count,I(i,a.tileGrids))}}return{count:r,tileGrids:i}},e.prototype.onAdd=function(){var e=this,i=this.getMap();this.layers.forEach(function(t){e.layerMap[t.getId()]=t,t.getChildLayer&&e._groupChildren.push(t),t._bindMap(i),t.on("show hide",e._onLayerShowHide,e)}),t.prototype.onAdd.call(this)},e.prototype.onRemove=function(){var e=this;this.layers.forEach(function(t){t._doRemove(),t.off("show hide",e._onLayerShowHide,e)}),delete this.layerMap,delete this._groupChildren,t.prototype.onRemove.call(this)},e.prototype.getChildLayer=function(t){var e=this.layerMap[t];if(e)return e;for(var i=0;i<this._groupChildren.length;i++){var r=this._groupChildren[i].getChildLayer(t);if(r)return r}return null},e.prototype._onLayerShowHide=function(){var t=this.getRenderer();t&&t.setToRedraw()},e.prototype.isVisible=function(){if(!t.prototype.isVisible.call(this))return!1;for(var e=this.layers,i=0,r=e.length;i<r;i++)if(e[i].isVisible())return!0;return!1},e.prototype._checkChildren=function(){var t=this,e={};this.layers.forEach(function(i){var r=i.getId();if(e[r])throw new Error("Duplicate child layer id ("+r+") in the GroupTileLayer ("+t.getId()+")");e[r]=1})},e}(wo).registerJSONType("GroupTileLayer");var bo={service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},Co=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,i)),o=y({},bo);for(var s in r)s in n.options||(o[s]=r[s]);n.setOptions(r);var a=r.detectRetina&&oe.retina?2:1,h=n.getTileSize();return o.width=h.width*a,o.height=h.height*a,n.wmsParams=o,n._wmsVersion=parseFloat(o.version),n}return c(e,t),e.prototype.onAdd=function(){var e=this.options.crs||this.getMap().getProjection().code,i=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[i]=e,t.prototype.onAdd.call(this)},e.prototype.getTileUrl=function(e,i,r){var n=this.getMap()._getResolution(r),o=this._getTileConfig().getTilePrjExtent(e,i,n),s=o.getMax(),a=o.getMin(),h=(this._wmsVersion>=1.3&&"EPSG:4326"===this.wmsParams.crs?[a.y,a.x,s.y,s.x]:[a.x,a.y,s.x,s.y]).join(","),u=t.prototype.getTileUrl.call(this,e,i,r);return u+function(t,e,i){var r=[];for(var n in t)r.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+r.join("&")}(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+h},e.prototype.toJSON=function(){return{type:"WMSTileLayer",id:this.getId(),options:this.config()}},e.fromJSON=function(t){return t&&"WMSTileLayer"===t.type?new e(t.id,t.options):null},e}(wo);Co.registerJSONType("WMSTileLayer"),Co.mergeOptions({crs:null,uppercase:!1,detectRetina:!1});var Po=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,i,r));return n.options.hasOwnProperty("forceRenderOnMoving")||(n.options.forceRenderOnMoving=!1),n}return c(e,t),e.prototype.drawTile=function(){},e.prototype.toJSON=function(){return{type:"CanvasTileLayer",id:this.getId(),options:this.config()}},e.fromJSON=function(t){return t&&"CanvasTileLayer"===t.type?new e(t.id,t.options):null},e}(wo);function Mo(t,e,i){var r=t.createShader(e);if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){var n=t.getShaderInfoLog(r);throw t.deleteShader(r),new Error("Failed to compile shader: "+n)}return r}Po.registerJSONType("CanvasTileLayer");var To="\n attribute vec3 a_position;\n\n attribute vec2 a_texCoord;\n\n uniform mat4 u_matrix;\n\n varying vec2 v_texCoord;\n\n void main() {\n gl_Position = u_matrix * vec4(a_position, 1.0);\n\n v_texCoord = a_texCoord;\n }\n ",So="\n precision mediump float;\n\n uniform sampler2D u_image;\n\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n\n }\n ",Oo=[0,0],Eo=[0,0,0],ko=new Array(16),Lo=function(t){var e,i=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.drawGLImage=function(t,e,i,r,n,o){var s=this.gl;this.loadTexture(t),Eo[0]=e||0,Eo[1]=i||0;var a=Pn(ko);xn(a,a,Eo),bn(a,this.getMap().projViewMatrix,a),s.uniformMatrix4fv(this.program.u_matrix,!1,a),s.uniform1f(this.program.u_opacity,o),t.glBuffer?s.bindBuffer(s.ARRAY_BUFFER,t.glBuffer):t.glBuffer=this.bufferTileData(0,0,r,n),Oo[0]="a_position",Oo[1]=3,this.enableVertexAttrib(Oo),s.drawArrays(s.TRIANGLE_STRIP,0,4)},e.prototype.bufferTileData=function(t,e,i,r,n){var o=t,s=t+i,a=e,h=e+r;return this.loadImageBuffer(this.set12(o,a,0,o,h,0,s,a,0,s,h,0),n)},e.prototype.drawTinImage=function(t,e,i,r,n){var o=this.gl;this.loadTexture(t),o.uniformMatrix4fv(this.program.u_matrix,!1,this.getMap().projViewMatrix),o.uniform1f(this.program.u_opacity,n),o.bindBuffer(o.ARRAY_BUFFER,this.posBuffer),this.enableVertexAttrib(["a_position",3]),o.bufferData(o.ARRAY_BUFFER,new Float32Array(e),o.DYNAMIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,this.texBuffer),this.enableVertexAttrib(["a_texCoord",2]),o.bufferData(o.ARRAY_BUFFER,new Float32Array(i),o.DYNAMIC_DRAW),o.bufferData(o.ELEMENT_ARRAY_BUFFER,new Uint16Array(r),o.DYNAMIC_DRAW),o.drawElements(o.TRIANGLES,r.length,o.UNSIGNED_SHORT,0)},e.prototype.createCanvas2=function(){this.canvas2=ti.createCanvas(this.canvas.width,this.canvas.height)},e.prototype.createGLContext=function(){var t=this.gl=function(t,e){for(var i={alpha:!0,stencil:!0,preserveDrawingBuffer:!0,antialias:!1},r=["webgl","experimental-webgl"],n=null,o=0;o<r.length;++o){try{n=t.getContext(r[o],e||i)}catch(t){}if(n)break}return n}(this.canvas2||this.canvas,this.layer.options.glOptions);t.clearColor(0,0,0,0),t.disable(t.DEPTH_TEST),t.enable(t.STENCIL_TEST),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.program=this.createProgram(To,this.layer.options.fragmentShader||So,["u_matrix","u_image","u_opacity"]),this.useProgram(this.program),this.texBuffer=this.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.texBuffer),this.enableVertexAttrib(["a_texCoord",2]),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),t.STATIC_DRAW),this.enableSampler("u_image"),t.activeTexture(t.TEXTURE0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),this.posBuffer=this.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.posBuffer),this.enableVertexAttrib(["a_position",3]),this.indicesBuffer=this.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indicesBuffer)},e.prototype.resizeGLCanvas=function(){this.gl&&this.gl.viewport(0,0,this.canvas.width,this.canvas.height),this.canvas2&&(this.canvas2.width===this.canvas.width&&this.canvas2.height===this.canvas.height||(this.canvas2.width=this.canvas.width,this.canvas2.height=this.canvas.height))},e.prototype.clearGLCanvas=function(){this.gl&&this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.STENCIL_BUFFER_BIT)},e.prototype.disposeImage=function(t){t&&(t.texture&&this.saveTexture(t.texture),t.glBuffer&&this.saveImageBuffer(t.glBuffer),delete t.texture,delete t.glBuffer)},e.prototype._createTexture=function(t){var e=this.gl,i=this.getTexture()||e.createTexture();return e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),_(F(t.width))&&_(F(t.width))&&e.generateMipmap(e.TEXTURE_2D),i},e.prototype.getTexture=function(){this._textures||(this._textures=[]);var t=this._textures;return t&&t.length>0?t.pop():null},e.prototype.saveTexture=function(t){this._textures.push(t)},e.prototype.loadTexture=function(t){var e=this.gl,i=t.texture;return i||(i=this._createTexture(t),t.texture=i),e.bindTexture(e.TEXTURE_2D,i),i},e.prototype.getImageBuffer=function(){this._imageBuffers||(this._imageBuffers=[]);var t=this._imageBuffers;return t&&t.length>0?t.pop():null},e.prototype.saveImageBuffer=function(t){this._imageBuffers.push(t)},e.prototype.loadImageBuffer=function(t,e){var i=this.gl,r=e||this.createImageBuffer();return i.bindBuffer(i.ARRAY_BUFFER,r),i.bufferData(i.ARRAY_BUFFER,t,i.STATIC_DRAW),r},e.prototype.createImageBuffer=function(){return this.getImageBuffer()||this.createBuffer()},e.prototype.removeGLCanvas=function(){var t=this.gl;if(t){this._buffers&&(this._buffers.forEach(function(e){t.deleteBuffer(e)}),delete this._buffers),this._textures&&(this._textures.forEach(function(e){return t.deleteTexture(e)}),delete this._textures),delete this.posBuffer;var e=t.program;t.deleteShader(e.fragmentShader),t.deleteShader(e.vertexShader),t.deleteProgram(e),delete this.gl,delete this.canvas2}},e.prototype.createBuffer=function(){var t=this.gl.createBuffer();if(!t)throw new Error("Failed to create the buffer object");return this._buffers||(this._buffers=[]),this._buffers.push(t),t},e.prototype.enableVertexAttrib=function(t){!function(t,e,i){if(Array.isArray(i[0])){for(var r=Float32Array.BYTES_PER_ELEMENT,n=0,o=0;o<i.length;o++)n+=i[o][1]||0;for(var s=0,a=0;a<i.length;a++){var h=t.getAttribLocation(e,i[a][0]);if(h<0)throw new Error("Failed to get the storage location of "+i[a][0]);t.vertexAttribPointer(h,i[a][1],t[i[a][2]||"FLOAT"],!1,r*n,r*s),s+=i[a][1]||0,t.enableVertexAttribArray(h)}}else{var u=t.getAttribLocation(e,i[0]);t.vertexAttribPointer(u,i[1],t[i[2]||"FLOAT"],!1,0,0),t.enableVertexAttribArray(u)}}(this.gl,this.gl.program,t)},e.prototype.createProgram=function(t,e,i){var r=function(t,e,i){var r=Mo(t,t.VERTEX_SHADER,e),n=Mo(t,t.FRAGMENT_SHADER,i);if(!r||!n)return null;var o=t.createProgram();return o?(t.attachShader(o,r),t.attachShader(o,n),t.linkProgram(o),{program:o,vertexShader:r,fragmentShader:n}):null}(this.gl,t,e),n=r.program,o=r.vertexShader,s=r.fragmentShader;return n.vertexShader=o,n.fragmentShader=s,this._initUniforms(n,i),n},e.prototype.useProgram=function(t){var e=this.gl;return e.useProgram(t),e.program=t,this},e.prototype.enableSampler=function(t,e){var i=this.gl,r=this._getUniform(i.program,t);return e||(e=0),i.uniform1i(r,e),r},e.prototype._initUniforms=function(t,e){for(var i=0;i<e.length;i++){var r=e[i],n=e[i],o=r.indexOf("[");o>=0&&(r=r.substring(0,o),S||(n=n.substring(0,o))),t[r]=this._getUniform(t,n)}},e.prototype._getUniform=function(t,e){var i=this.gl.getUniformLocation(t,e);if(!i)throw new Error("Failed to get the storage location of "+e);return i},e}(t);return y(i.prototype,{set12:(e=oe.ie9?null:new Float32Array(12),function(t,i,r,n,o,s,a,h,u,l,p,c){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=h,e[8]=u,e[9]=l,e[10]=p,e[11]=c,e})}),i},Ao={renderer:oe.webgl?"gl":"canvas",crossOrigin:null},Ro=function(t){function e(i,r,n){p(this,e),Array.isArray(r)||r.url||(n=r,r=null);var o=f(this,t.call(this,i,n));return o._prepareImages(r),o}return c(e,t),e.prototype.setImages=function(t){return this._images=t,this._prepareImages(t),this},e.prototype.getImages=function(){return this._images},e.prototype._prepareImages=function(t){t=t||[],Array.isArray(t)||(t=[t]),this._imageData=t.map(function(t){return y({},t,{extent:new mi(t.extent)})}),this._images=t;var e=this.getRenderer();e&&e.refreshImages()},e}(Vi);Ro.mergeOptions(Ao);var jo=[],Do=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.isDrawable=function(){return!this.getMap().getPitch()||(console&&console.warn("ImageLayer with canvas renderer can't be pitched, use gl renderer ('renderer' : 'gl') instead."),!1)},e.prototype.checkResources=function(){var t=this;if(this._imageLoaded)return jo;var e=this.layer._imageData.map(function(t){return[t.url,null,null]});if(this.resources){var i=[],r=new Bi;e.forEach(function(e){if(t.resources.isResourceLoaded(e)){var n=t.resources.getImage(e);r.addResource(e,n)}else i.push(e)}),this.resources.forEach(function(e,i){r.isResourceLoaded(e)||t.retireImage(i.image)}),this.resources=r,e=i}return this._imageLoaded=!0,e},e.prototype.retireImage=function(){},e.prototype.refreshImages=function(){this._imageLoaded=!1,this.setToRedraw()},e.prototype.needToRedraw=function(){var e=this.getMap();return!(e.isZooming()&&!e.getPitch())&&t.prototype.needToRedraw.call(this)},e.prototype.draw=function(){this.isDrawable()&&(this.prepareCanvas(),this._painted=!1,this._drawImages(),this.completeRender())},e.prototype._drawImages=function(){var t=this.layer._imageData,e=this.getMap().getExtent();if(t&&t.length)for(var i=0;i<t.length;i++){var r=t[i].extent,n=this.resources&&this.resources.getImage(t[i].url);n&&e.intersects(r)&&(this._painted=!0,this._drawImage(n,r,t[i].opacity||1))}},e.prototype._drawImage=function(t,e,i){var r=0,n=this.context;i<1&&(r=n.globalAlpha,n.globalAlpha=i);var o=this.getMap(),s=o.coordToPoint(e.getMin()),a=o.coordToPoint(e.getMax()),h=o._pointToContainerPoint(s),u=h.x,l=h.y,p=o.getBearing();p&&(n.save(),n.translate(u,l),p&&n.rotate(-p*Math.PI/180),u=l=0),n.drawImage(t,u,l,a.x-s.x,a.y-s.y),p&&n.restore(),r&&(n.globalAlpha=r)},e.prototype.drawOnInteracting=function(){this.draw()},e}(Ni),Io=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.isDrawable=function(){return!0},e.prototype._drawImage=function(t,e,i){var r=this.getMap(),n=e.__imagelayerposition;n||(n=e.__imagelayerposition=e.convertTo(function(t){return r.coordToPoint(t,r.getGLZoom())})),this.drawGLImage(t,n.xmin,n.ymin,n.getWidth(),n.getHeight(),i)},e.prototype.createContext=function(){this.createGLContext()},e.prototype.resizeCanvas=function(e){this.canvas&&(t.prototype.resizeCanvas.call(this,e),this.resizeGLCanvas())},e.prototype.clearCanvas=function(){this.canvas&&(t.prototype.clearCanvas.call(this),this.clearGLCanvas())},e.prototype.retireImage=function(t){this.disposeImage(t)},e.prototype.onRemove=function(){this.removeGLCanvas(),t.prototype.onRemove.call(this)},e}(Lo(Do));Ro.registerRenderer("canvas",Do),Ro.registerRenderer("gl",Io);var zo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getPrepareParams=function(){return[]},e.prototype.getDrawParams=function(){return[]},e.prototype.onCanvasCreate=function(){this.canvas&&this.layer.options.doubleBuffer&&(this.buffer=ti.createCanvas(this.canvas.width,this.canvas.height,this.getMap().CanvasClass))},e.prototype.needToRedraw=function(){return!!this.layer.options.animation||!(this.getMap().isInteracting()&&!this.layer.drawOnInteracting)&&t.prototype.needToRedraw.call(this)},e.prototype.draw=function(){this.prepareCanvas(),this.prepareDrawContext(),this._drawLayer()},e.prototype.drawOnInteracting=function(){this._drawLayerOnInteracting()},e.prototype.getCanvasImage=function(){var e=t.prototype.getCanvasImage.call(this);if(e&&e.image&&this.layer.options.doubleBuffer){var i=e.image;this.buffer.width===i.width&&this.buffer.height===i.height||(this.buffer.width=i.width,this.buffer.height=i.height);var r=this.buffer.getContext("2d"),n=this.layer.doubleBuffer(r,this.context);(void 0===n||n)&&(ti.image(r,i,0,0),e.image=this.buffer)}return e},e.prototype.remove=function(){return delete this._drawContext,t.prototype.remove.call(this)},e.prototype.onZoomStart=function(e){this.layer.onZoomStart(e),t.prototype.onZoomStart.call(this,e)},e.prototype.onZooming=function(e){this.layer.onZooming(e),t.prototype.onZooming.call(this,e)},e.prototype.onZoomEnd=function(e){this.layer.onZoomEnd(e),t.prototype.onZoomEnd.call(this,e)},e.prototype.onMoveStart=function(e){this.layer.onMoveStart(e),t.prototype.onMoveStart.call(this,e)},e.prototype.onMoving=function(e){this.layer.onMoving(e),t.prototype.onMoving.call(this,e)},e.prototype.onMoveEnd=function(e){this.layer.onMoveEnd(e),t.prototype.onMoveEnd.call(this,e)},e.prototype.onResize=function(e){this.layer.onResize(e),t.prototype.onResize.call(this,e)},e.prototype.prepareDrawContext=function(){if(!this._predrawed){var t=Ho(this.getPrepareParams());this._drawContext=this.layer.prepareToDraw.apply(this.layer,[this.context].concat(t)),this._drawContext||(this._drawContext=[]),Array.isArray(this._drawContext)||(this._drawContext=[this._drawContext]),this._predrawed=!0}},e.prototype._prepareDrawParams=function(){if(!this.getMap())return null;var t=this.getViewExtent();if(t.maskExtent&&!t.extent.intersects(t.maskExtent))return this.completeRender(),null;var e=[this.context,t],i=Ho(this.getDrawParams());return e.push.apply(e,i),e.push.apply(e,this._drawContext),e},e.prototype._drawLayer=function(){var t=this._prepareDrawParams();t&&(this.layer.draw.apply(this.layer,t),this.completeRender())},e.prototype._drawLayerOnInteracting=function(){if(this.layer.drawOnInteracting){var t=this._prepareDrawParams();t&&(this.layer.drawOnInteracting.apply(this.layer,t),this.completeRender())}},e}(Ni);function Ho(t){return t||(t=[]),Array.isArray(t)||(t=[t]),t}var Zo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.isCanvasRender=function(){return!0},e.prototype.prepareToDraw=function(){},e.prototype.draw=function(){},e.prototype.redraw=function(){return this._getRenderer()&&this._getRenderer().setToRedraw(),this},e.prototype.play=function(){return this.config("animation",!0),this},e.prototype.pause=function(){return this.config("animation",!1),this},e.prototype.isPlaying=function(){return this.options.animation},e.prototype.clearCanvas=function(){return this._getRenderer()&&this._getRenderer().clearCanvas(),this},e.prototype.requestMapToRender=function(){return this._getRenderer()&&this._getRenderer().requestMapToRender(),this},e.prototype.completeRender=function(){return this._getRenderer()&&this._getRenderer().completeRender(),this},e.prototype.onCanvasCreate=function(){return this},e.prototype.onZoomStart=function(){},e.prototype.onZooming=function(){},e.prototype.onZoomEnd=function(){},e.prototype.onMoveStart=function(){},e.prototype.onMoving=function(){},e.prototype.onMoveEnd=function(){},e.prototype.onResize=function(){},e.prototype.doubleBuffer=function(t){return t.clearRect(0,0,t.canvas.width,t.canvas.height),this},e}(Vi);Zo.mergeOptions({doubleBuffer:!1,animation:!1}),Zo.registerRenderer("canvas",zo);var Go=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.getParticles=function(){},e.prototype.draw=function(t,e){var i=this.getParticles(d());if(i&&0!==i.length){var r=this.getMap(),n=e.extent;e.maskExtent&&(n=e.extent.intersection(e.maskExtent)),n=n.convertTo(function(t){return r._pointToContainerPoint(t)});for(var o=2*Math.PI,s=0,a=i.length;s<a;s++){var h=i[s].point;if(n.contains(h)){var u=i[s].color||this.options.lineColor||"#fff",l=i[s].r;t.fillStyle!==u&&(t.fillStyle=u),l<=2?t.fillRect(h.x-l/2,h.y-l/2,l,l):(t.beginPath(),t.arc(h.x,h.y,l/2,0,o),t.fill())}}this._fillCanvas(t)}else{this._getRenderer()&&(this._getRenderer()._shouldClear=!0)}},e.prototype._fillCanvas=function(t){var e=t.globalCompositeOperation;t.globalCompositeOperation="destination-out";var i=this.options.trail||30;t.fillStyle="rgba(0, 0, 0, "+1/i+")",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.globalCompositeOperation=e},e}(Zo);Go.mergeOptions({animation:!0}),Go.registerRenderer("canvas",function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.draw=function(){this.canvas&&this.layer.options.animation&&!this._shouldClear||(this.prepareCanvas(),this._shouldClear=!1),this.prepareDrawContext(),this._drawLayer()},e.prototype.drawOnInteracting=function(){this.draw(),this._shouldClear=!1},e.prototype.onSkipDrawOnInteracting=function(){this._shouldClear=!0},e}(zo));function Fo(t,e){return{markerType:t,markerFill:"#fff",markerLineColor:"#000",markerLineWidth:2,markerWidth:10,markerHeight:10,opacity:e}}var Wo={fixAspectRatio:!1,symbol:null,removeVertexOn:"contextmenu",centerHandleSymbol:Fo("ellipse",1),vertexHandleSymbol:Fo("square",1),newVertexHandleSymbol:Fo("square",.4)},No=function(t){function e(i,r){p(this,e);var n=f(this,t.call(this,r));return n._geometry=i,n._geometry?n:f(n)}return c(e,t),e.prototype.getMap=function(){return this._geometry.getMap()},e.prototype.prepare=function(){this.getMap()&&(this.options.symbol&&(this._originalSymbol=this._geometry.getSymbol(),this._geometry.setSymbol(this.options.symbol)),this._prepareEditStageLayer())},e.prototype._prepareEditStageLayer=function(){var t=this.getMap(),e=R(),i="_maptalks__internal_layer__edit_stage_"+e,r="_maptalks__internal_layer__edit_stage_"+e+"_shadow";this._editStageLayer=t.getLayer(i),this._shadowLayer=t.getLayer(r),this._editStageLayer||(this._editStageLayer=new fn(i),t.addLayer(this._editStageLayer)),this._shadowLayer||(this._shadowLayer=new fn(r),t.addLayer(this._shadowLayer))},e.prototype.start=function(){var t=this;if(this._geometry&&this._geometry.getMap()&&!this._geometry.editing){var e=this.getMap();this.editing=!0;var i=this._geometry;this._geometryDraggble=i.options.draggable,i.config("draggable",!1),this.prepare();var r=i.copy();r.setSymbol(i._getInternalSymbol()),r.copyEventListeners(i),i._getParent()&&r.copyEventListeners(i._getParent()),r.setId(null).config({draggable:!1}),this._shadow=r,this._switchGeometryEvents("on"),i.hide(),(i instanceof Dr||i instanceof Jr||i instanceof Yr||i instanceof qr)&&this._createOrRefreshOutline(),this._shadowLayer.bringToFront().addGeometry(r),this._editStageLayer.bringToFront(),this._addListener([e,"zoomstart",function(){t._editStageLayer.hide()}]),this._addListener([e,"zoomend",function(){t._editStageLayer.show()}]),i instanceof Dr?(r.config("draggable",!0),r.on("dragend",this._onMarkerDragEnd,this)):this._createCenterHandle(),i instanceof Dr?this.createMarkerEditor():i instanceof Jr?this.createCircleEditor():i instanceof Yr?this.createEllipseOrRectEditor():i instanceof qr?this.createEllipseOrRectEditor():i instanceof Xr||(i instanceof Rr||i instanceof zr)&&this.createPolygonEditor()}},e.prototype.stop=function(){delete this._history,delete this._historyPointer,delete this._editOutline,this._switchGeometryEvents("off"),this.getMap()&&(delete this._shadow,this._geometry.config("draggable",this._geometryDraggble),delete this._geometryDraggble,this._geometry.show(),this._editStageLayer.remove(),this._shadowLayer.remove(),this._clearAllListeners(),this._refreshHooks=[],this.options.symbol&&(this._geometry.setSymbol(this._originalSymbol),delete this._originalSymbol),this.editing=!1)},e.prototype.isEditing=function(){return!g(this.editing)&&this.editing},e.prototype._getGeometryEvents=function(){return{symbolchange:this._onGeoSymbolChange,"positionchange shapechange":this._exeAndReset}},e.prototype._switchGeometryEvents=function(t){if(this._geometry){var e=this._getGeometryEvents();for(var i in e)this._geometry[t](i,e[i],this)}},e.prototype._onGeoSymbolChange=function(t){this._shadow&&this._shadow.setSymbol(t.target._getInternalSymbol())},e.prototype._onMarkerDragEnd=function(){this._update("setCoordinates",this._shadow.getCoordinates().toArray()),this._refresh()},e.prototype._createOrRefreshOutline=function(){var t=this._geometry,e=this._editOutline;return e?(e.remove(),this._editOutline=e=t.getOutline(),this._editStageLayer.addGeometry(e)):(e=t.getOutline(),this._editStageLayer.addGeometry(e),this._editOutline=e,this._addRefreshHook(this._createOrRefreshOutline)),e},e.prototype._createCenterHandle=function(){var t=this,e=this._shadow.getCenter(),i=this.options.centerHandleSymbol,r=void 0,n=this.createHandle(e,{symbol:i,cursor:"move",onDown:function(){var e=Dt((r=t._shadow.copy())._getInternalSymbol(),.5);r.setSymbol(e).addTo(t._editStageLayer)},onMove:function(t,e){var i=e.coordOffset;r.translate(i)},onUp:function(){t._update("setCoordinates",di.toNumberArrays(r.getCoordinates())),r.remove(),t._refresh()}});this._addRefreshHook(function(){var e=t._shadow.getCenter();n.setCoordinates(e)})},e.prototype._createHandleInstance=function(t,e){var i=e.symbol;return new Dr(t,{draggable:!0,dragShadow:!1,dragOnAxis:e.axis,cursor:e.cursor,symbol:i})},e.prototype.createHandle=function(t,e){e||(e={});var i=this.getMap(),r=this._createHandleInstance(t,e),n=this;function o(t){return e.onDown&&e.onDown.call(n,t.viewPoint,t),!1}function s(t){n._hideContext();var o=i._prjToViewPoint(r._getPrjCoordinates());return e.onMove&&e.onMove.call(n,o,t),!1}function a(t){return e.onUp&&e.onUp.call(n,t),!1}return r.on("dragstart",o,this),r.on("dragging",s,this),r.on("dragend",a,this),r.on("removestart",function t(){r.config("draggable",!1),r.off("dragstart",o,n),r.off("dragging",s,n),r.off("dragend",a,n),r.off("removestart",t,n),delete r["maptalks--editor-refresh-fn"]},this),e.onRefresh&&(r["maptalks--editor-refresh-fn"]=e.onRefresh),this._editStageLayer.addGeometry(r),r},e.prototype._createResizeHandles=function(t,e,i){var r=this,n=["nw-resize","n-resize","ne-resize","w-resize","e-resize","sw-resize","s-resize","se-resize"],o=[null,"y",null,"x","x",null,"y",null],s=this._geometry;t||(t=[]);var a=this,h=[],u={},l=this.getMap(),p=this.options.vertexHandleSymbol,c=function(){for(var c,f=s._getPainter().get2DExtent(),d=[(c=f).getMin(),new ae((c.xmax+c.xmin)/2,c.ymin),new ae(c.xmax,c.ymin),new ae(c.xmin,(c.ymax+c.ymin)/2),new ae(c.xmax,(c.ymax+c.ymin)/2),new ae(c.xmin,c.ymax),new ae((c.xmax+c.xmin)/2,c.ymax),c.getMax()],y=function(c){if(Array.isArray(t)&&t.some(function(t){return t===c}))return"continue";var f,y=d[c],g=l.pointToCoordinate(y);if(h.length<d.length-t.length){var m=r.createHandle(g,{symbol:p,cursor:n[c],axis:o[c],onMove:(f=c,function(t){a._updating=!0,e(t,f),s.fire("resizing")}),onUp:function(){a._updating=!1,i(),r._refresh()}});m.setId(c),u[c]=h.length,h.push(m)}else h[u[c]].setCoordinates(g)},g=0;g<d.length;g++)y(g)};return c(),this._addRefreshHook(c),h},e.prototype.createMarkerEditor=function(){var t=this,e=this._geometry,i=this._shadow,r=this.getMap();if(i._canEdit()){this._history||this._recordHistory(p());var n=i._getInternalSymbol(),o=new ae(0,0);m(n.markerDx)&&(o.x=n.markerDx),m(n.markerDy)&&(o.y=n.markerDy);var s=null;ur.test(n)?"pin"!==n.markerType&&"pie"!==n.markerType&&"bar"!==n.markerType||(s=[5,6,7]):(pr.test(n)||yr.test(n))&&(s=[5,6,7]);var a=[2,1,2,0,0,2,1,2],h=void 0;if(this.options.fixAspectRatio){var u=i.getSize();h=u.width/u.height}var l=this._createResizeHandles(null,function(n,u){if(s&&s.indexOf(u)>=0){var p=r.viewPointToCoordinate(n.sub(o)),c=i.getCoordinates();p.x=c.x,i.setCoordinates(p),t._updateCoordFromShadow(!0);var f=l[l.length-1-u];n=r.coordToViewPoint(f.getCoordinates())}var d=r._pointToViewPoint(i._getCenter2DPoint()).add(o),y=i._getInternalSymbol(),g=n.sub(d);s&&n.y>d.y&&(g.y=0);var m=s?1:2,_=2*Math.abs(g.x),v=Math.abs(g.y)*m;h&&(v=(_=Math.max(_,v*h))/h);var x=a[u];i instanceof on?((h||0===x||2===x)&&(i.setWidth(_),e.setWidth(_)),(h||1===x||2===x)&&(i.setHeight(v),e.setHeight(v))):((h||0===x||2===x)&&(y.markerWidth=_),(h||1===x||2===x)&&(y.markerHeight=v),i.setSymbol(y),e.setSymbol(y))},function(){t._update(p())});this._addListener([r,"zoomend",function(){this._refresh()}])}else console&&console.warn("A marker can't be resized with symbol:",i.getSymbol());function p(){var t=[["setCoordinates",i.getCoordinates().toArray()]];return i instanceof on?(t.push(["setWidth",i.getWidth()]),t.push(["setHeight",i.getHeight()])):t.push(["setSymbol",i.getSymbol()]),t}},e.prototype.createCircleEditor=function(){var t=this,e=this._geometry,i=this._shadow,r=this.getMap();this._history||this._recordHistory([["setCoordinates",i.getCoordinates().toArray()],["setRadius",i.getRadius()]]),this._createResizeHandles(null,function(t){var n=r._pointToViewPoint(i._getCenter2DPoint()),o=t.sub(n),s=Math.abs(o.x),a=Math.abs(o.y),h=void 0;h=s>a?r.pixelToDistance(s,0):r.pixelToDistance(0,a),i.setRadius(h),e.setRadius(h)},function(){t._update("setRadius",i.getRadius())})},e.prototype.createEllipseOrRectEditor=function(){var t=this,e=[2,1,2,0,0,2,1,2],i=this._geometry,r=this._shadow;this._history||this._recordHistory(h());var n=this.getMap(),o=this._geometry instanceof Yr,s=void 0;this.options.fixAspectRatio&&(s=i.getWidth()/i.getHeight());var a=this._createResizeHandles(null,function(h,u){var l=o?1:2,p=void 0,c=void 0,f=void 0,d=h,y=e[u];if(o){var g=a[7-u],m=n.coordToViewPoint(g.getCoordinates()),_=(p=d.sub(m)).abs();c=n.pixelToDistance(_.x,0),f=n.pixelToDistance(0,_.y);var v=i.getSize();0===y?(s&&(_.y=_.x/s,v.height=Math.abs(_.y),f=c/s),d.y=m.y-v.height/2):1===y?(s&&(_.x=_.y*s,v.width=Math.abs(_.x),c=f*s),d.x=m.x-v.width/2):s&&(c>f*s?(f=c/s,d.y=m.y+_.x*G(p.y)/s):(c=f*s,d.x=m.x+_.y*G(p.x)*s));var x=n.viewPointToCoordinate(new ae(Math.min(d.x,m.x),Math.min(d.y,m.y)));r.setCoordinates(x),t._updateCoordFromShadow(!0)}else{p=n.coordToViewPoint(i.getCenter()).sub(d)._abs(),c=n.pixelToDistance(p.x,0),f=n.pixelToDistance(0,p.y),s&&(f=(c=Math.max(c,f*s))/s)}(s||0===y||2===y)&&(r.setWidth(c*l),i.setWidth(c*l)),(s||1===y||2===y)&&(r.setHeight(f*l),i.setHeight(f*l))},function(){t._update(h())});function h(){return[["setCoordinates",r.getCoordinates().toArray()],["setWidth",r.getWidth()],["setHeight",r.getHeight()]]}},e.prototype.createPolygonEditor=function(){var t=this.getMap(),e=this._shadow,i=this,r=t.getProjection();this._history||this._recordHistory("setCoordinates",di.toNumberArrays(e.getCoordinates()));var n=e instanceof Rr?3:2,o="maptalks--editor-refresh-fn",s="maptalks--editor-vertex-index",a=[],h=[];function u(){if(e instanceof Rr){var t=e.getCoordinates()[0];return t.slice(0,t.length-1)}return e.getCoordinates()}function l(){return e._getPrjCoordinates()}function p(){for(var t=a.length-1;t>=0;t--)a[t][s]=t;for(var e=h.length-1;e>=0;e--)h[e][s]=e;i._updateCoordFromShadow()}function c(t){var r=t.target[s],o=l();if(!(o.length<=n)){o.splice(r,1),e._setPrjCoordinates(o),e._updateCache(),a.splice(r,1)[0].remove(),r<h.length&&h.splice(r,1)[0].remove();var u=void 0;u=0===r?h.length-1:r-1,h.splice(u,1)[0].remove(),h.splice(u,0,y.call(i,u)),p(),i._refresh()}}function f(r,n){var s=l(),a=t._viewPointToPrj(r),u=s[n];u.x=a.x,u.y=a.y,e._updateCache(),e.onShapeChanged(),i._updateCoordFromShadow(!0);var p=void 0;p=0===n?h.length-1:n-1,h[n]&&h[n][o](),h[p]&&h[p][o]()}function d(t){var e=u()[t],r=i.createHandle(e,{symbol:i.options.vertexHandleSymbol,cursor:"pointer",axis:null,onMove:function(t){f(t,r[s])},onRefresh:function(){e=u()[r[s]],r.setCoordinates(e)},onUp:function(){i._refresh(),i._updateCoordFromShadow()}});return r[s]=t,r.on(i.options.removeVertexOn,c),r}function y(t){var n=u(),o=void 0;o=t+1>=n.length?n[0]:n[t+1];var c=n[t].add(o).multi(.5),g=i.createHandle(c,{symbol:i.options.newVertexHandleSymbol,cursor:"pointer",axis:null,onDown:function(t,n){if(!n||!n.domEvent||2!==n.domEvent.button){var o=l(),a=g[s],u=r.project(g.getCoordinates());o.splice(a+1,0,u),e._setPrjCoordinates(o),e._updateCache();var p=g.getSymbol();delete p.opacity,g.setSymbol(p),h.splice(a,0,y.call(i,a),y.call(i,a+1))}},onMove:function(t){f(t,g[s]+1)},onUp:function(t){if(!t||!t.domEvent||2!==t.domEvent.button){var e=g[s];z(g,h),g.remove(),a.splice(e+1,0,d.call(i,e+1)),p(),i._updateCoordFromShadow(),i._refresh()}},onRefresh:function(){n=u();var t=g[s],e=void 0;e=t===n.length-1?0:t+1;var i=n[t].add(n[e]).multi(.5);g.setCoordinates(i)}});return g[s]=t,g}for(var g=u(),m=0,_=g.length;m<_;m++)a.push(d.call(this,m)),m<_-1&&h.push(y.call(this,m));e instanceof Rr&&h.push(y.call(this,g.length-1)),this._addRefreshHook(function(){for(var t=h.length-1;t>=0;t--)h[t][o]();for(var e=a.length-1;e>=0;e--)a[e][o]()})},e.prototype._refresh=function(){if(this._refreshHooks)for(var t=this._refreshHooks.length-1;t>=0;t--)this._refreshHooks[t].call(this)},e.prototype._hideContext=function(){this._geometry&&(this._geometry.closeMenu(),this._geometry.closeInfoWindow())},e.prototype._addListener=function(t){this._eventListeners||(this._eventListeners=[]),this._eventListeners.push(t),t[0].on(t[1],t[2],this)},e.prototype._clearAllListeners=function(){if(this._eventListeners&&this._eventListeners.length>0){for(var t=this._eventListeners.length-1;t>=0;t--){var e=this._eventListeners[t];e[0].off(e[1],e[2],this)}this._eventListeners=[]}},e.prototype._addRefreshHook=function(t){t&&(this._refreshHooks||(this._refreshHooks=[]),this._refreshHooks.push(t))},e.prototype._update=function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this._exeHistory([t,i]),this._recordHistory.apply(this,[t].concat(i))},e.prototype._updateCoordFromShadow=function(t){if(this._shadow){var e=this._shadow.getCoordinates(),i=this._geometry,r=this._updating;this._updating=!0,i.setCoordinates(e),t||this._recordHistory("setCoordinates",di.toNumberArrays(i.getCoordinates())),this._updating=r}},e.prototype._recordHistory=function(t){this._history||(this._history=[],this._historyPointer=0),this._historyPointer<this._history.length-1&&this._history.splice(this._historyPointer+1);for(var e=arguments.length,i=Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];this._history.push([t,i]),this._historyPointer=this._history.length-1,this._geometry.fire("editrecord")},e.prototype.undo=function(){if(!this._history||0===this._historyPointer)return this;var t=this._history[--this._historyPointer];return this._exeAndReset(t),this},e.prototype.redo=function(){if(!this._history||this._historyPointer===this._history.length-1)return null;var t=this._history[++this._historyPointer];return this._exeAndReset(t),this},e.prototype._exeAndReset=function(t){if(!this._updating){this._exeHistory(t);var e=this._history,i=this._historyPointer;this.stop(),this._history=e,this._historyPointer=i,this.start()}},e.prototype._exeHistory=function(t){var e=this;if(Array.isArray(t)){var i=this._updating;this._updating=!0;var r=this._geometry;Array.isArray(t[0])?t[0].forEach(function(t){var i=t[0],n=t.slice(1);e._shadow[i].apply(e._shadow,n),r[i].apply(r,n)}):(this._shadow[t[0]].apply(this._shadow,t[1]),r[t[0]].apply(r,t[1])),this._updating=i}},e}(oi(ai));No.mergeOptions(Wo);var Bo={startEditText:function(){return this.getMap()?(this.hide(),this.endEditText(),this._prepareEditor(),this._fireEvent("edittextstart"),this):this},endEditText:function(){if(this._textEditor){var t=this._textEditor.innerHTML;t=t.replace(/<p>/gi,"").replace(/<\/p>/gi,"<br/>"),this._textEditor.innerHTML=t;var e=this._textEditor.innerText.replace(/[\r\n]+$/gi,"");this.setContent(e),Ke(this._textEditor,"mousedown dblclick",Ie),this.getMap().off("mousedown",this.endEditText,this),this._editUIMarker.remove(),delete this._editUIMarker,this._textEditor.onkeyup=null,delete this._textEditor,this.show(),this._fireEvent("edittextend")}return this},isEditingText:function(){return!!this._textEditor},getTextEditor:function(){return this._editUIMarker},_prepareEditor:function(){var t=this.getMap(),e=this._createEditor();this._textEditor=e,t.on("mousedown",this.endEditText,this);var i=this._getEditorOffset();this._editUIMarker=new Qn(this.getCoordinates(),{animation:null,content:e,dx:i.dx,dy:i.dy}).addTo(t),this._setCursorToLast(this._textEditor)},_getEditorOffset:function(){var t=this._getInternalSymbol()||{},e=0,i=0,r=t.textHorizontalAlignment;return"middle"===r||g(r)?(e=(t.textDx||0)-2,i=(t.textDy||0)-2):(e=(t.markerDx||0)-2,i=(t.markerDy||0)-2),{dx:e,dy:i}},_createEditor:function(){var t=this.getContent(),e=this.getSize(),i=this._getInternalSymbol()||{},r=e.width,n=i.textFill||"#000000",o=i.textSize||12,s=e.height,a=i.markerLineColor||"#000",h=i.markerFill||"#3398CC",u=i.textLineSpacing||0,l=Ee("div");return l.contentEditable=!0,l.style.cssText="background:"+h+"; border:1px solid "+a+";\n color:"+n+";font-size:"+o+"px;width:"+(r-2)+"px;height:"+(s-2)+"px;margin: auto;\n line-height:"+(o+u)+"px;outline: 0; padding:0; margin:0;word-wrap: break-word;\n overflow: hidden;-webkit-user-modify: read-write-plaintext-only;",l.innerText=t,Xe(l,"mousedown dblclick",Ie),l.onkeyup=function(t){var e=l.style.height||0;13===t.keyCode&&(l.style.height=parseInt(e)+o/2+"px")},l},_setCursorToLast:function(t){var e=void 0;window.getSelection?(t.focus(),(e=window.getSelection()).selectAllChildren(t),e.collapseToEnd()):document.selection&&((e=document.selection.createRange()).moveToElementText(t),e.collapse(!1),e.select())}};nn.include(Bo),br.include({animate:function(t,e,i){var r=this;this._animPlayer&&this._animPlayer.finish(),w(e)&&(i=e),e||(e={});var n=this.getMap(),o=this._getProjection(),s=this.getSymbol()||{},a=this._prepareAnimationStyles(t),h=void 0,u=e.focus;if(delete this._animationStarted,n){var l=n._getRenderer();e.framer=function(t){l.callInNextFrame(t)}}var p=kr.animate(a,e,function(t){if(n&&n.isRemoved())p.finish();else{n&&!r._animationStarted&&u&&n.onMoveStart();var e=t.styles;for(var a in e)if("symbol"!==a&&"translate"!==a&&e.hasOwnProperty(a)){var l="set"+a[0].toUpperCase()+a.slice(1);r[l](e[a])}var c=e.translate;if(c){var f=c;h&&(f=c.sub(h)),h=c,r.translate(f)}var d=e.symbol;if(d&&r.setSymbol(It(s,d)),n&&u){var y=o.project(r.getCenter());n._setPrjCenter(y);var g=n._parseEventFromCoord(o.unproject(y));"running"!==p.playState?n.onMoveEnd(g):n.onMoving(g)}r._fireAnimateEvent(p.playState),i&&i(t)}});return this._animPlayer=p,this._animPlayer.play()},_prepareAnimationStyles:function(t){var e=this._getInternalSymbol(),i={};for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];if("translate"!==r&&"symbol"!==r){var o=this["get"+r[0].toUpperCase()+r.substring(1)]();i[r]=[o,n]}else if("symbol"===r){var s=void 0;if(Array.isArray(t.symbol)){if(!Array.isArray(e))throw new Error("geometry'symbol isn't a composite symbol, while the symbol in styles is.");s=[];for(var a=t.symbol,h=0;h<a.length;h++)if(a[h]){var u={};for(var l in a[h])a[h].hasOwnProperty(l)&&(u[l]=[e[h][l],a[h][l]]);s.push(u)}else s.push(null)}else{if(Array.isArray(e))throw new Error("geometry'symbol is a composite symbol, while the symbol in styles isn't.");for(var p in s={},n)n.hasOwnProperty(p)&&(s[p]=[e[p],n[p]])}i.symbol=s}else"translate"===r&&(i.translate=new di(n))}return i},_fireAnimateEvent:function(t){"finished"===t?(delete this._animationStarted,this._fireEvent("animateend")):"running"===t&&(this._animationStarted?this._fireEvent("animating"):(this._fireEvent("animatestart"),this._animationStarted=!0))}});var Vo=oe.touch?"touchstart mousedown":"mousedown",Uo=function(t){function e(i){return p(this,e),f(this,t.call(this,i))}return c(e,t),e.prototype.addHooks=function(){this.target.on(Vo,this._startDrag,this)},e.prototype.removeHooks=function(){this._endDrag(),this.target.off(Vo,this._startDrag,this),delete this.container},e.prototype._prepareDragHandler=function(){this._dragHandler=new fi(this.container),this._dragHandler.on("dragging",this._dragging,this).on("mouseup",this._endDrag,this).enable()},e.prototype._prepareShadow=function(){var t=this.target;this._prepareDragStageLayer(),this._shadow&&this._shadow.remove();var e=this._shadow=t.copy();if(this._shadow.setSymbol(t._getInternalSymbol()),t.options.dragShadow){var i=Dt(e._getInternalSymbol(),.5);e.setSymbol(i)}e.setId(null),this._prepareShadowConnectors()},e.prototype._prepareShadowConnectors=function(){var t=this.target,e=this._shadow,i=this._dragStageLayer._getRenderer().resources,r=[];if(un._hasConnectors(t))for(var n=un._getConnectors(t),o=0,s=n.length;o<s;o++){var a=n[o],h=a.config(),u=a._getInternalSymbol();h.symbol=Dt(u,.5);var l=void 0;l=a.getConnectSource()===t?new a.constructor(e,a.getConnectTarget(),h):new a.constructor(a.getConnectSource(),e,h),r.push(l),a.getLayer()&&a.getLayer()._getRenderer()&&i.merge(a.getLayer()._getRenderer().resources)}this._shadowConnectors=r,r.push(e),this._dragStageLayer.bringToFront().addGeometry(r)},e.prototype._onTargetUpdated=function(){this._shadow&&this._shadow.setSymbol(this.target._getSymbol())},e.prototype._prepareDragStageLayer=function(){var t=this.target.getMap(),e=this.target.getLayer();this._dragStageLayer=t.getLayer("_maptalks__internal_layer__drag_stage"),this._dragStageLayer||(this._dragStageLayer=new fn("_maptalks__internal_layer__drag_stage",{enableAltitude:e.options.enableAltitude,altitudeProperty:e.options.altitudeProperty}),t.addLayer(this._dragStageLayer));var i=new Bi;i.merge(e._getRenderer().resources),this._dragStageLayer._getRenderer().resources=i},e.prototype._startDrag=function(t){var e=this.target.getMap();if(e&&(!this.target._getParent()&&!this.isDragging())){var i=t.domEvent;i.touches&&i.touches.length>1||2===i.button||(this.container=e._panels.mapWrapper||e._containerDOM,this.target.on("click",this._endDrag,this),this._lastCoord=this._correctCoord(t.coordinate),this._lastPoint=t.containerPoint,this._prepareDragHandler(),this._dragHandler.onMouseDown(t.domEvent),Xe(this.container,"mouseleave",this._endDrag,this),this._startParam=t,this._moved=!1)}},e.prototype._dragging=function(t){var e=this.target,i=e.getMap()._parseEvent(t.domEvent),r=i.domEvent;if(!(r.touches&&r.touches.length>1)){if(!this._moved)return this._moved=!0,e.on("symbolchange",this._onTargetUpdated,this),this._isDragging=!0,this._prepareShadow(),e.options.dragShadow||e.hide(),this._shadow._fireEvent("dragstart",i),this.target._fireEvent("dragstart",this._startParam||i),void delete this._startParam;if(this._shadow){var n=this._shadow.options.dragOnAxis,o=this._correctCoord(i.coordinate),s=i.containerPoint;this._lastPoint=this._lastPoint||s,this._lastCoord=this._lastCoord||o;var a=s.sub(this._lastPoint),h=o.sub(this._lastCoord);"x"===n?a.y=h.y=0:"y"===n&&(a.x=h.x=0),this._lastPoint=s,this._lastCoord=o,this._shadow.translate(h),e.options.dragShadow||e.translate(h),i.coordOffset=h,i.pointOffset=a,this._shadow._fireEvent("dragging",i),e._fireEvent("dragging",i)}}},e.prototype._endDrag=function(t){if(this._dragHandler&&(this._dragHandler.disable(),delete this._dragHandler),this.container&&Ke(this.container,"mouseleave",this._endDrag,this),this.target){var e=this.target;e.off("click",this._endDrag,this),e.off("symbolchange",this._onTargetUpdated,this),delete this._lastCoord,delete this._lastPoint,this._isDragging=!1;var i=e.getMap();if(this.enabled()&&i){var r=i._parseEvent(t?t.domEvent:null);this._updateTargetAndRemoveShadow(r),this._moved&&e._fireEvent("dragend",r)}}},e.prototype.isDragging=function(){return!!this._isDragging},e.prototype._updateTargetAndRemoveShadow=function(t){var e=this.target,i=e.getMap();e.options.dragShadow||e.show();var r=this._shadow;r&&(e.options.dragShadow&&e.setCoordinates(r.getCoordinates()),r._fireEvent("dragend",t),r.remove(),delete this._shadow),this._shadowConnectors&&(i.getLayer("_maptalks__internal_layer__drag_stage").removeGeometry(this._shadowConnectors),delete this._shadowConnectors),this._dragStageLayer&&this._dragStageLayer.remove()},e.prototype._correctCoord=function(t){var e=this.target.getMap();if(!e.getPitch())return t;var i=this.target._getPainter();if(!i.getMinAltitude())return t;var r=(i.getMinAltitude()+i.getMaxAltitude())/2;return e.locateByPoint(t,0,-r)},e}(si);br.mergeOptions({draggable:!1,dragShadow:!0,dragOnAxis:null}),br.addInitHook("addHandler","draggable",Uo),br.include({isDragging:function(){return this._getParent()?this._getParent().isDragging():!!this.draggable&&this.draggable.isDragging()}}),br.include({startEdit:function(t){return this.getMap()&&this.options.editable?(this.endEdit(),this._editor=new No(this,t),this._editor.start(),this.fire("editstart"),this):this},endEdit:function(){return this._editor&&(this._editor.stop(),delete this._editor,this.fire("editend")),this},redoEdit:function(){return this.isEditing()?(this._editor.redo(),this.fire("redoedit"),this):this},undoEdit:function(){return this.isEditing()?(this._editor.undo(),this.fire("undoedit"),this):this},isEditing:function(){return!!this._editor&&this._editor.isEditing()}}),br.include({_onEvent:function(t,e){if(this.getMap()){var i=e||this._getEventTypeToFire(t);"contextmenu"===i&&this.listens("contextmenu")&&(Ie(t),De(t));var r=this._getEventParams(t);this._fireEvent(i,r)}},_getEventTypeToFire:function(t){return t.type},_getEventParams:function(t){var e=this.getMap(),i={domEvent:t},r=t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t;if(r){var n=Ge(r,e._containerDOM);i.coordinate=e.containerPointToCoordinate(n),i.containerPoint=n,i.viewPoint=e.containerPointToViewPoint(n),i.pont2d=e._containerPointToPoint(n)}return i}}),br.include({setInfoWindow:function(t){return this.removeInfoWindow(),t instanceof eo?(this._infoWindow=t,this._infoWinOptions=y({},this._infoWindow.options),this._infoWindow.addTo(this),this):(this._infoWinOptions=y({},t),this._infoWindow?this._infoWindow.setOptions(t):this.getMap()&&this._bindInfoWindow(this._infoWinOptions),this)},getInfoWindow:function(){return this._infoWindow?this._infoWindow:null},openInfoWindow:function(t){return this.getMap()?(t||(t=this.getCenter()),this._infoWindow?this._infoWindow.show(t):this._infoWinOptions&&this.getMap()&&(this._bindInfoWindow(this._infoWinOptions),this._infoWindow.show(t)),this):this},closeInfoWindow:function(){return this._infoWindow&&this._infoWindow.hide(),this},removeInfoWindow:function(){return this._unbindInfoWindow(),delete this._infoWinOptions,delete this._infoWindow,this},_bindInfoWindow:function(t){return this._infoWindow=new eo(t),this._infoWindow.addTo(this),this},_unbindInfoWindow:function(){return this._infoWindow&&(this.closeInfoWindow(),this._infoWindow.remove(),delete this._infoWindow),this}});var Jo=function(){function t(e,i){p(this,t),this.max=e,this.onRemove=i,this.reset()}return t.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},t.prototype.clear=function(){this.reset(),delete this.onRemove},t.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var i=this.getAndRemove(this.order[0]);i&&this.onRemove(i)}return this},t.prototype.has=function(t){return t in this.data},t.prototype.keys=function(){return this.order},t.prototype.getAndRemove=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},t.prototype.get=function(t){return this.has(t)?this.data[t]:null},t.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},t.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.getAndRemove(this.order[0]);e&&this.onRemove(e)}return this},t}(),qo=function(t){function e(i){p(this,e);var r=f(this,t.call(this,i));return r.tilesInView={},r.tilesLoading={},r._parentTiles=[],r._childTiles=[],r.tileCache=new Jo(i.options.maxCacheSize,r.deleteTile.bind(r)),r}return c(e,t),e.prototype.draw=function(){var t=this.getMap();if(this.isDrawable()){var e=this.prepareCanvas();if(!e||e.intersects(this.canvasExtent2D)){var i=this.layer.getTiles().tileGrids;if(i&&i.length){var r=0,n=!1,o={},s=[],a=[],h={},u=[],l={},p=[],c={},f={},d=this._markTiles(),y=this._getLoadLimit(),g=i.length;this._tileZoom=i[0].zoom,this._tileOffset=i[0].offset;for(var m=0;m<g;m++)for(var _=i[m],v=_.tiles,x=this._generatePlaceHolder(_.zoom),w=0,b=v.length;w<b;w++){var C=v[w],P=C.id,M=this._getCachedTile(P),T=!1;if(this._isLoadingTile(P))T=n=!0,this.tilesLoading[P].current=!0;else if(M)this.getTileOpacity(M.image)<1&&(T=n=!0),s.push(M);else{T=n=!0,y&&r+d[0]>y||t.isInteracting()&&!t.isMoving()&&!t.isRotating()||(r++,f[P+"@"+C.point.toArray().join()]=C)}if(T&&!o[C.dupKey]){o[C.dupKey]=1,x&&!c[C.dupKey]&&(C.cache=!1,p.push({image:x,info:C}),c[C.dupKey]=1);var S=this._findParentTile(C);if(S){var O=S.info.dupKey;void 0===h[O]&&(h[O]=a.length,a.push(S))}else{var E=this._findChildTiles(C);E.length&&E.forEach(function(t){l[t.info.dupKey]||(u.push(t),l[t.info.dupKey]=1)})}}}this._drawTiles(s,a,u,p),r?this.loadTileQueue(f):n||(!t.isAnimating()&&this._parentTiles.length>0&&(this._parentTiles=[],this._childTiles=[],this.setToRedraw()),this.completeRender()),this._retireTiles()}else this.completeRender()}else this.completeRender()}},e.prototype.isTileCachedOrLoading=function(t){return this.tilesLoading[t]||this.tilesInView[t]||this.tileCache.has(t)},e.prototype._drawTiles=function(t,e,i,r){var n=this;e.length&&(e.sort(function(t,e){return Math.abs(e.info.z-n._tileZoom)-Math.abs(t.info.z-n._tileZoom)}),this._parentTiles=e),i.length&&(this._childTiles=i);var o={tiles:t,parentTiles:e,childTiles:i};this.onDrawTileStart(o),this._parentTiles.forEach(function(t){return n._drawTileAndCache(t)}),this._childTiles.forEach(function(t){return n._drawTileOffset(t.info,t.image)}),r.forEach(function(t){return n._drawTileOffset(t.info,t.image)});var s=this.layer,a=this.getMap();if(!s.options.cascadeTiles||a.getPitch()<=s.options.minPitchToCascade)t.forEach(function(t){return n._drawTileAndCache(t)});else{this.writeZoomStencil();for(var h=!1,u=0,l=t.length;u<l;u++)t[u].info.z!==this._tileZoom?h?this.resumeZoomStencilTest():(this.startZoomStencilTest(),h=!0):h&&this.pauseZoomStencilTest(),this._drawTileAndCache(t[u]);this.endZoomStencilTest()}this.onDrawTileEnd(o)},e.prototype.writeZoomStencil=function(){},e.prototype.startZoomStencilTest=function(){},e.prototype.endZoomStencilTest=function(){},e.prototype.pauseZoomStencilTest=function(){},e.prototype.resumeZoomStencilTest=function(){},e.prototype.onDrawTileStart=function(){},e.prototype.onDrawTileEnd=function(){},e.prototype._drawTileOffset=function(t,e){var i=this._tileOffset;if(i[0]||i[1]){var r=this.getMap(),n=r._getResolution(this._tileZoom)/r._getResolution(t.z);i[0]*=n,i[1]*=n,t.point._sub(i),t.extent2d._sub(i),this.drawTile(t,e),t.point._add(i),t.extent2d._add(i),i[0]/=n,i[1]/=n}else this.drawTile(t,e)},e.prototype._drawTileAndCache=function(t){t.current=!0,this.tilesInView[t.info.id]=t,this._drawTileOffset(t.info,t.image),this.tileCache.add(t.info.id,t)},e.prototype.drawOnInteracting=function(){this.draw()},e.prototype.needToRedraw=function(){var e=this.getMap();return e.getPitch()?t.prototype.needToRedraw.call(this):!(!e.isRotating()&&!e.isZooming())||(e.isMoving()?!!this.layer.options.forceRenderOnMoving:t.prototype.needToRedraw.call(this))},e.prototype.hitDetect=function(){return!1},e.prototype._getLoadLimit=function(){return this.getMap().isInteracting()?this.layer.options.loadingLimitOnInteracting:0},e.prototype.isDrawable=function(){return!this.getMap().getPitch()||(console&&console.warn("TileLayer with canvas renderer can't be pitched, use gl renderer ('renderer' : 'gl') instead."),this.clear(),!1)},e.prototype.clear=function(){this._retireTiles(!0),this.tileCache.reset(),this.tilesInView={},this.tilesLoading={},this._parentTiles=[],this._childTiles=[],t.prototype.clear.call(this)},e.prototype._isLoadingTile=function(t){return!!this.tilesLoading[t]},e.prototype.clipCanvas=function(e){return this.layer.getMask()?t.prototype.clipCanvas.call(this,e):this._clipByPitch(e)},e.prototype._clipByPitch=function(t){var e=this.getMap();if(e.getPitch()<=e.options.maxVisualPitch)return!1;if(!this.layer.options.clipByPitch)return!1;var i=e.getContainerExtent(),r=oe.retina?2:1;return t.save(),t.strokeStyle="rgba(0, 0, 0, 0)",t.beginPath(),t.rect(0,Math.ceil(i.ymin)*r,Math.ceil(i.getWidth())*r,Math.ceil(i.getHeight())*r),t.stroke(),t.clip(),!0},e.prototype.loadTileQueue=function(t){for(var e in t)if(t.hasOwnProperty(e)){var i=t[e],r=this.loadTile(i);void 0===r.loadTime&&(this.tilesLoading[i.id]={image:r,current:!0,info:i})}},e.prototype.loadTile=function(t){var e=this.layer.getTileSize(),i=new Image;i.width=e.width,i.height=e.height,i.onload=this.onTileLoad.bind(this,i,t),i.onerror=this.onTileError.bind(this,i,t);var r=this.layer.options.crossOrigin;return g(r)||(i.crossOrigin=r),this.loadTileImage(i,t.url),i},e.prototype.loadTileImage=function(t,e){return L(t,[e])},e.prototype.abortTileLoading=function(t){t&&(t.onload=Yo,t.onerror=Yo,t.src=et)},e.prototype.onTileLoad=function(t,e){if(this.layer){var i=e.id;this.tilesInView&&(t.loadTime=d(),delete this.tilesLoading[i],this._addTileToCache(e,t),this.setToRedraw(),this.layer.fire("tileload",{tile:e,tileImage:t}))}},e.prototype.onTileError=function(t,e){this.layer&&(t instanceof Image&&this.abortTileLoading(t),t.loadTime=0,delete this.tilesLoading[e.id],this._addTileToCache(e,t),this.setToRedraw(),this.layer.fire("tileerror",{tile:e}))},e.prototype.drawTile=function(t,e){if(e&&this.getMap()){var i=t.point,r=t.z,n=t.id,o=this.getMap(),s=t.size,a=o.getZoom(),h=this.context,u=o._pointToContainerPoint(i,r),l=o.getBearing(),p=l||a!==r,c=this.getTileOpacity(e),f=h.globalAlpha;c<1&&(h.globalAlpha=c,this.setToRedraw()),p||u._round();var d=u.x,y=u.y,g=s[0],m=s[1];if(p){if(g++,m++,h.save(),h.translate(d,y),l&&h.rotate(-l*Math.PI/180),a!==r){var _=o._getResolution(r)/o._getResolution();h.scale(_,_)}d=y=0}if(ti.image(h,e,d,y,g,m),this.layer.options.debug){var v=new ae(d,y),x=this.layer.options.debugOutline,w=n.split("__");h.save(),h.strokeStyle=x,h.fillStyle=x,h.strokeWidth=10,h.font="15px monospace",ti.rectangle(h,v,s,1,0),ti.fillText(h,"x:"+w[2]+", y:"+w[1]+", z:"+w[3],v.add(10,20),x),ti.drawCross(h,v.add(g/2,m/2),2,x),h.restore()}p&&h.restore(),h.globalAlpha!==f&&(h.globalAlpha=f),this.setCanvasUpdated()}},e.prototype._findChildTiles=function(t){var e=this._getLayerOfTile(t.layer);if(!e.options.background)return[];for(var i=this.getMap(),r=[],n=t.extent2d.getMin(),o=t.extent2d.getMax(),s=e._project(i._pointToPrj(n,t.z)),a=e._project(i._pointToPrj(o,t.z)),h=1;h<3;h++)this._findChildTilesAt(r,s,a,e,t.z+h);return r},e.prototype._findChildTilesAt=function(t,e,i,r,n){for(var o=r.getId(),s=r.getSpatialReference().getResolution(n),a=r._getTileConfig().getTileIndex(e,s),h=r._getTileConfig().getTileIndex(i,s),u=Math.min(a.idx,h.idx),l=Math.max(a.idx,h.idx),p=Math.min(a.idy,h.idy),c=Math.max(a.idy,h.idy),f=void 0,d=void 0,y=u;y<l;y++)for(var g=p;g<c;g++)f=r._getTileId({idx:y,idy:g},n,o),this.tileCache.has(f)&&(d=this.tileCache.getAndRemove(f),t.push(d),this.tileCache.add(f,d))},e.prototype._findParentTile=function(t){var e=this.getMap(),i=this._getLayerOfTile(t.layer);if(!i.options.background)return null;for(var r=i.getSpatialReference(),n=r.getZoomDirection(),o=i.options.backgroundZoomDiff,s=t.extent2d.getCenter(),a=i._project(e._pointToPrj(s,t.z)),h=1;h<=o;h++){var u=t.z-n*h,l=r.getResolution(u),p=i._getTileConfig().getTileIndex(a,l),c=i._getTileId(p,u,t.layer);if(this.tileCache.has(c)){var f=this.tileCache.getAndRemove(c);return this.tileCache.add(c,f),f}}return null},e.prototype._getLayerOfTile=function(t){return this.layer.getChildLayer?this.layer.getChildLayer(t):this.layer},e.prototype._getCachedTile=function(t){var e=this.tilesInView,i=this.tileCache.getAndRemove(t);if(i){e[t]=i;var r=this.tilesLoading;r&&r[t]&&(r[t].current=!1,this.abortTileLoading(r[t]),delete r[t])}else i=e[t];return i},e.prototype._addTileToCache=function(t,e){this.tilesInView[t.id]={image:e,current:!0,info:t}},e.prototype.getTileOpacity=function(t){return this.layer.options.fadeAnimation&&t.loadTime?Math.min(1,(d()-t.loadTime)/(1e3/60*10)):1},e.prototype.onRemove=function(){this.clear(),delete this.tileCache,delete this._tilePlaceHolder,t.prototype.onRemove.call(this)},e.prototype._markTiles=function(){var t=0,e=0;if(this.tilesLoading)for(var i in this.tilesLoading)this.tilesLoading[i].current=!1,t++;if(this.tilesInView)for(var r in this.tilesInView)this.tilesInView[r].current=!1,e++;return[t,e]},e.prototype._retireTiles=function(t){for(var e in this.tilesLoading){var i=this.tilesLoading[e];!t&&i.current||(i.image&&this.abortTileLoading(i.image),this.deleteTile(i),delete this.tilesLoading[e])}for(var r in this.tilesInView){var n=this.tilesInView[r];n.current||(delete this.tilesInView[r],this.tileCache.has(r)||this.deleteTile(n))}},e.prototype.deleteTile=function(t){t&&t.image&&(t.image.onload=null,t.image.onerror=null)},e.prototype._generatePlaceHolder=function(t){var e=this.getMap(),i=this.layer.options.placeholder;if(!i||e.getPitch())return null;var r=this.layer.getTileSize(),n=e._getResolution(t)/e._getResolution(),o=this._tilePlaceHolder=this._tilePlaceHolder||ti.createCanvas(1,1);return o.width=r.width*n,o.height=r.height*n,w(i)?i(o):function(t){var e=t.getContext("2d"),i=t.width,r=t.height,n=i/16,o=r/16;e.beginPath();for(var s=0;s<16;s++)e.moveTo(0,s*o),e.lineTo(i,s*o),e.moveTo(s*n,0),e.lineTo(s*n,r);e.strokeStyle="rgba(180, 180, 180, 0.1)",e.lineWidth=1,e.stroke(),e.beginPath();for(var a=[[0,0],[i,0],[0,r],[i,r],[0,0],[0,r],[i,0],[i,r],[0,r/2],[i,r/2],[i/2,0],[i/2,r]],h=1;h<a.length;h+=2)e.moveTo(a[h-1][0],a[h-1][1]),e.lineTo(a[h][0],a[h][1]);e.lineWidth=4,e.stroke()}(o),o},e}(Ni);function Yo(){return!1}wo.registerRenderer("canvas",qo);var Xo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.isDrawable=function(){return!0},e.prototype.needToRedraw=function(){var e=this.getMap();return!(!this._gl()||e.getPitch()||!e.isZooming()||e.isMoving()||e.isRotating())||t.prototype.needToRedraw.call(this)},e.prototype.drawTile=function(e,i){var r=this.getMap();if(e&&r&&i.src!==et){var n=r.getGLScale(e.z),o=e.size[0]*n,s=e.size[1]*n;if(!1!==e.cache&&this._bindGLBuffer(i,o,s),this._gl()){var a=e.point,h=a.x*n,u=a.y*n,l=this.getTileOpacity(i);this.drawGLImage(i,h,u,o,s,l),l<1?this.setToRedraw():this.setCanvasUpdated()}else t.prototype.drawTile.call(this,e,i)}},e.prototype.writeZoomStencil=function(){var t=this.gl;t.stencilFunc(t.ALWAYS,1,255),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE)},e.prototype.startZoomStencilTest=function(){var t=this.gl;t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.stencilFunc(t.EQUAL,0,255)},e.prototype.endZoomStencilTest=function(){this.pauseZoomStencilTest()},e.prototype.pauseZoomStencilTest=function(){var t=this.gl;t.stencilFunc(t.ALWAYS,1,255)},e.prototype.resumeZoomStencilTest=function(){var t=this.gl;t.stencilFunc(t.EQUAL,0,255)},e.prototype._bindGLBuffer=function(t,e,i){t.glBuffer||(t.glBuffer=this.bufferTileData(0,0,e,i))},e.prototype.loadTileImage=function(t,e){t.crossOrigin=this.layer.options.crossOrigin||"",t.src=e},e.prototype.onCanvasCreate=function(){this.createCanvas2()},e.prototype.createContext=function(){t.prototype.createContext.call(this),this.createGLContext()},e.prototype.resizeCanvas=function(e){this.canvas&&(t.prototype.resizeCanvas.call(this,e),this.resizeGLCanvas())},e.prototype.clearCanvas=function(){this.canvas&&(t.prototype.clearCanvas.call(this),this.clearGLCanvas())},e.prototype.getCanvasImage=function(){if(!this._gl())return t.prototype.getCanvasImage.call(this);var e=t.prototype.getCanvasImage.call(this);return e&&(e.image=this.canvas2),e},e.prototype._gl=function(){return this.getMap()&&!!this.getMap().getPitch()||this.layer&&!!this.layer.options.fragmentShader},e.prototype.deleteTile=function(e){t.prototype.deleteTile.call(this,e),e&&e.image&&this.disposeImage(e.image)},e.prototype.onRemove=function(){this.removeGLCanvas()},e}(Lo(qo));function Ko(t){var e=this.layer.getTileSize(),i=this.canvas.constructor,r=this.getMap(),n=oe.retina?2:1,o=ti.createCanvas(e.width*n,e.height*n,i);o.layer=this.layer;var s=this,a=new mi(r.pointToCoordinate(t.point),r.pointToCoordinate(t.point.add(e.toPoint())),r.getProjection());return this.layer.drawTile(o,{url:t.url,point:t.point,center:r.pointToCoordinate(t.point.add(e.width/2,e.height/2)),extent:a,z:t.z,x:t.x,y:t.y},function(e){e?s.onTileError(o,t):s.onTileLoad(o,t)}),o}wo.registerRenderer("gl",Xo);var Qo=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.loadTile=function(){return Ko.apply(this,arguments)},e}(qo),$o=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.loadTile=function(){return Ko.apply(this,arguments)},e}(qo);Po.registerRenderer("canvas",Qo),Po.registerRenderer("gl",$o);var ts=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.checkResources=function(){var t=this._geosToCheck;if(this._resourceChecked||t||(t=this.layer._geoList),!V(t))return[];for(var e=[],i={},r=t.length-1;r>=0;r--){var n=t[r]._getExternalResources();if(n.length)if(this.resources)for(var o=0;o<n.length;o++){var s=n[o][0];this.resources.isResourceLoaded(n[o])||i[s]||(e.push(n[o]),i[s]=1)}else e.push.apply(e,n)}return this._resourceChecked=!0,delete this._geosToCheck,e},e.prototype.render=function(){return this.layer._sortGeometries(),t.prototype.render.apply(this,arguments)},e.prototype._addGeoToCheckRes=function(t){t&&(Array.isArray(t)||(t=[t]),this._geosToCheck||(this._geosToCheck=[]),I(this._geosToCheck,t))},e.prototype.onGeometryAdd=function(t){this._addGeoToCheckRes(t),es(this)},e.prototype.onGeometryRemove=function(){es(this)},e.prototype.onGeometrySymbolChange=function(t){this._addGeoToCheckRes(t.target),es(this)},e.prototype.onGeometryShapeChange=function(){es(this)},e.prototype.onGeometryPositionChange=function(){es(this)},e.prototype.onGeometryZIndexChange=function(){es(this)},e.prototype.onGeometryShow=function(){es(this)},e.prototype.onGeometryHide=function(){es(this)},e.prototype.onGeometryPropertiesChange=function(){es(this)},e}(Ni);function es(t){t.layer.options.drawImmediate&&t.render(),t.setToRedraw()}var is=function(t){function e(){return p(this,e),f(this,t.apply(this,arguments))}return c(e,t),e.prototype.checkResources=function(){var e=this,i=t.prototype.checkResources.apply(this,arguments),r=this.layer.getStyle();return r&&(Array.isArray(r)||(r=[r]),r.forEach(function(t){for(var r=kt(t.symbol,!0),n=0,o=r.length;n<o;n++)e.resources.isResourceLoaded(r[n])||i.push(r[n])})),i},e.prototype.needToRedraw=function(){var e=this.getMap();return!(!e.isInteracting()||!this.layer.options.enableAltitude)||!(e.isZooming()&&!e.isRotating()&&!e.getPitch()&&!this._hasPoint&&this.layer.constructor===fn)&&t.prototype.needToRedraw.call(this)},e.prototype.draw=function(){if(this.getMap()){if(!this.layer.isVisible()||this.layer.isEmpty())return this.clearCanvas(),void this.completeRender();this.prepareCanvas(),this.drawGeos(),this.completeRender()}},e.prototype.isBlank=function(){return!!this.context&&!this.context.canvas._drawn},e.prototype.drawOnInteracting=function(){if(this._geosToDraw){this._updateDisplayExtent();for(var t=0,e=this._geosToDraw.length;t<e;t++)this._geosToDraw[t].isVisible()&&this._geosToDraw[t]._paint(this._displayExtent)}},e.prototype.show=function(){this.layer.forEach(function(t){t._repaint()}),t.prototype.show.apply(this,arguments)},e.prototype.forEachGeo=function(t,e){this.layer.forEach(t,e)},e.prototype.drawGeos=function(){this._updateDisplayExtent(),this.prepareToDraw(),this.forEachGeo(this.checkGeo,this);for(var t=0,e=this._geosToDraw.length;t<e;t++)this._geosToDraw[t]._paint()},e.prototype.prepareToDraw=function(){this._hasPoint=!1,this._geosToDraw=[]},e.prototype.checkGeo=function(t){if(t&&t.isVisible()&&t.getMap()&&t.getLayer()&&t.getLayer().isCanvasRender()){var e=t._getPainter(),i=e.get2DExtent(this.resources);i&&i.intersects(this._displayExtent)&&(e.hasPoint()&&(this._hasPoint=!0),this._geosToDraw.push(t))}},e.prototype.onZoomEnd=function(){delete this.canvasExtent2D,t.prototype.onZoomEnd.apply(this,arguments)},e.prototype.onRemove=function(){this.forEachGeo(function(t){t.onHide()}),delete this._geosToDraw},e.prototype.onGeometryPropertiesChange=function(e){e&&this.layer._styleGeometry(e.target),t.prototype.onGeometryPropertiesChange.call(this,e)},e.prototype._updateDisplayExtent=function(){var t=this.canvasExtent2D;if(this._maskExtent){if(!this._maskExtent.intersects(t))return void this.completeRender();t=t.intersection(this._maskExtent)}this._displayExtent=t},e.prototype.identify=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this._geosToDraw;return i?this.layer._hitGeos(i,t,e):[]},e}(ts);fn.registerRenderer("canvas",is);var rs=function(t){function e(i){p(this,e);var r=f(this,t.call(this));return r.map=i,r._handlerQueue={},r}return c(e,t),e.prototype.callInNextFrame=function(t){this._handlerQueue.push(t)},e.prototype.executeFrameCallbacks=function(){var t=this._handlerQueue;this._handlerQueue=[];for(var e=0,i=t.length;e<i;e++)t[e]()},e.prototype.offsetPlatform=function(t){if(!this.map._panels.front)return this;if(0===t.x&&0===t.y)return this;var e=this.map.offsetPlatform().add(t)._round(),i=this.map._panels;return He(i.back,e),He(i.front,e),this},e.prototype.resetContainer=function(){if(this.map&&(this.map._resetMapViewPoint(),this.map._panels.front)){var t=new ae(0,0);He(this.map._panels.back,t),He(this.map._panels.front,t)}},e.prototype.onZoomEnd=function(){this.resetContainer()},e.prototype.onLoad=function(){this._frameLoop()},e}(ai),ns=function(t){function e(i){p(this,e);var r=f(this,t.call(this,i));return r._containerIsCanvas=!!i._containerDOM.getContext,r._registerEvents(),r._loopTime=0,r}return c(e,t),e.prototype.load=function(){this.initContainer()},e.prototype.renderFrame=function(t){if(!this.map)return!1;var e=this.map;e._fireEvent("framestart"),this.updateMapDOM();var i=this._getAllLayerToRender();return this.drawLayers(i,t),this.drawLayerCanvas(i),e._fireEvent("frameend"),this._recordView(),this._mapview=this._getMapView(),delete this._spatialRefChanged,this._fireLayerLoadEvents(),this.executeFrameCallbacks(),this._needRedraw=!1,!0},e.prototype.updateMapDOM=function(){var t=this.map;if(!t.isZooming()){var e=t._getViewPointFrameOffset();e&&t.offsetPlatform(e)}},e.prototype.drawLayers=function(t,e){for(var i=this.map,r=i.isInteracting(),n=[],o=[],s=i.options.fpsOnInteracting||0,a=0===s?0:1e3/s,h=this.map.options.layerCanvasLimitOnInteracting,u=t.length,l=i.getBaseLayer(),p=0,c=0;c<u;c++){var f=t[c];if(f.isVisible()){var d=f.isCanvasRender();d&&n.push(f.getId());var y=f._getRenderer();if(y){var g=this._checkLayerRedraw(f);if(d&&y.isCanvasUpdated()&&(g||o.push(f.getId()),this.setToRedraw()),delete y.__shouldZoomTransform,g){if(r&&d){if(h>0&&u-1-c>h&&f!==l){f._getRenderer().clearCanvas();continue}p+=this._drawCanvasLayerOnInteracting(f,p,a,e)}else r&&y.drawOnInteracting?(y.prepareRender&&y.prepareRender(),y.drawOnInteracting(this._eventParam,e)):y.render(e);d&&(o.push(f.getId()),this.setToRedraw())}else d&&r&&(i.isZooming()&&!i.getPitch()?(y.prepareRender(),y.__shouldZoomTransform=!0):(i.getPitch()||i.isRotating())&&y.clearCanvas())}}}var m=this._canvasIds||[],_=this._updatedIds||[];if(this._canvasIds=n,this._updatedIds=o,!this._needToRedraw()){m.join("---")===n.join("---")&&_.join("---")===o.join("---")||this.setToRedraw()}},e.prototype._checkLayerRedraw=function(t){if(this.isSpatialReferenceChanged())return!0;var e=this.map,i=t._getRenderer();return t.isCanvasRender()?i.testIfNeedRedraw():!(!i.needToRedraw||!i.needToRedraw())||(e.isInteracting()||this.isViewChanged())},e.prototype._drawCanvasLayerOnInteracting=function(t,e,i,r){var n=this.map,o=t._getRenderer(),s=o.getDrawTime(),a=0===i||i>0&&e+s<=i;if(o.mustRenderOnInteracting&&o.mustRenderOnInteracting())o.render(r);else{if(o.drawOnInteracting&&(t===n.getBaseLayer()||a||n.isZooming()&&t.options.forceRenderOnZooming||n.isMoving()&&t.options.forceRenderOnMoving||n.isRotating()&&t.options.forceRenderOnRotating))return o.prepareRender(),o.prepareCanvas(),o.drawOnInteracting(this._eventParam,r),s;!n.isZooming()||n.getPitch()||n.isRotating()?(n.getPitch()||n.isRotating())&&o.clearCanvas():(o.prepareRender(),o.__shouldZoomTransform=!0)}return o.drawOnInteracting&&!a&&o.onSkipDrawOnInteracting(this._eventParam,r),0},e.prototype._fireLayerLoadEvents=function(){if(this._updatedIds&&this._updatedIds.length>0){var t=this.map;this._updatedIds.reverse().forEach(function(e){var i=t.getLayer(e);if(i){var r=i._getRenderer();r&&r.isRenderComplete()&&i.fire("layerload")}})}},e.prototype._needToRedraw=function(){return this._needRedraw},e.prototype.setToRedraw=function(){this._needRedraw=!0},e.prototype.drawLayerCanvas=function(t){var e=this.map;if(e&&(this._needToRedraw()||this.isViewChanged())){this.canvas||this.createCanvas(),e._fireEvent("renderstart",{context:this.context}),this._updateCanvasSize()||this.clearCanvas();for(var i=e.isInteracting(),r=e.options.layerCanvasLimitOnInteracting,n=t.length,o=void 0,s=[],a=0;a<n;a++){if(t[a].isVisible()&&t[a].isCanvasRender())if(t[a]._getRenderer()){var h=this._getLayerImage(t[a]);h&&h.image&&(t[a]===e.getBaseLayer()?o=[t[a],h]:s.push([t[a],h]))}}o&&(this._drawLayerCanvasImage(o[0],o[1]),this._drawFog()),n=s.length;for(var u=i&&r>=0&&n>r?n-r:0;u<n;u++)this._drawLayerCanvasImage(s[u][0],s[u][1]);this._drawCenterCross(),e._fireEvent("renderend",{context:this.context})}},e.prototype.updateMapSize=function(t){if(t&&!this._containerIsCanvas){var e=t.width+"px",i=t.height+"px",r=this.map._panels;r.mapWrapper.style.width=e,r.mapWrapper.style.height=i,this._updateCanvasSize()}},e.prototype.getMainPanel=function(){return this.map?this._containerIsCanvas?this.map._containerDOM:this.map._panels?this.map._panels.mapWrapper:null:null},e.prototype.toDataURL=function(t){return this.canvas?this.canvas.toDataURL(t):null},e.prototype.remove=function(){oe.webgl&&"undefined"!=typeof document&&Re(document,"visibilitychange",this._onVisibilitychange),this._resizeInterval&&clearInterval(this._resizeInterval),delete this.context,delete this.canvas,delete this.map,delete this._spatialRefChanged,this._cancelFrameLoop()},e.prototype.hitDetect=function(t){var e=this.map;if(e&&e.options.hitDetect&&!e.isInteracting()){for(var i=e._getLayers(),r="default",n=e.options.hitDetectLimit||0,o=0,s=i.length-1;s>=0;s--){var a=i[s];if(!a.isEmpty||!a.isEmpty()){var h=a._getRenderer();if(h&&h.hitDetect&&(!h.isBlank||!h.isBlank())){if("default"!==a.options.cursor&&h.hitDetect(t)){r=a.options.cursor||"pointer";break}if(n>0&&++o>n)break}}}e._trySetCursor(r)}},e.prototype._getLayerImage=function(t){var e=t._getRenderer();return e.getCanvasImage?e.getCanvasImage():null},e.prototype.initContainer=function(){var t=this.map._panels;function e(e,i,r,n){var o=Ee("div",i);return r&&(o.style.cssText=r),t[e]=o,n||ze(o),o}var i=this.map._containerDOM;if(!this._containerIsCanvas){i.innerHTML="";var r="position:absolute;top:0px;left:0px;",n=e("mapWrapper","maptalks-wrapper","position:absolute;overflow:hidden;",!0),o=e("allLayers","maptalks-all-layers",r+"padding:0px;margin:0px;z-index:0;overflow:visible;",!0),s=e("backStatic","maptalks-back-static",r+"z-index:0;",!0),a=e("back","maptalks-back",r+"z-index:1;"),h=e("backLayer","maptalks-back-layer",r),u=e("canvasContainer","maptalks-canvas-layer",r+"border:none;z-index:2;"),l=e("frontStatic","maptalks-front-static",r+"z-index:3;",!0),p=e("front","maptalks-front",r+"z-index:4;",!0),c=e("frontLayer","maptalks-front-layer",r+"z-index:0;"),f=e("ui","maptalks-ui",r+"border:none;z-index:1;",!0),d=e("control","maptalks-control","z-index:1",!0);i.appendChild(n),o.appendChild(s),a.appendChild(h),o.appendChild(a),o.appendChild(u),p.appendChild(c),o.appendChild(l),o.appendChild(p),p.appendChild(f),n.appendChild(o),n.appendChild(d),this.createCanvas(),this.resetContainer();var y=this.map._getContainerDomSize();this.updateMapSize(y)}},e.prototype.isViewChanged=function(){var t=this._mapview,e=this._getMapView();return!t||!it(t,e)},e.prototype._recordView=function(){var t=this.map;!t._onViewChange||t.isInteracting()||t.isAnimating()||it(t.getView(),t._getCurrentView())||t._onViewChange(t.getView())},e.prototype.isSpatialReferenceChanged=function(){return this._spatialRefChanged},e.prototype._getMapView=function(){var t=this.map,e=t._getPrjCenter();return{x:e.x,y:e.y,zoom:t.getZoom(),pitch:t.getPitch(),bearing:t.getBearing(),width:t.width,height:t.height}},e.prototype._frameLoop=function(t){var e=this;this.map?(this.renderFrame(t),this._animationFrame=O(function(t){e._frameLoop(t)})):this._cancelFrameLoop()},e.prototype._cancelFrameLoop=function(){this._animationFrame&&E(this._animationFrame)},e.prototype._drawLayerCanvasImage=function(t,e){var i=this.context,r=e.point.round();oe.retina&&r._multi(2);var n=e.image;if(!(r.x+n.width<=0||r.y+n.height<=0)){var o=t.options.opacity;if(m(o)||(o=1),!(o<=0)){var s=e.opacity;if(m(s)||(s=1),!(s<=0)){var a=i.globalAlpha;o<1&&(i.globalAlpha*=o),s<1&&(i.globalAlpha*=s),t.options.cssFilter&&(i.filter=t.options.cssFilter);var h=this._zoomMatrix,u=!!t._getRenderer().__shouldZoomTransform,l=t.getRenderer().clipCanvas(this.context);h&&u&&(i.save(),i.setTransform.apply(i,h)),i.drawImage(n,r.x,r.y),h&&u&&i.restore(),l&&i.restore(),"none"!==i.filter&&(i.filter="none"),i.globalAlpha=a}}}},e.prototype._drawCenterCross=function(){var t=this.map.options.centerCross;if(t){var e=this.context,i=new ae(this.canvas.width/2,this.canvas.height/2);w(t)?t(e,i):ti.drawCross(this.context,i,2,"#f00")}},e.prototype._drawFog=function(){var t=this.map;if(!(t.getPitch()<=t.options.maxVisualPitch)&&t.options.fog){var e=oe.retina?2:1,i=this.context,r=t.getContainerExtent(),n=(t.height-t._getVisualHeight(75))*e;n<0&&(n=0);var o=r.ymin*e,s=Math.ceil(o-n),a=t.options.fogColor.join(),h=i.createLinearGradient(0,n,0,o+30),u=1-30/(s+30);h.addColorStop(0,"rgba("+a+", 0)"),h.addColorStop(.3,"rgba("+a+", 0.3)"),h.addColorStop(u,"rgba("+a+", 1)"),h.addColorStop(1,"rgba("+a+", 0)"),i.beginPath(),i.fillStyle=h,i.fillRect(0,n,Math.ceil(r.getWidth())*e,Math.ceil(s+30))}},e.prototype._getAllLayerToRender=function(){return this.map._getLayers()},e.prototype.clearCanvas=function(){this.canvas&&ti.clearRect(this.context,0,0,this.canvas.width,this.canvas.height)},e.prototype._updateCanvasSize=function(){if(!this.canvas||this._containerIsCanvas)return!1;var t=this.map.getSize(),e=this.canvas,i=oe.retina?2:1;return(t.width*i!==e.width||t.height*i!==e.height)&&(e.height=i*t.height,e.width=i*t.width,e.style&&(e.style.width=t.width+"px",e.style.height=t.height+"px"),!0)},e.prototype.createCanvas=function(){this._containerIsCanvas?this.canvas=this.map._containerDOM:(this.canvas=Ee("canvas"),this._updateCanvasSize(),this.map._panels.canvasContainer.appendChild(this.canvas)),this.context=this.canvas.getContext("2d")},e.prototype._checkSize=function(){this.map&&!this.map.isInteracting()&&(Ze(this.map._containerDOM),this.map.checkSize())},e.prototype._setCheckSizeInterval=function(t){var e=this;clearInterval(this._resizeInterval),this._checkSizeInterval=t,this._resizeInterval=setInterval(function(){!e.map||e.map.isRemoved()?clearInterval(e._resizeInterval):e._checkSize()},this._checkSizeInterval)},e.prototype._registerEvents=function(){var t=this,e=this.map;e.options.checkSize&&!S&&"undefined"!=typeof window&&this._setCheckSizeInterval(1e3),oe.mobile||e.on("_mousemove",this._onMapMouseMove,this),e.on("_dragrotatestart _dragrotating _dragrotateend _movestart _moving _moveend _zoomstart",function(e){t._eventParam=e}),e.on("_zooming",function(i){e.getPitch()||(t._zoomMatrix=i.matrix.container),t._eventParam=i}),e.on("_zoomend",function(e){t._eventParam=e,delete t._zoomMatrix}),e.on("_spatialreferencechange",function(){t._spatialRefChanged=!0}),oe.webgl&&"undefined"!=typeof document&&Ae(document,"visibilitychange",this._onVisibilitychange,this)},e.prototype._onMapMouseMove=function(t){var e=this,i=this.map;!i.isInteracting()&&i.options.hitDetect&&(this._hitDetectFrame&&E(this._hitDetectFrame),this._hitDetectFrame=O(function(){e.hitDetect(t.containerPoint)}))},e.prototype._getCanvasLayers=function(){return this.map._getLayers(function(t){return t.isCanvasRender()})},e.prototype._onVisibilitychange=function(){if("visible"===document.visibilityState)for(var t=this._getAllLayerToRender(),e=0,i=t.length;e<i;e++){var r=t[e].getRenderer();r&&r.canvas&&r.setToRedraw&&r.setToRedraw()}},e}(rs);Xi.registerRenderer("canvas",ns),Xi.mergeOptions({fog:!0,fogColor:[233,233,233]});Object.freeze({ResourceCache:Bi,CanvasRenderer:Ni,ImageGLRenderable:Lo,MapRenderer:rs,MapCanvasRenderer:ns,Renderable:Hi,ImageLayerCanvasRenderer:Do,ImageLayerGLRenderer:Io,TileLayerCanvasRenderer:qo,TileLayerGLRenderer:Xo,CanvasTileLayerCanvasRenderer:Qo,CanvasTileLayerGLRenderer:$o,OverlayLayerCanvasRenderer:ts,VectorLayerCanvasRenderer:is,CanvasLayerRenderer:zo});var os={_getRenderPoints:function(){return[[this._getCenter2DPoint(this.getMap().getGLZoom())],null]}};Dr.include(os),qr.include(os),Jr.include(os),Xr.include(os),Yr.include({_getRenderPoints:function(t){var e=this.getMap();if("vertex"===t){for(var i=this._trimRing(this.getShell()),r=[],n=0,o=i.length;n<o;n++)r.push(e.coordToPoint(i[n],e.getGLZoom()));return[r,null]}return[[e.coordToPoint(this.getCenter(),e.getGLZoom())],null]}});var ss={_getRenderPoints:function(t){var e=this.getMap(),i=e.getGLZoom(),r=void 0,n=null;if("point"===t)(r=this._getPath2DPoints(this._getPrjCoordinates(),!1,i))&&r.length>0&&Array.isArray(r[0])&&(r=r[0].concat(r[1]));else if("vertex"===t)if(n=[],(r=this._getPath2DPoints(this._getPrjCoordinates(),!1,i))&&r.length>0&&Array.isArray(r[0])){for(var o=0,s=r.length;o<s;o++)for(var a=0,h=r[o].length;a<h;a++)0===a?n.push([r[o][a],r[o][a+1]]):n.push([r[o][a-1],r[o][a]]);r=r[0].concat(r[1])}else for(var u=0,l=r.length;u<l;u++)0===u?n.push([r[u],r[u+1]]):n.push([r[u-1],r[u]]);else if("line"===t){r=[],n=[];var p=this._getPath2DPoints(this._getPrjCoordinates(),!1,i);if(p.length>0&&Array.isArray(p[0]))for(var c=void 0,f=1,d=p.length;f<d;f++){c=p[f],this instanceof Rr&&c.length>0&&!c[0].equals(c[c.length-1])&&c.push(c[0]);for(var y=1,g=c.length;y<g;y++)r.push(c[y].add(c[y-1])._multi(.5)),n.push([c[y-1],c[y]])}else{this instanceof Rr&&p.length>0&&!p[0].equals(p[p.length-1])&&p.push(p[0]);for(var m=1,_=p.length;m<_;m++)r.push(p[m].add(p[m-1])._multi(.5)),n.push([p[m-1],p[m]])}}else if("vertex-first"===t){var v=this._getPrjCoordinates();r=[e._prjToPoint(v[0],i)],n=[[e._prjToPoint(v[0],i),e._prjToPoint(v[1],i)]]}else if("vertex-last"===t){var x=this._getPrjCoordinates(),w=x.length;r=[e._prjToPoint(x[w-1],i)],n=[[e._prjToPoint(x[w-2],i),e._prjToPoint(x[w-1],i)]]}else{var b=this._getProjection().project(this.getCenter());r=[e._prjToPoint(b,i)]}return[r,n]}};zr.include(ss),Rr.include(ss),br.include({_redrawWhenPitch:function(){return!1},_redrawWhenRotate:function(){return!1}});var as={_redrawWhenPitch:function(){return!0},_redrawWhenRotate:function(){return this instanceof qr||this instanceof Xr},_paintAsPath:function(){var t=this.getMap();return this._getPainter().getAltitude()>0||t.getPitch()||this instanceof qr&&t.getBearing()},_getPaintParams:function(){var t=this.getMap();if(this._paintAsPath())return Rr.prototype._getPaintParams.call(this,!0);var e=this._getPrjCoordinates(),i=t._prjToPoint(e,t.getGLZoom()),r=this._getRenderSize();return[i,r.width,r.height]},_paintOn:function(){return this._paintAsPath()?ti.polygon.apply(ti,arguments):ti.ellipse.apply(ti,arguments)},_getRenderSize:function(){var t=this.getMap(),e=t.getGLZoom(),i=this._getPrjExtent(),r=t._prjToPoint(i.getMin(),e),n=t._prjToPoint(i.getMax(),e);return new he(Math.abs(n.x-r.x)/2,Math.abs(n.y-r.y)/2)}};qr.include(as),Jr.include(as),Yr.include({_getPaintParams:function(){var t=this.getMap().getGLZoom(),e=this._getPrjShell();return[this._getPath2DPoints(e,!1,t)]},_paintOn:ti.polygon}),Xr.include(as,{_redrawWhenPitch:function(){return!0},_getPaintParams:function(){if(this._paintAsPath())return Rr.prototype._getPaintParams.call(this,!0);var t=this.getMap();return[t._prjToPoint(this._getPrjCoordinates(),t.getGLZoom()),this._getRenderSize().width,[this.getStartAngle(),this.getEndAngle()]]},_paintOn:function(){if(this._paintAsPath())return ti.polygon.apply(ti,arguments);var t=this.getMap().getBearing(),e=arguments;return t&&(e[3]=e[3].slice(0),e[3][0]+=t,e[3][1]+=t),ti.sector.apply(ti,e)}}),Ar.include({_paintAsPath:function(){return!0}}),zr.include({arrowStyles:{classic:[3,4]},_getArrowShape:function(t,e,i,r,n){n||(n=0);var o=i*r[0],s=i*r[1]+n,a=o/2+n,h=void 0;(h=e.nextCtrlPoint||e.prevCtrlPoint?e.prevCtrlPoint?e.sub(new ae(e.prevCtrlPoint)):e.sub(new ae(e.nextCtrlPoint)):e.sub(t))._unit();var u=e.sub(h.multi(s));h._perp();var l=u.add(h.multi(a));return h._multi(-1),[l,e,u.add(h.multi(a)),l]},_getPaintParams:function(){var t=this._getPrjCoordinates();return[this._getPath2DPoints(t,!1,this.getMap().getGLZoom())]},_paintOn:function(t,e,i,r,n){this.options.smoothness?ti.paintSmoothLine(t,e,i,this.options.smoothness,!1,this._animIdx,this._animTailRatio):ti.path(t,e,i,null,n),this._paintArrow(t,e,i)},_getArrowPlacement:function(){return this.options.arrowPlacement},_getArrowStyle:function(){var t=this.options.arrowStyle;return t?Array.isArray(t)?t:this.arrowStyles[t]:null},_getArrows:function(t,e,i){var r=this._getArrowStyle();if(!r||t.length<2)return[];for(var n=t.length>0&&Array.isArray(t[0])?t:[t],o=this._getArrowPlacement(),s=[],a=this.getMap(),h=a.coordToContainerPoint(this.getFirstCoordinate()),u=a.coordToContainerPoint(this.getLastCoordinate()),l=n.length-1;l>=0;l--)("vertex-first"===o||"vertex-firstlast"===o&&n[l][0].closeTo(h,.01))&&s.push(this._getArrowShape(n[l][1],n[l][0],e,r,i)),"vertex-last"===o||"vertex-firstlast"===o&&n[l][n[l].length-1].closeTo(u,.01)?s.push(this._getArrowShape(n[l][n[l].length-2],n[l][n[l].length-1],e,r,i)):"point"===o&&this._getArrowPoints(s,n[l],e,r,i);return s},_getArrowPoints:function(t,e,i,r,n){for(var o=0,s=e.length-1;o<s;o++)t.push(this._getArrowShape(e[o],e[o+1],i,r,n))},_paintArrow:function(t,e,i){var r=this._getInternalSymbol().lineWidth;(!m(r)||r<3)&&(r=3);var n=this._getArrows(e,r);if(n.length){t.setLineDash&&t.setLineDash([]);for(var o=n.length-1;o>=0;o--)t.fillStyle=t.strokeStyle,ti.polygon(t,n[o],i,i)}}}),Rr.include({_getPaintParams:function(t){var e=this.getMap().getGLZoom(),i=this._getPrjShell(),r=this._getPath2DPoints(i,t,e),n=r.length>0&&Array.isArray(r[0]);n&&(r=[[r[0]],[r[1]]]);var o=this._getPrjHoles(),s=[];if(o&&o.length>0)for(var a=0;a<o.length;a++){var h=this._getPath2DPoints(o[a],t,e);Array.isArray(h)&&n?Array.isArray(h[0])?(r[0].push(h[0]),r[1].push(h[1])):r[0].push(h):s.push(h)}return n||I(r=[r],s),[r]},_paintOn:function(t,e,i,r,n){ti.polygon(t,e,i,r,n,this.options.smoothness)}}),"undefined"!=typeof console&&console.log("maptalks v0.40.5")}).call(e,i(96),i(15))}])});
20//# sourceMappingURL=react-map.min.js.map
\No newline at end of file