You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1
  1. !function(t,e){e(t.mapv=t.mapv||{})}(window,function(t){"use strict";function p(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}function i(){this._subscribers={}}i.prototype.on=function(t,e){var n=this._subscribers[t];n||(this._subscribers[t]=n=[]),n.push({callback:e})},i.prototype.off=function(t,e){var n=this._subscribers[t];if(n)for(var i=0;i<n.length;i++)n[i].callback==e&&(n.splice(i,1),i--)},i.prototype._trigger=function(t,e,n){if("*"==t)throw new Error("Cannot trigger event *");var i=[];t in this._subscribers&&(i=i.concat(this._subscribers[t]));for(var o=0,a=((i="*"in this._subscribers?i.concat(this._subscribers["*"]):i).length);o<a;o++){var s=i[o];s.callback&&s.callback(t,e,n||null)}};var s={municipalities:[{n:"北京",g:"116.395645,39.929986|12"},{n:"上海",g:"121.487899,31.249162|12"},{n:"天津",g:"117.210813,39.14393|12"},{n:"重庆",g:"106.530635,29.544606|12"}],provinces:[{n:"安徽",g:"117.216005,31.859252|8",cities:[{n:"合肥",g:"117.282699,31.866942|12"},{n:"安庆",g:"117.058739,30.537898|13"},{n:"蚌埠",g:"117.35708,32.929499|13"},{n:"亳州",g:"115.787928,33.871211|13"},{n:"巢湖",g:"117.88049,31.608733|13"},{n:"池州",g:"117.494477,30.660019|14"},{n:"滁州",g:"118.32457,32.317351|13"},{n:"阜阳",g:"115.820932,32.901211|13"},{n:"淮北",g:"116.791447,33.960023|13"},{n:"淮南",g:"117.018639,32.642812|13"},{n:"黄山",g:"118.29357,29.734435|13"},{n:"六安",g:"116.505253,31.755558|13"},{n:"马鞍山",g:"118.515882,31.688528|13"},{n:"宿州",g:"116.988692,33.636772|13"},{n:"铜陵",g:"117.819429,30.94093|14"},{n:"芜湖",g:"118.384108,31.36602|12"},{n:"宣城",g:"118.752096,30.951642|13"}]},{n:"福建",g:"117.984943,26.050118|8",cities:[{n:"福州",g:"119.330221,26.047125|12"},{n:"龙岩",g:"117.017997,25.078685|13"},{n:"南平",g:"118.181883,26.643626|13"},{n:"宁德",g:"119.542082,26.656527|14"},{n:"莆田",g:"119.077731,25.44845|13"},{n:"泉州",g:"118.600362,24.901652|12"},{n:"三明",g:"117.642194,26.270835|14"},{n:"厦门",g:"118.103886,24.489231|12"},{n:"漳州",g:"117.676205,24.517065|12"}]},{n:"甘肃",g:"102.457625,38.103267|6",cities:[{n:"兰州",g:"103.823305,36.064226|12"},{n:"白银",g:"104.171241,36.546682|13"},{n:"定西",g:"104.626638,35.586056|13"},{n:"甘南州",g:"102.917442,34.992211|14"},{n:"嘉峪关",g:"98.281635,39.802397|13"},{n:"金昌",g:"102.208126,38.516072|13"},{n:"酒泉",g:"98.508415,39.741474|13"},{n:"临夏州",g:"103.215249,35.598514|13"},{n:"陇南",g:"104.934573,33.39448|14"},{n:"平凉",g:"106.688911,35.55011|13"},{n:"庆阳",g:"107.644227,35.726801|13"},{n:"天水",g:"105.736932,34.584319|13"},{n:"武威",g:"102.640147,37.933172|13"},{n:"张掖",g:"100.459892,38.93932|13"}]},{n:"广东",g:"113.394818,23.408004|8",cities:[{n:"广州",g:"113.30765,23.120049|12"},{n:"潮州",g:"116.630076,23.661812|13"},{n:"东莞",g:"113.763434,23.043024|12"},{n:"佛山",g:"113.134026,23.035095|13"},{n:"河源",g:"114.713721,23.757251|12"},{n:"惠州",g:"114.410658,23.11354|12"},{n:"江门",g:"113.078125,22.575117|13"},{n:"揭阳",g:"116.379501,23.547999|13"},{n:"茂名",g:"110.931245,21.668226|13"},{n:"梅州",g:"116.126403,24.304571|13"},{n:"清远",g:"113.040773,23.698469|13"},{n:"汕头",g:"116.72865,23.383908|13"},{n:"汕尾",g:"115.372924,22.778731|14"},{n:"韶关",g:"113.594461,24.80296|13"},{n:"深圳",g:"114.025974,22.546054|12"},{n:"阳江",g:"111.97701,21.871517|14"},{n:"云浮",g:"112.050946,22.937976|13"},{n:"湛江",g:"110.365067,21.257463|13"},{n:"肇庆",g:"112.479653,23.078663|13"},{n:"中山",g:"113.42206,22.545178|12"},{n:"珠海",g:"113.562447,22.256915|13"}]},{n:"广西",g:"108.924274,23.552255|7",cities:[{n:"南宁",g:"108.297234,22.806493|12"},{n:"百色",g:"106.631821,23.901512|13"},{n:"北海",g:"109.122628,21.472718|13"},{n:"崇左",g:"107.357322,22.415455|14"},{n:"防城港",g:"108.351791,21.617398|15"},{n:"桂林",g:"110.26092,25.262901|12"},{n:"贵港",g:"109.613708,23.103373|13"},{n:"河池",g:"108.069948,24.699521|14"},{n:"贺州",g:"111.552594,24.411054|14"},{n:"来宾",g:"109.231817,23.741166|14"},{n:"柳州",g:"109.422402,24.329053|12"},{n:"钦州",g:"108.638798,21.97335|13"},{n:"梧州",g:"111.305472,23.485395|13"},{n:"玉林",g:"110.151676,22.643974|14"}]},{n:"贵州",g:"106.734996,26.902826|8",cities:[{n:"贵阳",g:"106.709177,26.629907|12"},{n:"安顺",g:"105.92827,26.228595|13"},{n:"毕节地区",g:"105.300492,27.302612|14"},{n:"六盘水",g:"104.852087,26.591866|13"},{n:"铜仁地区",g:"109.196161,27.726271|14"},{n:"遵义",g:"106.93126,27.699961|13"},{n:"黔西南州",g:"104.900558,25.095148|11"},{n:"黔东南州",g:"107.985353,26.583992|11"},{n:"黔南州",g:"107.523205,26.264536|11"}]},{n:"海南",g:"109.733755,19.180501|9",cities:[{n:"海口",g:"110.330802,20.022071|13"},{n:"白沙",g:"109.358586,19.216056|12"},{n:"保亭",g:"109.656113,18.597592|12"},{n:"昌江",g:"109.0113,19.222483|12"},{n:"儋州",g:"109.413973,19.571153|13"},{n:"澄迈",g:"109.996736,19.693135|13"},{n:"东方",g:"108.85101,18.998161|13"},{n:"定安",g:"110.32009,19.490991|13"},{n:"琼海",g:"110.414359,19.21483|13"},{n:"琼中",g:"109.861849,19.039771|12"},{n:"乐东",g:"109.062698,18.658614|12"},{n:"临高",g:"109.724101,19.805922|13"},{n:"陵水",g:"109.948661,18.575985|12"},{n:"三亚",g:"109.522771,18.257776|12"},{n:"屯昌",g:"110.063364,19.347749|13"},{n:"万宁",g:"110.292505,18.839886|13"},{n:"文昌",g:"110.780909,19.750947|13"},{n:"五指山",g:"109.51775,18.831306|13"}]},{n:"河北",g:"115.661434,38.61384|7",cities:[{n:"石家庄",g:"114.522082,38.048958|12"},{n:"保定",g:"115.49481,38.886565|13"},{n:"沧州",g:"116.863806,38.297615|13"},{n:"承德",g:"117.933822,40.992521|14"},{n:"邯郸",g:"114.482694,36.609308|13"},{n:"衡水",g:"115.686229,37.746929|13"},{n:"廊坊",g:"116.703602,39.518611|13"},{n:"秦皇岛",g:"119.604368,39.945462|12"},{n:"唐山",g:"118.183451,39.650531|13"},{n:"邢台",g:"114.520487,37.069531|13"},{n:"张家口",g:"114.893782,40.811188|13"}]},{n:"河南",g:"113.486804,34.157184|7",cities:[{n:"郑州",g:"113.649644,34.75661|12"},{n:"安阳",g:"114.351807,36.110267|12"},{n:"鹤壁",g:"114.29777,35.755426|13"},{n:"焦作",g:"113.211836,35.234608|13"},{n:"开封",g:"114.351642,34.801854|13"},{n:"洛阳",g:"112.447525,34.657368|12"},{n:"漯河",g:"114.046061,33.576279|13"},{n:"南阳",g:"112.542842,33.01142|13"},{n:"平顶山",g:"113.300849,33.745301|13"},{n:"濮阳",g:"115.026627,35.753298|12"},{n:"三门峡",g:"111.181262,34.78332|13"},{n:"商丘",g:"115.641886,34.438589|13"},{n:"新乡",g:"113.91269,35.307258|13"},{n:"信阳",g:"114.085491,32.128582|13"},{n:"许昌",g:"113.835312,34.02674|13"},{n:"周口",g:"114.654102,33.623741|13"},{n:"驻马店",g:"114.049154,32.983158|13"}]},{n:"黑龙江",g:"128.047414,47.356592|6",cities:[{n:"哈尔滨",g:"126.657717,45.773225|12"},{n:"大庆",g:"125.02184,46.596709|12"},{n:"大兴安岭地区",g:"124.196104,51.991789|10"},{n:"鹤岗",g:"130.292472,47.338666|13"},{n:"黑河",g:"127.50083,50.25069|14"},{n:"鸡西",g:"130.941767,45.32154|13"},{n:"佳木斯",g:"130.284735,46.81378|12"},{n:"牡丹江",g:"129.608035,44.588521|13"},{n:"七台河",g:"131.019048,45.775005|14"},{n:"齐齐哈尔",g:"123.987289,47.3477|13"},{n:"双鸭山",g:"131.171402,46.655102|13"},{n:"绥化",g:"126.989095,46.646064|13"},{n:"伊春",g:"128.910766,47.734685|14"}]},{n:"湖北",g:"112.410562,31.209316|8",cities:[{n:"武汉",g:"114.3162,30.581084|12"},{n:"鄂州",g:"114.895594,30.384439|14"},{n:"恩施",g:"109.517433,30.308978|14"},{n:"黄冈",g:"114.906618,30.446109|14"},{n:"黄石",g:"115.050683,30.216127|13"},{n:"荆门",g:"112.21733,31.042611|13"},{n:"荆州",g:"112.241866,30.332591|12"},{n:"潜江",g:"112.768768,30.343116|13"},{n:"神农架林区",g:"110.487231,31.595768|13"},{n:"十堰",g:"110.801229,32.636994|13"},{n:"随州",g:"113.379358,31.717858|13"},{n:"天门",g:"113.12623,30.649047|13"},{n:"仙桃",g:"113.387448,30.293966|13"},{n:"咸宁",g:"114.300061,29.880657|13"},{n:"襄阳",g:"112.176326,32.094934|12"},{n:"孝感",g:"113.935734,30.927955|13"},{n:"宜昌",g:"111.310981,30.732758|13"}]},{n:"湖南",g:"111.720664,27.695864|7",cities:[{n:"长沙",g:"112.979353,28.213478|12"},{n:"常德",g:"111.653718,29.012149|12"},{n:"郴州",g:"113.037704,25.782264|13"},{n:"衡阳",g:"112.583819,26.898164|13"},{n:"怀化",g:"109.986959,27.557483|13"},{n:"娄底",g:"111.996396,27.741073|13"},{n:"邵阳",g:"111.461525,27.236811|13"},{n:"湘潭",g:"112.935556,27.835095|13"},{n:"湘西州",g:"109.745746,28.317951|14"},{n:"益阳",g:"112.366547,28.588088|13"},{n:"永州",g:"111.614648,26.435972|13"},{n:"岳阳",g:"113.146196,29.378007|13"},{n:"张家界",g:"110.48162,29.124889|13"},{n:"株洲",g:"113.131695,27.827433|13"}]},{n:"江苏",g:"119.368489,33.013797|8",cities:[{n:"南京",g:"118.778074,32.057236|12"},{n:"常州",g:"119.981861,31.771397|12"},{n:"淮安",g:"119.030186,33.606513|12"},{n:"连云港",g:"119.173872,34.601549|12"},{n:"南通",g:"120.873801,32.014665|12"},{n:"苏州",g:"120.619907,31.317987|12"},{n:"宿迁",g:"118.296893,33.95205|13"},{n:"泰州",g:"119.919606,32.476053|13"},{n:"无锡",g:"120.305456,31.570037|12"},{n:"徐州",g:"117.188107,34.271553|12"},{n:"盐城",g:"120.148872,33.379862|12"},{n:"扬州",g:"119.427778,32.408505|13"},{n:"镇江",g:"119.455835,32.204409|13"}]},{n:"江西",g:"115.676082,27.757258|7",cities:[{n:"南昌",g:"115.893528,28.689578|12"},{n:"抚州",g:"116.360919,27.954545|13"},{n:"赣州",g:"114.935909,25.845296|13"},{n:"吉安",g:"114.992039,27.113848|13"},{n:"景德镇",g:"117.186523,29.303563|12"},{n:"九江",g:"115.999848,29.71964|13"},{n:"萍乡",g:"113.859917,27.639544|13"},{n:"上饶",g:"117.955464,28.457623|13"},{n:"新余",g:"114.947117,27.822322|13"},{n:"宜春",g:"114.400039,27.81113|13"},{n:"鹰潭",g:"117.03545,28.24131|13"}]},{n:"吉林",g:"126.262876,43.678846|7",cities:[{n:"长春",g:"125.313642,43.898338|12"},{n:"白城",g:"122.840777,45.621086|13"},{n:"白山",g:"126.435798,41.945859|13"},{n:"吉林",g:"126.564544,43.871988|12"},{n:"辽源",g:"125.133686,42.923303|13"},{n:"四平",g:"124.391382,43.175525|12"},{n:"松原",g:"124.832995,45.136049|13"},{n:"通化",g:"125.94265,41.736397|13"},{n:"延边",g:"129.485902,42.896414|13"}]},{n:"辽宁",g:"122.753592,41.6216|8",cities:[{n:"沈阳",g:"123.432791,41.808645|12"},{n:"鞍山",g:"123.007763,41.118744|13"},{n:"本溪",g:"123.778062,41.325838|12"},{n:"朝阳",g:"120.446163,41.571828|13"},{n:"大连",g:"121.593478,38.94871|12"},{n:"丹东",g:"124.338543,40.129023|12"},{n:"抚顺",g:"123.92982,41.877304|12"},{n:"阜新",g:"121.660822,42.01925|14"},{n:"葫芦岛",g:"120.860758,40.74303|13"},{n:"锦州",g:"121.147749,41.130879|13"},{n:"辽阳",g:"123.172451,41.273339|14"},{n:"盘锦",g:"122.073228,41.141248|13"},{n:"铁岭",g:"123.85485,42.299757|13"},{n:"营口",g:"122.233391,40.668651|13"}]},{n:"内蒙古",g:"114.415868,43.468238|5",cities:[{n:"呼和浩特",g:"111.660351,40.828319|12"},{n:"阿拉善盟",g:"105.695683,38.843075|14"},{n:"包头",g:"109.846239,40.647119|12"},{n:"巴彦淖尔",g:"107.423807,40.76918|12"},{n:"赤峰",g:"118.930761,42.297112|12"},{n:"鄂尔多斯",g:"109.993706,39.81649|12"},{n:"呼伦贝尔",g:"119.760822,49.201636|12"},{n:"通辽",g:"122.260363,43.633756|12"},{n:"乌海",g:"106.831999,39.683177|13"},{n:"乌兰察布",g:"113.112846,41.022363|12"},{n:"锡林郭勒盟",g:"116.02734,43.939705|11"},{n:"兴安盟",g:"122.048167,46.083757|11"}]},{n:"宁夏",g:"106.155481,37.321323|8",cities:[{n:"银川",g:"106.206479,38.502621|12"},{n:"固原",g:"106.285268,36.021523|13"},{n:"石嘴山",g:"106.379337,39.020223|13"},{n:"吴忠",g:"106.208254,37.993561|14"},{n:"中卫",g:"105.196754,37.521124|14"}]},{n:"青海",g:"96.202544,35.499761|7",cities:[{n:"西宁",g:"101.767921,36.640739|12"},{n:"果洛州",g:"100.223723,34.480485|11"},{n:"海东地区",g:"102.085207,36.51761|11"},{n:"海北州",g:"100.879802,36.960654|11"},{n:"海南州",g:"100.624066,36.284364|11"},{n:"海西州",g:"97.342625,37.373799|11"},{n:"黄南州",g:"102.0076,35.522852|11"},{n:"玉树州",g:"97.013316,33.00624|14"}]},{n:"山东",g:"118.527663,36.09929|8",cities:[{n:"济南",g:"117.024967,36.682785|12"},{n:"滨州",g:"117.968292,37.405314|12"},{n:"东营",g:"118.583926,37.487121|12"},{n:"德州",g:"116.328161,37.460826|12"},{n:"菏泽",g:"115.46336,35.26244|13"},{n:"济宁",g:"116.600798,35.402122|13"},{n:"莱芜",g:"117.684667,36.233654|13"},{n:"聊城",g:"115.986869,36.455829|12"},{n:"临沂",g:"118.340768,35.072409|12"},{n:"青岛",g:"120.384428,36.105215|12"},{n:"日照",g:"119.50718,35.420225|12"},{n:"泰安",g:"117.089415,36.188078|13"},{n:"威海",g:"122.093958,37.528787|13"},{n:"潍坊",g:"119.142634,36.716115|12"},{n:"烟台",g:"121.309555,37.536562|12"},{n:"枣庄",g:"117.279305,34.807883|13"},{n:"淄博",g:"118.059134,36.804685|12"}]},{n:"山西",g:"112.515496,37.866566|7",cities:[{n:"太原",g:"112.550864,37.890277|12"},{n:"长治",g:"113.120292,36.201664|12"},{n:"大同",g:"113.290509,40.113744|12"},{n:"晋城",g:"112.867333,35.499834|13"},{n:"晋中",g:"112.738514,37.693362|13"},{n:"临汾",g:"111.538788,36.099745|13"},{n:"吕梁",g:"111.143157,37.527316|14"},{n:"朔州",g:"112.479928,39.337672|13"},{n:"忻州",g:"112.727939,38.461031|12"},{n:"阳泉",g:"113.569238,37.869529|13"},{n:"运城",g:"111.006854,35.038859|13"}]},{n:"陕西",g:"109.503789,35.860026|7",cities:[{n:"西安",g:"108.953098,34.2778|12"},{n:"安康",g:"109.038045,32.70437|13"},{n:"宝鸡",g:"107.170645,34.364081|12"},{n:"汉中",g:"107.045478,33.081569|13"},{n:"商洛",g:"109.934208,33.873907|13"},{n:"铜川",g:"108.968067,34.908368|13"},{n:"渭南",g:"109.483933,34.502358|13"},{n:"咸阳",g:"108.707509,34.345373|13"},{n:"延安",g:"109.50051,36.60332|13"},{n:"榆林",g:"109.745926,38.279439|12"}]},{n:"四川",g:"102.89916,30.367481|7",cities:[{n:"成都",g:"104.067923,30.679943|12"},{n:"阿坝州",g:"102.228565,31.905763|15"},{n:"巴中",g:"106.757916,31.869189|14"},{n:"达州",g:"107.494973,31.214199|14"},{n:"德阳",g:"104.402398,31.13114|13"},{n:"甘孜州",g:"101.969232,30.055144|15"},{n:"广安",g:"106.63572,30.463984|13"},{n:"广元",g:"105.819687,32.44104|13"},{n:"乐山",g:"103.760824,29.600958|13"},{n:"凉山州",g:"102.259591,27.892393|14"},{n:"泸州",g:"105.44397,28.89593|14"},{n:"南充",g:"106.105554,30.800965|13"},{n:"眉山",g:"103.84143,30.061115|13"},{n:"绵阳",g:"104.705519,31.504701|12"},{n:"内江",g:"105.073056,29.599462|13"},{n:"攀枝花",g:"101.722423,26.587571|14"},{n:"遂宁",g:"105.564888,30.557491|12"},{n:"雅安",g:"103.009356,29.999716|13"},{n:"宜宾",g:"104.633019,28.769675|13"},{n:"资阳",g:"104.63593,30.132191|13"},{n:"自贡",g:"104.776071,29.359157|13"}]},{n:"西藏",g:"89.137982,31.367315|6",cities:[{n:"拉萨",g:"91.111891,29.662557|13"},{n:"阿里地区",g:"81.107669,30.404557|11"},{n:"昌都地区",g:"97.185582,31.140576|15"},{n:"林芝地区",g:"94.349985,29.666941|11"},{n:"那曲地区",g:"92.067018,31.48068|14"},{n:"日喀则地区",g:"88.891486,29.269023|14"},{n:"山南地区",g:"91.750644,29.229027|11"}]},{n:"新疆",g:"85.614899,42.127001|6",cities:[{n:"乌鲁木齐",g:"87.564988,43.84038|12"},{n:"阿拉尔",g:"81.291737,40.61568|13"},{n:"阿克苏地区",g:"80.269846,41.171731|12"},{n:"阿勒泰地区",g:"88.137915,47.839744|13"},{n:"巴音郭楞",g:"86.121688,41.771362|12"},{n:"博尔塔拉州",g:"82.052436,44.913651|11"},{n:"昌吉州",g:"87.296038,44.007058|13"},{n:"哈密地区",g:"93.528355,42.858596|13"},{n:"和田地区",g:"79.930239,37.116774|13"},{n:"喀什地区",g:"75.992973,39.470627|12"},{n:"克拉玛依",g:"84.88118,45.594331|13"},{n:"克孜勒苏州",g:"76.137564,39.750346|11"},{n:"石河子",g:"86.041865,44.308259|13"},{n:"塔城地区",g:"82.974881,46.758684|12"},{n:"图木舒克",g:"79.198155,39.889223|13"},{n:"吐鲁番地区",g:"89.181595,42.96047|13"},{n:"五家渠",g:"87.565449,44.368899|13"},{n:"伊犁州",g:"81.297854,43.922248|11"}]},{n:"云南",g:"101.592952,24.864213|7",cities:[{n:"昆明",g:"102.714601,25.049153|12"},{n:"保山",g:"99.177996,25.120489|13"},{n:"楚雄州",g:"101.529382,25.066356|13"},{n:"大理州",g:"100.223675,25.5969|14"},{n:"德宏州",g:"98.589434,24.44124|14"},{n:"迪庆州",g:"99.713682,27.831029|14"},{n:"红河州",g:"103.384065,23.367718|11"},{n:"丽江",g:"100.229628,26.875351|13"},{n:"临沧",g:"100.092613,23.887806|14"},{n:"怒江州",g:"98.859932,25.860677|14"},{n:"普洱",g:"100.980058,22.788778|14"},{n:"曲靖",g:"103.782539,25.520758|12"},{n:"昭通",g:"103.725021,27.340633|13"},{n:"文山",g:"104.089112,23.401781|14"},{n:"西双版纳",g:"100.803038,22.009433|13"},{n:"玉溪",g:"102.545068,24.370447|13"}]},{n:"浙江",g:"119.957202,29.159494|8",cities:[{n:"杭州",g:"120.219375,30.259244|12"},{n:"湖州",g:"120.137243,30.877925|12"},{n:"嘉兴",g:"120.760428,30.773992|13"},{n:"金华",g:"119.652576,29.102899|12"},{n:"丽水",g:"119.929576,28.4563|13"},{n:"宁波",g:"121.579006,29.885259|12"},{n:"衢州",g:"118.875842,28.95691|12"},{n:"绍兴",g:"120.592467,30.002365|13"},{n:"台州",g:"121.440613,28.668283|13"},{n:"温州",g:"120.690635,28.002838|12"},{n:"舟山",g:"122.169872,30.03601|13"}]}],other:[{n:"香港",g:"114.186124,22.293586|11"},{n:"澳门",g:"113.557519,22.204118|13"},{n:"台湾",g:"120.961454,23.80406|8"}]};function h(t){t=t.split("|");return t[0]=t[0].split(","),{lng:parseFloat(t[0][0]),lat:parseFloat(t[0][1])}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var u={getProvinceNameByCityName:function(t){for(var e=s.provinces,n=0;n<e.length;n++)for(var i=e[n].n,o=e[n].cities,a=0;a<o.length;a++)if(o[a].n==t)return i;return null},getCenterByCityName:function(t){t=t.replace("市","");for(var e=0;e<s.municipalities.length;e++)if(s.municipalities[e].n==t)return h(s.municipalities[e].g);for(e=0;e<s.other.length;e++)if(s.other[e].n==t)return h(s.other[e].g);for(var n=s.provinces,e=0;e<n.length;e++){if(n[e].n==t)return h(n[e].g);for(var i=n[e].cities,o=0;o<i.length;o++)if(i[o].n==t)return h(i[o].g)}return null}},e=function(t,e,n){return e&&c(t.prototype,e),n&&c(t,n),t};function c(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0!==i){if("value"in i)return i.value;i=i.get;return void 0!==i?i.call(n):void 0}if(null!==(i=Object.getPrototypeOf(t)))return o(i,e,n)}function v(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)}function d(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 C(t,e){i.bind(this)(),this._options=e||{},this._data=[],t&&this.add(t)}function g(t,e,n,i){for(var o,a,s=0;s<6;s++){r={x:e,y:n},o=i,a=s,a=Math.PI/180*(60*a+30);var r=[r.x+o*Math.cos(a),r.y+o*Math.sin(a)];t.lineTo(r[0],r[1])}}(C.prototype=i.prototype).add=function(t,e){if(Array.isArray(t))for(var n,i=0,o=t.length;i<o;i++)t[i]&&(t[i].time&&14==t[i].time.length&&"20"==t[i].time.substr(0,2)&&(n=t[i].time,t[i].time=new Date(n.substr(0,4)+"-"+n.substr(4,2)+"-"+n.substr(6,2)+" "+n.substr(8,2)+":"+n.substr(10,2)+":"+n.substr(12,2)).getTime()),this._data.push(t[i]));else{if(!(t instanceof Object))throw new Error("Unknown dataType");this._data.push(t)}this._dataCache=JSON.parse(JSON.stringify(this._data))},C.prototype.reset=function(){this._data=JSON.parse(JSON.stringify(this._dataCache))},C.prototype.get=function(t){t=t||{};new Date;var e=this._data;new Date;if(t.filter){for(var n=[],i=0;i<e.length;i++)t.filter(e[i])&&n.push(e[i]);e=n}return e=t.transferCoordinate?this.transferCoordinate(e,t.transferCoordinate,t.fromColumn,t.toColumn):e},C.prototype.set=function(t){this._set(t),this._trigger("change")},C.prototype._set=function(t){this.clear(),this.add(t)},C.prototype.clear=function(t){this._data=[]},C.prototype.remove=function(t){},C.prototype.update=function(t,e){for(var n=this._data,i=0;i<n.length;i++)if(e){var o,a=!0;for(o in e)n[i][o]!=e[o]&&(a=!1);a&&t&&t(n[i])}else t&&t(n[i]);this._dataCache=JSON.parse(JSON.stringify(this._data)),this._trigger("change")},C.prototype.transferCoordinate=function(t,s,e,n){n=n||"_coordinates",e=e||"coordinates";for(var i=0;i<t.length;i++){var o=t[i].geometry,a=o[e];switch(o.type){case"Point":o[n]=s(a);break;case"LineString":for(var r=[],h=0;h<a.length;h++)r.push(s(a[h]));o[n]=r;break;case"MultiLineString":case"Polygon":r=c(a);o[n]=r;break;case"MultiPolygon":for(var r=[],l=0;l<a.length;l++){var u=c(a[l]);r.push(u)}o[n]=r}}function c(t){for(var e=[],n=0;n<t.length;n++){for(var i=t[n],o=[],a=0;a<i.length;a++)o.push(s(i[a]));e.push(o)}return e}return t},C.prototype.initGeometry=function(e){e?this._data.forEach(function(t){t.geometry=e(t)}):this._data.forEach(function(t){var e;t.geometry||(t.lng&&t.lat?t.geometry={type:"Point",coordinates:[t.lng,t.lat]}:!t.city||(e=u.getCenterByCityName(t.city))&&(t.geometry={type:"Point",coordinates:[e.lng,e.lat]}))})},C.prototype.getMax=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=parseFloat(e[0][t]),i=1;i<e.length;i++){var o=parseFloat(e[i][t]);n<o&&(n=o)}return n}},C.prototype.getSum=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=0,i=0;i<e.length;i++)e[i][t]&&(n+=parseFloat(e[i][t]));return n}},C.prototype.getMin=function(t){var e=this._data;if(e&&!(e.length<=0)){for(var n=parseFloat(e[0][t]),i=1;i<e.length;i++){var o=parseFloat(e[i][t]);o<n&&(n=o)}return n}},C.prototype.getUnique=function(t){if((o=this._data)&&!(o.length<=0)){for(var e={},n=1;n<o.length;n++)e[o[n][t]]=!0;var i,o=[];for(i in e)o.push(i);return o}};var f={drawDataSet:function(t,e,n){for(var i=e instanceof C?e.get():e,o=0,a=i.length;o<a;o++){var s=i[o];this.draw(t,s,n)}},draw:function(t,e,n){var i=e.geometry.type,o=e.geometry._coordinates||e.geometry.coordinates,a=e.symbol||n.symbol||"circle";switch(i){case"Point":var s=e._size||e.size||n._size||n.size||5;"circle"===a?("Point"===n.bigData&&t.moveTo(o[0],o[1]),t.arc(o[0],o[1],s,0,2*Math.PI)):"rect"===a?t.rect(o[0]-s/2,o[1]-s/2,s,s):"honeycomb"===a&&g(t,o[0],o[1],s);break;case"LineString":this.drawLineString(t,o);break;case"MultiLineString":for(var r=0;r<o.length;r++){var h=o[r];this.drawLineString(t,h)}break;case"Polygon":this.drawPolygon(t,o);break;case"MultiPolygon":for(r=0;r<o.length;r++){var l=o[r];if(this.drawPolygon(t,l),n.multiPolygonDraw){l=n.multiPolygonDraw();if(l)return l}}break;default:console.error("type"+i+"is not support now!")}},drawLineString:function(t,e){for(var n=0;n<e.length;n++){var i=e[n][0],o=e[n][1];0==n?t.moveTo(i,o):t.lineTo(i,o)}},drawPolygon:function(t,e){t.beginPath();for(var n=0;n<e.length;n++){var i=e[n];t.moveTo(i[0][0],i[0][1]);for(var o=1;o<i.length;o++)t.lineTo(i[o][0],i[o][1]);t.lineTo(i[0][0],i[0][1]),t.closePath()}}},y={draw:function(t,e,n){var i,o=e instanceof C?e.get():e;for(i in t.save(),n)t[i]=n[i];if(n.bigData){t.save(),t.beginPath();for(var a=0,s=o.length;a<s;a++){var r=o[a];f.draw(t,r,n)}"Point"==(h=n.bigData)||"Polygon"==h||"MultiPolygon"==h?(t.fill(),t.lineDash&&t.setLineDash(t.lineDash),r.lineDash&&t.setLineDash(r.lineDash),(r.strokeStyle||n.strokeStyle)&&n.lineWidth&&t.stroke()):"LineString"!=h&&"MultiLineString"!=h||t.stroke(),t.restore()}else for(a=0,s=o.length;a<s;a++){var r=o[a],h=(t.save(),(r.fillStyle||r._fillStyle)&&(t.fillStyle=r.fillStyle||r._fillStyle),(r.strokeStyle||r._strokeStyle)&&(t.strokeStyle=r.strokeStyle||r._strokeStyle),t.lineDash&&t.setLineDash(t.lineDash),r.lineDash&&t.setLineDash(r.lineDash),r.geometry.type);t.beginPath(),n.multiPolygonDraw=function(){t.fill(),(r.strokeStyle||n.strokeStyle)&&n.lineWidth&&t.stroke()},f.draw(t,r,n),"Point"==h||"Polygon"==h||"MultiPolygon"==h?(t.fill(),(r.strokeStyle||n.strokeStyle)&&n.lineWidth&&t.stroke()):"LineString"!=h&&"MultiLineString"!=h||((r.lineWidth||r._lineWidth)&&(t.lineWidth=r.lineWidth||r._lineWidth),t.stroke()),t.restore()}t.restore()}};function m(t,e){var n;return"undefined"==typeof document||(n=document.createElement("canvas"),t&&(n.width=t),e&&(n.height=e)),n}function M(t){this.gradient=(t=t||{}).gradient||{.25:"rgba(0, 0, 255, 1)",.55:"rgba(0, 255, 0, 1)",.85:"rgba(255, 255, 0, 1)",1:"rgba(255, 0, 0, 1)"},this.maxSize=t.maxSize||35,this.minSize=t.minSize||0,this.max=t.max||100,this.min=t.min||0,this.initPalette()}M.prototype.setMax=function(t){this.max=t||100},M.prototype.setMin=function(t){this.min=t||0},M.prototype.setMaxSize=function(t){this.maxSize=t||35},M.prototype.setMinSize=function(t){this.minSize=t||0},M.prototype.initPalette=function(){var t,e=this.gradient,n=new m(256,1),n=this.paletteCtx=n.getContext("2d"),i=n.createLinearGradient(0,0,256,1);for(t in e)i.addColorStop(parseFloat(t),e[t]);n.fillStyle=i,n.fillRect(0,0,256,1)},M.prototype.getColor=function(t){t=this.getImageData(t);return"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]/256+")"},M.prototype.getImageData=function(t){var e=this.paletteCtx.getImageData(0,0,256,1).data;if(void 0===t)return e;var n=this.max,i=this.min,t=((t=n<t?n:t)<i&&(t=i),4*Math.floor((t-i)/(n-i)*255));return[e[t],e[1+t],e[2+t],e[3+t]]},M.prototype.getSize=function(t){var e=this.max,n=this.min,i=this.maxSize,o=this.minSize;return n<e?o+((t=(t=e<t?e:t)<n?n:t)-n)/(e-n)*(i-o):i},M.prototype.getLegend=function(t){var e,n=this.gradient,i=t.width||20,t=t.height||180,o=new m(i,t),a=o.getContext("2d"),s=a.createLinearGradient(0,t,0,0);for(e in n)s.addColorStop(parseFloat(e),n[e]);return a.fillStyle=s,a.fillRect(0,0,i,t),o};var x=("undefined"==typeof window?{}:window).devicePixelRatio||1;function _(t){return t.max||100}function w(t){return t.min||0}function b(a,u,s){var t,e,n,i,c,r=_(s),o=w(s),h=s._size,p=(null==h&&null==(h=s.size)&&(h=13),new M({gradient:s.gradient,max:r,min:o})),v=(e=new m(2*(t=(o=h)+(h=o/2)),2*t),(n=e.getContext("2d")).shadowBlur=h,n.shadowColor="black",n.shadowOffsetX=n.shadowOffsetY=1e4,n.beginPath(),n.arc(t-1e4,t-1e4,o,0,2*Math.PI,!0),n.closePath(),n.fill(),e),d=v.width/2,g=v.height/2,l={};for(i in u.forEach(function(t,e){var n=void 0===t.count?1:t.count,n=Math.min(1,n/r).toFixed(2);l[n]=l[n]||[],l[n].push(t)}),l)isNaN(i)||(c=l[i],a.beginPath(),s.withoutAlpha||(a.globalAlpha=i),a.strokeStyle=p.getColor(i*r),c.forEach(function(t,e){var n,i,o;t.geometry&&(n=t.geometry._coordinates||t.geometry.coordinates,"Point"===(i=t.geometry.type)?(o=void 0===t.count?1:t.count,a.globalAlpha=o/r,a.drawImage(v,n[0]-d,n[1]-g)):"LineString"===i&&(o=void 0===t.count?1:t.count,a.globalAlpha=o/r,a.beginPath(),f.draw(a,t,s),a.stroke()))}))}var k={draw:function(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var i=n.strength||.3,i=(t.strokeStyle="rgba(0,0,0,"+i+")",new m(t.canvas.width,t.canvas.height)),i=i.getContext("2d"),e=(i.scale(x,x),n=n||{},e instanceof C?e.get():e),u=(t.save(),new M({gradient:n.gradient}));if(b(i,e,n),!n.absolute){for(var o,e=i.getImageData(0,0,t.canvas.width,t.canvas.height),a=e.data,s=u.getImageData(),i=n,n=_(i),r=w(i),n=n-r,c=0,p=1024,v=((h=i.range||null)&&2===h.length&&(c=(h[0]-r)/n*1024),h&&2===h.length&&(p=(h[1]-r)/n*1024),i.maxOpacity||.8),d=i.minOpacity||0,h=i.range,l=3,g=a.length;l<g;l+=4)o=4*a[l],a[l]/256>v&&(a[l]=256*v),a[l]/256<d&&(a[l]=256*d),o&&c<=o&&o<=p?(a[l-3]=s[o],a[l-2]=s[1+o],a[l-1]=s[2+o]):a[l]=0;t.putImageData(e,0,0),t.restore()}u=null}}},E={draw:function(t,u,e){t.save();var n=u instanceof C?u.get():u,i={},o=e._size||e.size||50,c=!("enableCluster"in e)||e.enableCluster,a=e.offset||{x:0,y:0},p=new M({min:e.min||0,max:e.max||100,gradient:e.gradient});if(c){for(var s,r=0;r<n.length;r++){v=n[r].geometry._coordinates||n[r].geometry.coordinates;i[l=Math.floor((v[0]-a.x)/o)+","+Math.floor((v[1]-a.y)/o)]||(i[l]=0),i[l]+=~~(n[r].count||1)}for(s in i)s=s.split(","),t.beginPath(),t.rect(s[0]*o+.5+a.x,s[1]*o+.5+a.y,o,o),t.fillStyle=p.getColor(i[s]),t.fill(),e.strokeStyle&&e.lineWidth&&t.stroke()}else{for(var v,h,d=0;d<n.length;d++)i[l=(v=n[d].geometry._coordinates||n[d].geometry.coordinates).join(",")]=~~(n[d].count||1);for(h in i)h=h.split(","),t.beginPath(),t.rect(+h[0]-o/2,+h[1]-o/2,o,o),t.fillStyle=p.getColor(i[h]),t.fill(),e.strokeStyle&&e.lineWidth&&t.stroke()}if(e.label&&!1!==e.label.show)for(var l in t.fillStyle=e.label.fillStyle||"white",e.label.font&&(t.font=e.label.font),e.label.shadowColor&&(t.shadowColor=e.label.shadowColor),e.label.shadowBlur&&(t.shadowBlur=e.label.shadowBlur),i){var g=i[l=l.split(",")],f=t.measureText(g).width;c?t.fillText(g,l[0]*o+.5+a.x+o/2-f/2,l[1]*o+.5+a.y+o/2+5):t.fillText(g,+l[0]-f/2,+l[1]+5)}t.restore()}};var z={draw:function(t,u,e){t.save();var c=u instanceof C?u.get():u;for(E in e)t[E]=e[E];for(var p,n=e.offset||{x:10,y:10},v=2*(p=(e._size||e.size||40)/2/Math.sin(Math.PI/3))*Math.sin(Math.PI/3),d=1.5*p,i={},o=0;o<c.length;o++){var g,f,a=c[o].geometry._coordinates||c[o].geometry.coordinates,s=(a[1]-n.y)/d,r=Math.round(s),a=(a[0]-n.x)/v-(1&r?.5:0),h=Math.round(a),y=s-r,a=(1<3*Math.abs(y)&&((f=a-(g=h+(a<h?-1:1)/2))*f+(s=s-(f=r+(s<r?-1:1)))*s<(s=a-h)*s+y*y&&(h=g+(1&r?1:-1)/2,r=f)),h+"-"+r),s=i[a];s?s.push(c[o]):((s=i[a]=[c[o]]).i=h,s.j=r,s.x=(h+(1&r?.5:0))*v,s.y=r*d)}var m,x,_=new M({max:e.max||100,maxSize:p,gradient:e.gradient});for(E in i){var l=i[E];t.beginPath();for(var w=0;w<6;w++){b={x:l.x+n.x,y:l.y+n.y},m=p,x=w,x=Math.PI/180*(60*x+30);var b=[b.x+m*Math.cos(x),b.y+m*Math.sin(x)];t.lineTo(b[0],b[1])}t.closePath();for(var k=0,o=0;o<l.length;o++)k+=l[o].count||1;l.count=k,t.fillStyle=_.getColor(k),t.fill(),e.strokeStyle&&e.lineWidth&&t.stroke()}if(e.label&&!1!==e.label.show)for(var E in t.fillStyle=e.label.fillStyle||"white",e.label.font&&(t.font=e.label.font),e.label.shadowColor&&(t.shadowColor=e.label.shadowColor),e.label.shadowBlur&&(t.shadowBlur=e.label.shadowBlur),i){var L=(L=(l=i[E]).count)<0?L.toFixed(2):~~L,S=t.measureText(L).width;t.fillText(L,l.x+n.x-S/2,l.y+n.y+5)}t.restore()}};function A(t,e,n){n=t.createShader(n);return t.shaderSource(n,e),t.compileShader(n),n}function R(t,e,n){var e=A(t,e,t.VERTEX_SHADER),n=A(t,n,t.FRAGMENT_SHADER),i=t.createProgram();return t.attachShader(i,e),t.attachShader(i,n),t.linkProgram(i),t.useProgram(i),i}function O(t){var e=document.createElement("canvas"),n=e.getContext("2d");return e.width=1,e.height=1,n.fillStyle=t,n.fillRect(0,0,1,1),n.getImageData(0,0,1,1).data}var T=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),D=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");var I={draw:function(t,e,n){if(e){var i=R(t,T,D),o=(t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE),t.clear(t.COLOR_BUFFER_BIT),t.canvas.width/2),u=t.canvas.height/2,a=t.createBuffer(),a=(t.bindBuffer(t.ARRAY_BUFFER,a),t.getAttribLocation(i,"a_Position")),a=(t.vertexAttribPointer(a,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(a),t.getUniformLocation(i,"u_FragColor")),i=O(n.strokeStyle||"red");t.uniform4f(a,i[0]/255,i[1]/255,i[2]/255,i[3]/255),t.lineWidth(n.lineWidth||1);for(var s=0,c=e.length;s<c;s++){for(var r=e[s].geometry._coordinates,p=[],h=0;h<r.length;h++){var l=r[h],v=(l[0]-o)/o,l=(u-l[1])/u;p.push(v,l)}var d=new Float32Array(p);t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.drawArrays(t.LINE_STRIP,0,r.length)}}}},F=["attribute vec4 a_Position;","attribute float a_PointSize;","void main() {","gl_Position = a_Position;","gl_PointSize = a_PointSize;","}"].join(""),B=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");var U={draw:function(t,e,n){if(e){for(var i=R(t,F,B),o=t.getAttribLocation(i,"a_Position"),u=t.getAttribLocation(i,"a_PointSize"),i=t.getUniformLocation(i,"u_FragColor"),a=(t.clear(t.COLOR_BUFFER_BIT),t.canvas.width/2),c=t.canvas.height/2,p=[],v=0,s=0;s<e.length;s++){var r=e[s].geometry._coordinates,h=(r[0]-a)/a,r=(c-r[1])/c;h<-1||1<h||r<-1||1<r||(p.push(h,r),v++)}var d=new Float32Array(p),g=v,l=t.createBuffer(),l=(t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,d,t.STATIC_DRAW),t.vertexAttribPointer(o,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o),t.vertexAttrib1f(u,n._size),O(n.fillStyle||"red"));t.uniform4f(i,l[0]/255,l[1]/255,l[2]/255,l[3]/255),t.drawArrays(t.POINTS,0,g)}}};function Z(t,e,n){n=n||2;var i,o,a,s,u,c=e&&e.length,p=c?e[0]*n:t.length,r=N(t,0,p,n,!0),v=[];if(!r)return v;if(c&&(r=function(t,e,n,i){var o,a,s,r,h=[];for(o=0,a=e.length;o<a;o++)r=e[o]*i,s=o<a-1?e[o+1]*i:t.length,(r=N(t,r,s,i,!1))===r.next&&(r.steiner=!0),h.push(function(t){var e=t,n=t;for(;e.x<n.x&&(n=e),e=e.next,e!==t;);return n}(r));for(h.sort(H),o=0;o<h.length;o++)!function(t,e){(e=function(t,u){var e,n=u,i=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&a<s){if((a=s)===i){if(o===n.y)return n;if(o===n.next.y)return n.next}e=n.x<n.next.x?n:n.next}}}while(n=n.next,n!==u);if(!e)return null;if(i===a)return e.prev;var r,c=e,p=e.x,h=e.y,l=1/0;n=e.next;for(;n!==c;)i>=n.x&&n.x>=p&&V(o<h?i:a,o,p,h,o<h?a:i,o,n.x,n.y)&&((r=Math.abs(o-n.y)/(i-n.x))<l||r===l&&n.x>e.x)&&G(n,t)&&(e=n,l=r),n=n.next;return e}(t,e))&&j(e=J(e,t),e.next)}(h[o],n),n=j(n,n.next);return n}(t,e,r,n)),t.length>80*n){for(var h=i=t[0],l=o=t[1],d=n;d<p;d+=n)(a=t[d])<h&&(h=a),(s=t[d+1])<l&&(l=s),i<a&&(i=a),o<s&&(o=s);u=Math.max(i-h,o-l)}return W(r,v,n,h,l,u),v}function N(t,e,n,i,o){var a,s;if(o===0<tt(t,e,n,i))for(a=e;a<n;a+=i)s=Q(a,t[a],t[a+1],s);else for(a=n-i;e<=a;a-=i)s=Q(a,t[a],t[a+1],s);return s&&$(s,s.next)&&(X(s),s=s.next),s}function j(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!$(i,i.next)&&0!==S(i.prev,i,i.next))i=i.next;else{if(X(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function W(t,e,n,i,u,o,c){if(t){if(!c&&o){for(var p=t,v=i,d=u,g=o,a=p;null===a.z&&(a.z=q(a.x,a.y,v,d,g)),a.prevZ=a.prev,a.nextZ=a.next,(a=a.next)!==p;);a.prevZ.nextZ=null,a.prevZ=null;var f,s,r,h,l,y,m,x,_=a,w=1;do{for(s=_,l=_=null,y=0;s;){for(y++,r=s,f=m=0;f<w&&(m++,r=r.nextZ);f++);for(x=w;0<m||0<x&&r;)0!==m&&(0===x||!r||s.z<=r.z)?(s=(h=s).nextZ,m--):(r=(h=r).nextZ,x--),l?l.nextZ=h:_=h,h.prevZ=l,l=h;s=r}}while(l.nextZ=null,w*=2,1<y)}for(var b,k,E=t;t.prev!==t.next;)if(b=t.prev,k=t.next,o?function(t,e,n,i){var o=t.prev,a=t,s=t.next;if(0<=S(o,a,s))return!1;var r=(o.x<a.x?o.x<s.x?o:s:a.x<s.x?a:s).x,h=(o.y<a.y?o.y<s.y?o:s:a.y<s.y?a:s).y,u=(o.x>a.x?o.x>s.x?o:s:a.x>s.x?a:s).x,c=(o.y>a.y?o.y>s.y?o:s:a.y>s.y?a:s).y,p=q(r,h,e,n,i),v=q(u,c,e,n,i),l=t.nextZ;for(;l&&l.z<=v;){if(l!==t.prev&&l!==t.next&&V(o.x,o.y,a.x,a.y,s.x,s.y,l.x,l.y)&&0<=S(l.prev,l,l.next))return!1;l=l.nextZ}l=t.prevZ;for(;l&&l.z>=p;){if(l!==t.prev&&l!==t.next&&V(o.x,o.y,a.x,a.y,s.x,s.y,l.x,l.y)&&0<=S(l.prev,l,l.next))return!1;l=l.prevZ}return!0}(t,i,u,o):function(t){var e=t.prev,n=t,i=t.next;if(0<=S(e,n,i))return!1;var o=t.next.next;for(;o!==t.prev;){if(V(e.x,e.y,n.x,n.y,i.x,i.y,o.x,o.y)&&0<=S(o.prev,o,o.next))return!1;o=o.next}return!0}(t))e.push(b.i/n),e.push(t.i/n),e.push(k.i/n),X(t),t=k.next,E=k.next;else if((t=k)===E){c?1===c?W(t=function(t,e,n){var i=t;do{var o=i.prev,a=i.next.next}while(!$(o,a)&&Y(o,i,i.next,a)&&G(o,a)&&G(a,o)&&(e.push(o.i/n),e.push(i.i/n),e.push(a.i/n),X(i),X(i.next),i=t=a),i=i.next,i!==t);return i}(t,e,n),e,n,i,u,o,2):2===c&&function(t,e,n,i,o,a){var s=t;do{for(var r,h=s.next.next;h!==s.prev;){if(s.i!==h.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Y(n,n.next,t,e))return!0}while(n=n.next,n!==t);return!1}(t,e)&&G(t,e)&&G(e,t)&&function(t,e){var n=t,i=!1,o=(t.x+e.x)/2,a=(t.y+e.y)/2;for(;n.y>a!=n.next.y>a&&o<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next,n!==t;);return i}(t,e)}(s,h))return r=J(s,h),s=j(s,s.next),r=j(r,r.next),W(s,e,n,i,o,a),W(r,e,n,i,o,a);h=h.next}}while(s=s.next,s!==t)}(t,e,n,i,u,o):W(j(t),e,n,i,u,o,1);break}}}function H(t,e){return t.x-e.x}function q(t,e,n,i,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function V(t,e,n,i,o,a,s,r){return 0<=(o-s)*(e-r)-(t-s)*(a-r)&&0<=(t-s)*(i-r)-(n-s)*(e-r)&&0<=(n-s)*(a-r)-(o-s)*(i-r)}function S(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function $(t,e){return t.x===e.x&&t.y===e.y}function Y(t,e,n,i){return $(t,e)&&$(n,i)||$(t,i)&&$(n,e)||0<S(t,e,n)!=0<S(t,e,i)&&0<S(n,i,t)!=0<S(n,i,e)}function G(t,e){return S(t.prev,t,t.next)<0?0<=S(t,e,t.next)&&0<=S(t,t.prev,e):S(t,e,t.prev)<0||S(t,t.next,e)<0}function J(t,e){var n=new K(t.i,t.x,t.y),i=new K(e.i,e.x,e.y),o=t.next,a=e.prev;return(t.next=e).prev=t,(n.next=o).prev=n,(i.next=n).prev=i,(a.next=i).prev=a,i}function Q(t,e,n,i){t=new K(t,e,n);return i?(t.next=i.next,(t.prev=i).next.prev=t,i.next=t):(t.prev=t).next=t,t}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function K(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function tt(t,e,n,i){for(var o=0,a=e,s=n-i;a<n;a+=i)o+=(t[s]-t[a])*(t[a+1]+t[s+1]),s=a;return o}Z.deviation=function(t,e,n,i){var o=e&&e.length,u=o?e[0]*n:t.length,a=Math.abs(tt(t,0,u,n));if(o)for(var s=0,r=e.length;s<r;s++){var c=e[s]*n,p=s<r-1?e[s+1]*n:t.length;a-=Math.abs(tt(t,c,p,n))}for(var h=0,s=0;s<i.length;s+=3){var l=i[s]*n,v=i[s+1]*n,d=i[s+2]*n;h+=Math.abs((t[l]-t[d])*(t[1+v]-t[1+l])-(t[l]-t[v])*(t[1+d]-t[1+l]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},Z.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,o=0;o<t.length;o++){for(var a=0;a<t[o].length;a++)for(var s=0;s<e;s++)n.vertices.push(t[o][a][s]);0<o&&(i+=t[o-1].length,n.holes.push(i))}return n};var et=["attribute vec4 a_Position;","void main() {","gl_Position = a_Position;","gl_PointSize = 30.0;","}"].join(""),nt=["precision mediump float;","uniform vec4 u_FragColor;","void main() {","gl_FragColor = u_FragColor;","}"].join("");var it={draw:function(t,e,u){if(e){t.clear(t.COLOR_BUFFER_BIT),t.viewport(0,0,t.canvas.width,t.canvas.height);for(var n=R(t,et,nt),c=(t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE),t.canvas.width/2),p=t.canvas.height/2,i=(t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,t.createBuffer()),t.getAttribLocation(n,"a_Position")),i=(t.vertexAttribPointer(i,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(i),t.getUniformLocation(n,"u_FragColor")),n=O(u.fillStyle||"red"),o=(t.uniform4f(i,n[0]/255,n[1]/255,n[2]/255,n[3]/255),t.lineWidth(u.lineWidth||1),[]),a=[],v=0,s=0,d=e.length;s<d;s++){for(var r=Z.flatten(e[s].geometry._coordinates||e[s].geometry.coordinates),h=r.vertices,v=o.length/2,l=0;l<h.length;l+=2)h[l]=(h[l]-c)/c,h[l+1]=(p-h[l+1])/p;65536<(o.length+h.length)/2&&(t.bufferData(t.ARRAY_BUFFER,new Float32Array(o),t.STATIC_DRAW),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(a),t.STATIC_DRAW),t.drawElements(t.TRIANGLES,a.length,t.UNSIGNED_SHORT,0),o.length=0,v=a.length=0);for(l=0;l<h.length;l++)o.push(h[l]);for(var g=Z(h,r.holes,r.dimensions),l=0;l<g.length;l++)a.push(g[l]+v)}t.bufferData(t.ARRAY_BUFFER,new Float32Array(o),t.STATIC_DRAW),t.bufferData(t.ELEMENT_ARRAY_BUFFER,new Uint16Array(a),t.STATIC_DRAW),t.drawElements(t.TRIANGLES,a.length,t.UNSIGNED_SHORT,0),t.bindBuffer(t.ARRAY_BUFFER,null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}}},ot={draw:function(t,e,n){e=e instanceof C?e.get():e;0<e.length&&("LineString"==e[0].geometry.type?I:"Polygon"==e[0].geometry.type||"MultiPolygon"==e[0].geometry.type?it:U).draw(t,e,n)}};var at={getPoints:function(t,e){e=e||{};for(var n=[],i=0;i<t.length-1;i++){var o=function(t,e,u){if(!t||!e)return null;function c(t){return 1-2*t+t*t}function p(t){return 2*t-2*t*t}function v(t){return t*t}var d,n,g,f,i,o=[],u=u||40,y=0,a=0;if(void 0!==e){var s=parseFloat(t.lat),r=parseFloat(e.lat),h=parseFloat(t.lng),l=parseFloat(e.lng);for(h<l&&180<parseFloat(l-h)&&h<0&&(h=parseFloat(360+h),l=parseFloat(360+l)),i=0,d=r==s?(n=0,h-l):l==h?(n=Math.PI/2,s-r):(n=Math.atan((r-s)/(l-h)),(r-s)/Math.sin(n)),0==i&&(i=n+Math.PI/5),f=(n=d/2)*Math.cos(i)+h,g=n*Math.sin(i)+s,y=0;y<u+1;y++){var m=h*c(a)+f*p(a)+l*v(a),x=s*c(a)+g*p(a)+r*v(a),_=t.lng,w=e.lng;o.push([_<0&&0<w?m-360:m,x]),a+=1/u}return o}void 0!==o&&(o=[])}(t[i],t[i+1],e.count);o&&0<o.length&&(n=n.concat(o))}return n}};function st(t){this.splitList=t||{other:1}}function rt(t){this.splitList=t||[{start:0,value:"red"}]}st.prototype.get=function(t){var e,n=this.splitList,i=n.other;for(e in n)if(t==e){i=n[e];break}return i},st.prototype.generateByDataSet=function(t,e){for(var n=e||["rgba(255, 255, 0, 0.8)","rgba(253, 98, 104, 0.8)","rgba(255, 146, 149, 0.8)","rgba(255, 241, 193, 0.8)","rgba(110, 176, 253, 0.8)","rgba(52, 139, 251, 0.8)","rgba(17, 102, 252, 0.8)"],i=t.get(),o=(this.splitList={},0),a=0;a<i.length&&(void 0===this.splitList[i[a].count]&&(this.splitList[i[a].count]=n[o],o++),!(o>=n.length-1));a++);this.splitList.other=n[n.length-1]},st.prototype.getLegend=function(t){var e,n=this.splitList,i=document.createElement("div"),o=(i.style.cssText="background:#fff; padding: 5px; border: 1px solid #ccc;","");for(e in n)o+='<div style="line-height: 19px;" value="'+e+'"><span style="vertical-align: -2px; display: inline-block; width: 30px;height: 19px;background:'+n[e]+';"></span><span style="margin-left: 3px;">'+e+"<span></div>";return i.innerHTML=o,i},rt.prototype.get=function(t){for(var e=this.splitList,n=!1,i=0;i<e.length;i++)if((void 0===e[i].start||void 0!==e[i].start&&t>=e[i].start)&&(void 0===e[i].end||void 0!==e[i].end&&t<e[i].end)){n=e[i].value;break}return n},rt.prototype.generateByDataSet=function(t){var e=t.getMin("count"),t=t.getMax("count");this.generateByMinMax(e,t)},rt.prototype.generateByMinMax=function(t,e){for(var n=["rgba(255, 255, 0, 0.8)","rgba(253, 98, 104, 0.8)","rgba(255, 146, 149, 0.8)","rgba(255, 241, 193, 0.8)","rgba(110, 176, 253, 0.8)","rgba(52, 139, 251, 0.8)","rgba(17, 102, 252, 0.8)"],i=Number((e-t)/7),o=(e=Number(e),Number(t)),a=(this.splitList=[],0);o<e;)this.splitList.push({start:o,end:o+i,value:n[a]}),a++,o+=i},rt.prototype.getLegend=function(t){this.splitList};e(lt,[{key:"addLayer",value:function(t,e){if("baidu"==this.type)return new mapv.baiduMapLayer(this.map,dataSet,e)}},{key:"getMap",value:function(){return this.map}}]);var ht=lt;function lt(t,e,n){if(l(this,lt),!t||!e)return console.warn("id 和 type 为必填项"),!1;if("baidu"==e){if(!BMap)return console.warn("请先引入百度地图JS API"),!1}else console.warn("暂不支持你的地图类型");this.type=e;e=n&&n.center?n.center:[106.962497,38.208726],n=n&&n.zoom?n.zoom:5,t=this.map=new BMap.Map(t,{enableMapClick:!1});t.centerAndZoom(new BMap.Point(e[0],e[1]),n),t.enableScrollWheelZoom(!0),t.setMapStyle({style:"light"})}function ut(t){this.options=t||{},this.paneName=this.options.paneName||"mapPane",this.context=this.options.context||"2d",this.zIndex=this.options.zIndex||0,this.mixBlendMode=this.options.mixBlendMode||null,this.enableMassClear=this.options.enableMassClear,this._map=t.map,this._lastDrawTime=null,this.show()}var ct,pt,vt="undefined"==typeof window?{}:window,r=(vt.BMap&&((ut.prototype=new BMap.Overlay).initialize=function(t){this._map=t;var e=this.canvas=document.createElement("canvas");e.style.cssText="position:absolute;left:0;top:0;z-index:"+this.zIndex+";user-select:none;",e.style.mixBlendMode=this.mixBlendMode,this.adjustSize();(t.getPanes()[this.paneName]||t.getPanes().floatShadow).appendChild(e);var n=this;return t.addEventListener("resize",function(){n.adjustSize(),n._draw()}),this.canvas},ut.prototype.adjustSize=function(){var t=this._map.getSize(),e=this.canvas,n=this.devicePixelRatio=vt.devicePixelRatio||1;e.width=t.width*n,e.height=t.height*n,"2d"==this.context&&e.getContext(this.context).scale(n,n),e.style.width=t.width+"px",e.style.height=t.height+"px"},ut.prototype.draw=function(){var t=this;clearTimeout(t.timeoutID),t.timeoutID=setTimeout(function(){t._draw()},15)},ut.prototype._draw=function(){var t=this._map,e=t.getSize(),n=t.getCenter();n&&(t=t.pointToOverlayPixel(n),this.canvas.style.left=t.x-e.width/2+"px",this.canvas.style.top=t.y-e.height/2+"px",this.dispatchEvent("draw"),this.options.update&&this.options.update.call(this))},ut.prototype.getContainer=function(){return this.canvas},ut.prototype.show=function(){this.canvas||this._map.addOverlay(this),this.canvas.style.display="block"},ut.prototype.hide=function(){this.canvas.style.display="none"},ut.prototype.setZIndex=function(t){this.zIndex=t,this.canvas.style.zIndex=this.zIndex},ut.prototype.getZIndex=function(){return this.zIndex}),r||(ct=[],{getAll:function(){return ct},removeAll:function(){ct=[]},add:function(t){ct.push(t)},remove:function(t){t=ct.indexOf(t);-1!==t&&ct.splice(t,1)},update:function(t,e){if(0===ct.length)return!1;var n=0;for(t=void 0!==t?t:r.now();n<ct.length;)ct[n].update(t)||e?n++:ct.splice(n,1);return!0}}));"undefined"==typeof window&&"undefined"!=typeof process?r.now=function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?r.now=window.performance.now.bind(window.performance):void 0!==Date.now?r.now=Date.now:r.now=function(){return(new Date).getTime()},r.Tween=function(t){var l,u=t,c={},p={},v={},d=1e3,g=0,f=!1,n=!1,x=0,y=null,_=r.Easing.Linear.None,w=r.Interpolation.Linear,m=[],b=null,k=!1,E=null,L=null,e=null;this.to=function(t,e){return p=t,void 0!==e&&(d=e),this},this.start=function(t){for(var e in r.add(this),k=!(n=!0),y=void 0!==t?t:r.now(),y+=x,p){if(p[e]instanceof Array){if(0===p[e].length)continue;p[e]=[u[e]].concat(p[e])}void 0!==u[e]&&(c[e]=u[e],c[e]instanceof Array==!1&&(c[e]*=1),v[e]=c[e]||0)}return this},this.stop=function(){return n&&(r.remove(this),n=!1,null!==e&&e.call(u,u),this.stopChainedTweens()),this},this.end=function(){return this.update(y+d),this},this.stopChainedTweens=function(){for(var t=0,e=m.length;t<e;t++)m[t].stop()},this.delay=function(t){return x=t,this},this.repeat=function(t){return g=t,this},this.repeatDelay=function(t){return l=t,this},this.yoyo=function(t){return f=t,this},this.easing=function(t){return _=t,this},this.interpolation=function(t){return w=t,this},this.chain=function(){return m=arguments,this},this.onStart=function(t){return b=t,this},this.onUpdate=function(t){return E=t,this},this.onComplete=function(t){return L=t,this},this.onStop=function(t){return e=t,this},this.update=function(t){var e,n,i,o,a,s;if(t<y)return!0;for(e in!1===k&&(null!==b&&b.call(u,u),k=!0),i=_(n=1<(n=(t-y)/d)?1:n),p)void 0!==c[e]&&(o=c[e]||0,(a=p[e])instanceof Array?u[e]=w(a,i):"number"==typeof(a="string"==typeof a?"+"===a.charAt(0)||"-"===a.charAt(0)?o+parseFloat(a):parseFloat(a):a)&&(u[e]=o+(a-o)*i));if(null!==E&&E.call(u,i),1!==n)return!0;if(0<g){for(e in isFinite(g)&&g--,v)"string"==typeof p[e]&&(v[e]=v[e]+parseFloat(p[e])),f&&(s=v[e],v[e]=p[e],p[e]=s),c[e]=v[e];return f&&0,y=void 0!==l?t+l:t+x,!0}null!==L&&L.call(u,u);for(var r=0,h=m.length;r<h;r++)m[r].start(y+d);return!1}},r.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){return t*t*(2.70158*t-1.70158)},Out:function(t){return--t*t*(2.70158*t+1.70158)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)}},Bounce:{In:function(t){return 1-r.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*r.Easing.Bounce.In(2*t):.5*r.Easing.Bounce.Out(2*t-1)+.5}}},r.Interpolation={Linear:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),a=r.Interpolation.Utils.Linear;return e<0?a(t[0],t[1],i):1<e?a(t[n],t[n-1],n-i):a(t[o],t[n<o+1?n:o+1],i-o)},Bezier:function(t,e){for(var n=0,i=t.length-1,o=Math.pow,a=r.Interpolation.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-e,i-s)*o(e,s)*t[s]*a(i,s);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),a=r.Interpolation.Utils.CatmullRom;return t[0]===t[n]?a(t[((o=e<0?Math.floor(i=n*(1+e)):o)-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-i)-t[0]):1<e?t[n]-(a(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):a(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=r.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(pt=[1],function(t){var e=1;if(pt[t])return pt[t];for(var n=t;1<n;n--)e*=n;return pt[t]=e}),CatmullRom:function(t,e,n,i,o){var t=.5*(n-t),i=.5*(i-e),a=o*o;return(2*e-2*n+t+i)*(o*a)+(-3*e+3*n-2*t-i)*a+t*o+e}}};var dt={},gt={draw:function(t,u,e){var c,p,n="http://huiyan.baidu.com/github/tools/gis-drawing/static/images/direction.png",i=(e.arrow&&e.arrow.url&&(n=e.arrow.url),dt[n]||(dt[n]=null),dt[n]);if(!i)return c=Array.prototype.slice.call(arguments),(p=new Image).onload=function(){dt[n]=p,gt.draw.apply(null,c)},void(p.src=n);var v,d=u instanceof C?u.get():u;for(v in t.save(),e)t[v]=e[v];for(var o,a,s,g=[],f=null,y=0,m=d.length;y<m;y++){var r=d[y],x=(t.save(),(r.fillStyle||r._fillStyle)&&(t.fillStyle=r.fillStyle||r._fillStyle),(r.strokeStyle||r._strokeStyle)&&(t.strokeStyle=r.strokeStyle||r._strokeStyle),r.geometry.type);if(t.beginPath(),"LineString"===x)for(var h,_,w=r.geometry._coordinates||r.geometry.coordinates,b=void 0!==e.arrow.interval?e.arrow.interval:1,l=0;l<w.length;l+=b)w[l]&&w[l+1]&&(h=w[l],f&&(a=h,s=f,Math.sqrt(Math.pow(a[0]-s[0],2)+Math.pow(a[1]-s[1],2))<30)||(t.save(),a=w[l],s=w[l+1],o=_=void 0,_=s[0]-a[0],o=s[1]-a[1],o=360*Math.atan(o/_)/(2*Math.PI),s[0]<a[0]&&(o+=180),_=o,t.translate(h[0],h[1]),t.rotate(_*Math.PI/180),t.drawImage(i,-i.width/2/2,-i.height/2/2,i.width/2,i.height/2),t.restore(),g.push(h),f=h));t.restore()}t.restore()}};var ft=function(t,e,n){var i=e instanceof C?e.get():e;t.save(),t.fillStyle=n.fillStyle||"rgba(0, 0, 0, 0.5)",t.fillRect(0,0,t.canvas.width,t.canvas.height),n.multiPolygonDraw=function(){t.save(),t.clip(),p(t),t.restore()};for(var o=0,a=i.length;o<a;o++)t.beginPath(),f.drawDataSet(t,[i[o]],n),t.save(),t.clip(),p(t),t.restore();t.restore()},yt=function(t,e,n){t.save();for(var i,o,a=e instanceof C?e.get():e,s=0;s<a.length;s++)(h=a[s]).properties&&h.properties.cluster&&(void 0===i&&(i=h.properties.point_count),void 0===o&&(o=h.properties.point_count),i=Math.max(i,h.properties.point_count),o=Math.min(o,h.properties.point_count));for(var u=new M({min:o,max:i,minSize:n.minSize||8,maxSize:n.maxSize||30,gradient:n.gradient}),s=0;s<a.length;s++){var r,c,h=a[s],l=a[s].geometry._coordinates||a[s].geometry.coordinates;t.beginPath(),h.properties&&h.properties.cluster?(t.arc(l[0],l[1],u.getSize(h.properties.point_count),0,2*Math.PI),t.fillStyle=u.getColor(h.properties.point_count),t.fill(),n.label&&!1!==n.label.show&&(t.fillStyle=n.label.fillStyle||"white",n.label.font&&(t.font=n.label.font),n.label.shadowColor&&(t.shadowColor=n.label.shadowColor),n.label.shadowBlur&&(t.shadowBlur=n.label.shadowBlur),r=h.properties.point_count,c=t.measureText(r).width,t.fillText(r,l[0]+.5-c/2,l[1]+.5+3))):(t.arc(l[0],l[1],n.size||5,0,2*Math.PI),t.fillStyle=n.fillStyle||"red",t.fill())}t.restore()},mt=function(t,e,n){var u,i=e instanceof C?e.get():e;for(u in t.save(),n)t[u]=n[u];var c=[],o=n._size||n.size,p=(o?t.font="bold "+o+"px Arial":o=12,n.textKey||"text");if(n.textAlign||(t.textAlign="center"),n.textBaseline||(t.textBaseline="middle"),n.avoid)for(var a=0,v=i.length;a<v;a++){var s=i[a].offset||n.offset||{x:0,y:0},d=(l=i[a].geometry._coordinates||i[a].geometry.coordinates)[0]+s.x,g=l[1]+s.y,f=i[a][p],y=t.measureText(f).width,r=d-y/2,h=g-o/2,m={sw:{x:r,y:h+o},ne:{x:r+y,y:h}};!function(t,e){for(var n=0;n<t.length;n++)if(function(t,e){var n=Math.min(t.ne.x,e.ne.x),i=Math.min(t.sw.y,e.sw.y),o=Math.max(t.sw.x,e.sw.x),t=Math.max(t.ne.y,e.ne.y);if(o<n&&t<i)return!0;return!1}(t[n],e))return!0;return!1}(c,m)&&(c.push(m),r+=y/2,h+=o/2,t.fillText(f,r,h))}else for(a=0,v=i.length;a<v;a++){var l,s=i[a].offset||n.offset||{x:0,y:0},d=(l=i[a].geometry._coordinates||i[a].geometry.coordinates)[0]+s.x,g=l[1]+s.y,f=i[a][p];t.fillText(f,d,g)}t.restore()};var xt=function(t,u,e){for(var n,i,o,a,s,r,h=u instanceof C?u.get():u,c=(t.fillStyle="white",t.textAlign="center",t.textBaseline="middle",e.offset||{x:0,y:0}),l=0,p=h.length;l<p;l++)h[l].geometry&&(n=h[l].deg||e.deg,i=h[l].icon||e.icon,s=(r=h[l].geometry._coordinates||h[l].geometry.coordinates)[0],r=r[1],n&&(t.save(),t.translate(s,r),t.rotate(n*Math.PI/180),t.translate(-s,-r)),o=e._width||e.width||i.width,a=e._height||e.height||i.height,s=s-o/2+c.x,r=r-a/2+c.y,e.sx&&e.sy&&e.swidth&&e.sheight&&e.width&&e.height?t.drawImage(i,e.sx,e.sy,e.swidth,e.sheight,s,r,o,a):e.width&&e.height?t.drawImage(i,s,r,o,a):t.drawImage(i,s,r),n&&t.restore())};function _t(t,e,n,i,o,a){var s;o-i<=n||(function u(t,e,n,i,o,a){for(;i<o;){600<o-i&&(s=o-i+1,h=n-i+1,r=Math.log(s),c=.5*Math.exp(2*r/3),r=.5*Math.sqrt(r*c*(s-c)/s)*(h-s/2<0?-1:1),p=Math.max(i,Math.floor(n-h*c/s+r)),h=Math.min(o,Math.floor(n+(s-h)*c/s+r)),u(t,e,n,p,h,a));var s,c,r,p,h,v=e[2*n+a],d=i,l=o;for(wt(t,e,i,n),e[2*o+a]>v&&wt(t,e,i,o);d<l;){for(wt(t,e,d,l),d++,l--;e[2*d+a]<v;)d++;for(;e[2*l+a]>v;)l--}e[2*i+a]===v?wt(t,e,i,l):wt(t,e,++l,o),l<=n&&(i=l+1),n<=l&&(o=l-1)}}(t,e,s=i+o>>1,i,o,a%2),_t(t,e,n,i,s-1,a+1),_t(t,e,n,1+s,o,a+1))}function wt(t,e,n,i){bt(t,n,i),bt(e,2*n,2*i),bt(e,2*n+1,2*i+1)}function bt(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function kt(t,e,n,i){t-=n,n=e-i;return t*t+n*n}function Et(t){return t[0]}function Lt(t){return t[1]}function St(t,e,n,i,o){void 0===e&&(e=Et),void 0===n&&(n=Lt),void 0===i&&(i=64),void 0===o&&(o=Float64Array),this.nodeSize=i;for(var a=(this.points=t).length<65536?Uint16Array:Uint32Array,s=this.ids=new a(t.length),r=this.coords=new o(2*t.length),h=0;h<t.length;h++)r[2*(s[h]=h)]=e(t[h]),r[2*h+1]=n(t[h]);_t(s,r,i,0,s.length-1,0)}function Ct(t){this.options=Ot(Object.create(Mt),t),this.trees=new Array(this.options.maxZoom+1)}St.prototype.range=function(u,c,p,v){for(var t=this.ids,e=this.coords,n=u,d=c,g=p,f=v,y=this.nodeSize,i=[0,t.length-1,0],m=[];i.length;){var x=i.pop(),o=i.pop(),a=i.pop();if(o-a<=y)for(var s=a;s<=o;s++)h=e[2*s],l=e[2*s+1],n<=h&&h<=g&&d<=l&&l<=f&&m.push(t[s]);else{var r=Math.floor((a+o)/2),h=e[2*r],l=e[2*r+1],_=(n<=h&&h<=g&&d<=l&&l<=f&&m.push(t[r]),(x+1)%2);(0===x?n<=h:d<=l)&&(i.push(a),i.push(r-1),i.push(_)),(0===x?h<=g:l<=f)&&(i.push(r+1),i.push(o),i.push(_))}}return m};var Mt={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!(St.prototype.within=function(u,c,p){for(var t=this.ids,e=this.coords,n=u,i=c,o=p,v=this.nodeSize,a=[0,t.length-1,0],d=[],g=o*o;a.length;){var f=a.pop(),s=a.pop(),r=a.pop();if(s-r<=v)for(var h=r;h<=s;h++)kt(e[2*h],e[2*h+1],n,i)<=g&&d.push(t[h]);else{var l=Math.floor((r+s)/2),y=e[2*l],m=e[2*l+1],x=(kt(y,m,n,i)<=g&&d.push(t[l]),(f+1)%2);(0===f?n-o<=y:i-o<=m)&&(a.push(r),a.push(l-1),a.push(x)),(0===f?y<=n+o:m<=i+o)&&(a.push(l+1),a.push(s),a.push(x))}}return d}),reduce:null,map:function(t){return t}};function Pt(t){return{type:"Feature",id:t.id,properties:zt(t),geometry:{type:"Point",coordinates:[360*(t.x-.5),function(t){t=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}(t.y)]}}}function zt(t){var e=t.numPoints,n=1e4<=e?Math.round(e/1e3)+"k":1e3<=e?Math.round(e/100)/10+"k":e;return Ot(Ot({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function At(t){return t/360+.5}function Rt(t){t=Math.sin(t*Math.PI/180),t=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return t<0?0:1<t?1:t}function Ot(t,e){for(var n in e)t[n]=e[n];return t}function Tt(t){return t.x}function Dt(t){return t.y}Ct.prototype.load=function(t){for(var e,n,i,o=this.options,u=(o.log,o.minZoom),a=o.maxZoom,s=o.nodeSize,r=(t.length,this.points=t,[]),h=0;h<t.length;h++)t[h].geometry&&r.push((e=t[h],n=h,i=void 0,e=e.geometry.coordinates,i=e[0],e=e[1],{x:At(i),y:Rt(e),zoom:1/0,index:n,parentId:-1}));this.trees[a+1]=new St(r,Tt,Dt,s,Float32Array);for(var l=a;u<=l;l--){Date.now();r=this._cluster(r,l);this.trees[l]=new St(r,Tt,Dt,s,Float32Array)}return this},Ct.prototype.getClusters=function(t,e){var n,i=((t[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[1])),a=180===t[2]?180:((t[2]+180)%360+360)%360-180,s=Math.max(-90,Math.min(90,t[3]));if(360<=t[2]-t[0])i=-180,a=180;else if(a<i)return t=this.getClusters([i,o,180,s],e),n=this.getClusters([-180,o,a,s],e),t.concat(n);for(var r=this.trees[this._limitZoom(e)],u=[],h=0,c=r.range(At(i),Rt(s),At(a),Rt(o));h<c.length;h+=1){var l=c[h],l=r.points[l];u.push(l.numPoints?Pt(l):this.points[l.index])}return u},Ct.prototype.getChildren=function(t){var e=t>>5,n=t%32,i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);e=o.points[e];if(!e)throw new Error(i);for(var n=this.options.radius/(this.options.extent*Math.pow(2,n-1)),a=[],s=0,r=o.within(e.x,e.y,n);s<r.length;s+=1){var h=r[s],h=o.points[h];h.parentId===t&&a.push(h.numPoints?Pt(h):this.points[h.index])}if(0===a.length)throw new Error(i);return a},Ct.prototype.getLeaves=function(t,e,n){var i=[];return this._appendLeaves(i,t,e=e||10,n=n||0,0),i},Ct.prototype.getTile=function(t,e,n){var i=this.trees[this._limitZoom(t)],t=Math.pow(2,t),o=this.options,a=o.extent,o=o.radius/a,a=(n-o)/t,s=(n+1+o)/t,r={features:[]};return this._addTileFeatures(i.range((e-o)/t,a,(e+1+o)/t,s),i.points,e,n,t,r),0===e&&this._addTileFeatures(i.range(1-o/t,a,1,s),i.points,t,n,t,r),e===t-1&&this._addTileFeatures(i.range(0,a,o/t,s),i.points,-1,n,t,r),r.features.length?r:null},Ct.prototype.getClusterExpansionZoom=function(t){for(var e=t%32-1;e<=this.options.maxZoom;){var n=this.getChildren(t);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},Ct.prototype._appendLeaves=function(t,e,n,i,o){for(var a=0,s=this.getChildren(e);a<s.length;a+=1){var r=s[a],h=r.properties;if(h&&h.cluster?o+h.point_count<=i?o+=h.point_count:o=this._appendLeaves(t,h.cluster_id,n,i,o):o<i?o++:t.push(r),t.length===n)break}return o},Ct.prototype._addTileFeatures=function(t,e,n,i,o,a){for(var s=0,r=t;s<r.length;s+=1){var h=e[r[s]],l={type:1,geometry:[[Math.round(this.options.extent*(h.x*o-n)),Math.round(this.options.extent*(h.y*o-i))]],tags:h.numPoints?zt(h):this.points[h.index].properties},h=(h.numPoints?h:this.points[h.index]).id;void 0!==h&&(l.id=h),a.features.push(l)}},Ct.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},Ct.prototype._cluster=function(u,t){for(var e=[],n=this.options,c=n.radius,p=n.extent,i=n.reduce,v=c/(p*Math.pow(2,t)),o=0;o<u.length;o++){var a=u[o];if(!(a.zoom<=t)){a.zoom=t;for(var d=this.trees[t+1],g=d.within(a.x,a.y,v),s=a.numPoints||1,f=a.x*s,y=a.y*s,r=i&&1<s?this._map(a,!0):null,m=(o<<5)+(t+1),x=0,_=g;x<_.length;x+=1){var h,l=_[x],l=d.points[l];l.zoom<=t||(l.zoom=t,h=l.numPoints||1,f+=l.x*h,y+=l.y*h,s+=h,l.parentId=m,i&&i(r=r||this._map(a,!0),this._map(l)))}1===s?e.push(a):(a.parentId=m,e.push({x:f/s,y:y/s,zoom:1/0,id:m,parentId:-1,numPoints:s,properties:r}))}}return e},Ct.prototype._map=function(t,e){if(t.numPoints)return e?Ot({},t.properties):t.properties;var t=this.points[t.index].properties,n=this.options.map(t);return e&&n===t?Ot({},n):n},"undefined"!=typeof window&&requestAnimationFrame(function t(e){requestAnimationFrame(t);r.update(e)});e(Ft,[{key:"getDefaultContextConfig",value:function(){return{globalAlpha:1,globalCompositeOperation:"source-over",imageSmoothingEnabled:!0,strokeStyle:"#000000",fillStyle:"#000000",shadowOffsetX:0,shadowOffsetY:0,shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0)",lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,lineDashOffset:0,font:"10px sans-serif",textAlign:"start",textBaseline:"alphabetic"}}},{key:"initDataRange",value:function(t){var e,n,i=this;i.intensity=new M({maxSize:i.options.maxSize,minSize:i.options.minSize,gradient:i.options.gradient,max:i.options.max||this.dataSet.getMax("count")}),i.category=new st(i.options.splitList),i.choropleth=new rt(i.options.splitList),void 0===i.options.splitList&&i.category.generateByDataSet(this.dataSet,i.options.color),void 0===i.options.splitList&&(e=i.options.min||this.dataSet.getMin("count"),n=i.options.max||this.dataSet.getMax("count"),i.choropleth.generateByMinMax(e,n))}},{key:"getLegend",value:function(t){this.options.draw;return"intensity"==this.options.draw||"heatmap"==this.options.draw?this.intensity.getLegend(t):"category"==this.options.draw?this.category.getLegend(t):void 0}},{key:"processData",value:function(t){var e=this,n=e.options.draw;if("bubble"==n||"intensity"==n||"category"==n||"choropleth"==n||"simple"==n)for(var i=0;i<t.length;i++){var o=t[i],a=("bubble"==e.options.draw?t[i]._size=e.intensity.getSize(o.count):t[i]._size=void 0,"_fillStyle");"LineString"!==t[i].geometry.type&&"stroke"!==e.options.styleType||(a="_strokeStyle"),"intensity"==e.options.draw?t[i][a]=e.intensity.getColor(o.count):"category"==e.options.draw?t[i][a]=e.category.get(o.count):"choropleth"==e.options.draw&&(t[i][a]=e.choropleth.get(o.count))}}},{key:"isEnabledTime",value:function(){var t=this.options.animation;return t&&!(!1===t.enabled)}},{key:"argCheck",value:function(t){"heatmap"==t.draw&&t.strokeStyle&&console.warn("[heatmap] options.strokeStyle is discard, pleause use options.strength [eg: options.strength = 0.1]")}},{key:"drawContext",value:function(t,e,n,i){var o=this;switch(o.options.draw){case"heatmap":k.draw(t,e,o.options);break;case"grid":case"cluster":case"honeycomb":o.options.offset={x:i.x,y:i.y},"grid"===o.options.draw?E.draw(t,e,o.options):"cluster"===o.options.draw?yt(t,e,o.options):z.draw(t,e,o.options);break;case"text":mt(t,e,o.options);break;case"icon":xt(t,e,o.options);break;case"clip":ft(t,e,o.options);break;default:"webgl"==o.options.context?ot.draw(o.canvasLayer.canvas.getContext("webgl"),e,o.options):y.draw(t,e,o.options)}o.options.arrow&&!1!==o.options.arrow.show&&gt.draw(t,e,o.options)}},{key:"isPointInPath",value:function(t,e){for(var t=this.canvasLayer.canvas.getContext(this.context),n=("cluster"===this.options.draw?this.clusterDataSet:this.dataSet).get(),i=0;i<n.length;i++){t.beginPath();var o=this.options,a=e.x*this.canvasLayer.devicePixelRatio,s=e.y*this.canvasLayer.devicePixelRatio;if(o.multiPolygonDraw=function(){if(t.isPointInPath(a,s))return n[i]},f.draw(t,n[i],o),-1<(n[i].geometry&&n[i].geometry.type).indexOf("LineString")){if(t.isPointInStroke&&t.isPointInStroke(a,s))return n[i]}else if(t.isPointInPath(a,s))return n[i]}}},{key:"clickEvent",value:function(t,e){this.options.methods&&((t=this.isPointInPath(this.getContext(),t))?this.options.methods.click(t,e):this.options.methods.click(null,e))}},{key:"mousemoveEvent",value:function(t,e){this.options.methods&&((t=this.isPointInPath(this.getContext(),t))?this.options.methods.mousemove(t,e):this.options.methods.mousemove(null,e))}},{key:"tapEvent",value:function(t,e){this.options.methods&&((t=this.isPointInPath(this.getContext(),t))?this.options.methods.tap(t,e):this.options.methods.tap(null,e))}},{key:"update",value:function(t,e){var n,i=t.options,o=this.options;for(n in i)o[n]=i[n];this.init(o),!1!==e&&this.draw()}},{key:"setOptions",value:function(t){this.dataSet.reset(),this.init(t),this.draw()}},{key:"set",value:function(t){var e,n=this.getContext(),i=this.getDefaultContextConfig();for(e in i)n[e]=i[e];this.init(t.options),this.draw()}},{key:"destroy",value:function(){this.unbindEvent(),this.hide()}},{key:"initAnimator",value:function(){var t,e=this,n=e.options.animation;"time"==e.options.draw||e.isEnabledTime()?(n.stepsRange||(n.stepsRange={start:this.dataSet.getMin("time")||0,end:this.dataSet.getMax("time")||0}),this.steps={step:n.stepsRange.start},e.animator=new r.Tween(this.steps).onUpdate(function(){e._canvasUpdate(this.step)}).repeat(1/0),this.addAnimatorEvent(),t=1e3*n.duration||5e3,e.animator.to({step:n.stepsRange.end},t),e.animator.start()):e.animator&&e.animator.stop()}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start,this.animator.stop())}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator&&this.animator.start()}}]);var It=Ft;function Ft(t,e,n){l(this,Ft),e instanceof C||(e=new C(e)),this.dataSet=e,this.map=t,"cluster"!==n.draw||this.supercluster||(this.supercluster=new Ct({maxZoom:n.maxZoom||19,radius:n.clusterRadius||100}),this.supercluster.load(e.get()),this.clusterDataSet=new C)}v(Ut,It),e(Ut,[{key:"draw",value:function(){this.canvasLayer.draw()}},{key:"init",value:function(t){var e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(e.options.zIndex),e.options.max&&this.intensity.setMax(e.options.max),e.options.min&&this.intensity.setMin(e.options.min),this.initAnimator()}},{key:"transferToMercator",value:function(){var t,e=this.map.getMapType().getProjection();"bd09mc"!==this.options.coordType&&(t=this.dataSet.get(),t=this.dataSet.transferCoordinate(t,function(t){t=e.lngLatToPoint({lng:t[0],lat:t[1]});return[t.x,t.y]},"coordinates","coordinates_mercator"),this.dataSet._set(t))}},{key:"_canvasUpdate",value:function(){var t,e,n,i,o=this.ctx;o&&(i=(t=this.map).getMapType().getProjection(),e=i.getZoomUnits?i.getZoomUnits(t.getZoom()):Math.pow(2,18-t.getZoom()),i=i.lngLatToPoint(t.getCenter()),n=new BMap.Pixel(i.x-t.getSize().width/2*e,i.y+t.getSize().height/2*e),p(o),i={fromColumn:"bd09mc"==this.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){if(t)return[(t[0]-n.x)/e,(n.y-t[1])/e]}},this.data=this.dataSet.get(i),this.processData(this.data),this.drawAnimation())}},{key:"drawAnimation",value:function(){var t=this.ctx,e=this.data;if(e){t.save(),t.globalCompositeOperation="destination-out",t.fillStyle="rgba(0, 0, 0, .1)",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.restore(),t.save(),this.options.shadowColor&&(t.shadowColor=this.options.shadowColor),this.options.shadowBlur&&(t.shadowBlur=this.options.shadowBlur),this.options.globalAlpha&&(t.globalAlpha=this.options.globalAlpha),this.options.globalCompositeOperation&&(t.globalCompositeOperation=this.options.globalCompositeOperation);for(var n,i,o,a,s=this.options,r=0;r<e.length;r++)"Point"===e[r].geometry.type?(t.beginPath(),a=e[r].size||this.options.size,i=e[r].minSize||this.options.minSize||0,void 0===e[r]._size&&(e[r]._size=i),t.arc(e[r].geometry._coordinates[0],e[r].geometry._coordinates[1],e[r]._size,0,2*Math.PI,!0),t.closePath(),e[r]._size++,e[r]._size>a&&(e[r]._size=i),t.lineWidth=1,t.strokeStyle=e[r].strokeStyle||e[r]._strokeStyle||s.strokeStyle||"yellow",t.stroke(),(a=e[r].fillStyle||e[r]._fillStyle||s.fillStyle)&&(t.fillStyle=a,t.fill())):"LineString"===e[r].geometry.type&&(t.beginPath(),n=e[r].size||this.options.size||5,i=e[r].minSize||this.options.minSize||0,void 0===e[r]._index&&(e[r]._index=0),o=e[r]._index,t.arc(e[r].geometry._coordinates[o][0],e[r].geometry._coordinates[o][1],n,0,2*Math.PI,!0),t.closePath(),e[r]._index++,e[r]._index>=e[r].geometry._coordinates.length&&(e[r]._index=0),o=e[r].strokeStyle||s.strokeStyle,a=e[r].fillStyle||s.fillStyle||"yellow",t.fillStyle=a,t.fill(),o&&s.lineWidth&&(t.lineWidth=s.lineWidth||1,t.strokeStyle=o,t.stroke()));t.restore()}}},{key:"animate",value:function(){this.drawAnimation();var t=this.options.animateTime||100;this.timeout=setTimeout(this.animate.bind(this),t)}},{key:"start",value:function(){this.stop(),this.animate()}},{key:"stop",value:function(){clearTimeout(this.timeout)}},{key:"unbindEvent",value:function(){}},{key:"hide",value:function(){this.canvasLayer.hide(),this.stop()}},{key:"show",value:function(){this.start()}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"destroy",value:function(){this.stop(),this.unbindEvent(),this.clearData(),this.map.removeOverlay(this.canvasLayer),this.canvasLayer=null}}]);var Bt=Ut;function Ut(t,e,n){l(this,Ut);var i=d(this,(Ut.__proto__||Object.getPrototypeOf(Ut)).call(this,t,e,n)),o=(i.map=t,i.options=n||{},i.dataSet=e,new ut({map:t,zIndex:i.options.zIndex,update:i._canvasUpdate.bind(i)})),a=(i.init(i.options),i.canvasLayer=o,i.transferToMercator(),i);return e.on("change",function(){a.transferToMercator(),o.draw()}),i.ctx=o.canvas.getContext("2d"),i.start(),i}v(Nt,It),e(Nt,[{key:"clickEvent",value:function(t){var e=t.pixel;o(Nt.prototype.__proto__||Object.getPrototypeOf(Nt.prototype),"clickEvent",this).call(this,e,t)}},{key:"mousemoveEvent",value:function(t){var e=t.pixel;o(Nt.prototype.__proto__||Object.getPrototypeOf(Nt.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"tapEvent",value:function(t){var e=t.pixel;o(Nt.prototype.__proto__||Object.getPrototypeOf(Nt.prototype),"tapEvent",this).call(this,e,t)}},{key:"bindEvent",value:function(t){this.unbindEvent();var e=this.map,n=0,i=this;this.options.methods&&(this.options.methods.click&&(e.setDefaultCursor("default"),e.addEventListener("click",this.clickEvent)),this.options.methods.mousemove&&e.addEventListener("mousemove",this.mousemoveEvent),"ontouchend"in window.document&&this.options.methods.tap&&(e.addEventListener("touchstart",function(t){n=new Date}),e.addEventListener("touchend",function(t){new Date-n<300&&i.tapEvent(t)})))}},{key:"unbindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&e.removeEventListener("click",this.clickEvent),this.options.methods.mousemove&&e.removeEventListener("mousemove",this.mousemoveEvent))}},{key:"transferToMercator",value:function(t){t=t||this.dataSet;var e=this.map,n=e.getMapType(),i=n.getProjection?n.getProjection():{lngLatToPoint:function(t){t=e.lnglatToMercator(t.lng,t.lat);return{x:t[0],y:t[1]}}};"bd09mc"!==this.options.coordType&&(n=t.get(),n=t.transferCoordinate(n,function(t){return t[0]<-180||180<t[0]||t[1]<-90||90<t[1]?t:[(t=i.lngLatToPoint({lng:t[0],lat:t[1]})).x,t.y]},"coordinates","coordinates_mercator"),t._set(n))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(n){if(this.canvasLayer){var e,i,t,o,a,s=this,u=s.options.animation,r=this.canvasLayer._map,h=(r.getMapType().getProjection?a=(t=r.getMapType().getProjection()).lngLatToPoint(r.getCenter()):(a={x:r.getCenter().lng,y:r.getCenter().lat},t={lngLatToPoint:function(t){t=r.lnglatToMercator(t.lng,t.lat);return{x:t[0],y:t[1]}}}),e=t.getZoomUnits?t.getZoomUnits(r.getZoom()):Math.pow(2,18-r.getZoom()),new BMap.Pixel(a.x-r.getSize().width/2*e,a.y+r.getSize().height/2*e)),l=this.getContext();if(s.isEnabledTime()){if(void 0===n)return void p(l);"2d"==this.context&&(l.save(),l.globalCompositeOperation="destination-out",l.fillStyle="rgba(0, 0, 0, .1)",l.fillRect(0,0,l.canvas.width,l.canvas.height),l.restore())}else p(l);if("2d"==this.context)for(var c in s.options)l[c]=s.options[c];else l.clear(l.COLOR_BUFFER_BIT);s.options.minZoom&&r.getZoom()<s.options.minZoom||s.options.maxZoom&&r.getZoom()>s.options.maxZoom||(i=1,"2d"!=this.context&&(i=this.canvasLayer.devicePixelRatio),t={fromColumn:"bd09mc"==s.options.coordType?"coordinates":"coordinates_mercator",transferCoordinate:function(t){return[(t[0]-h.x)/e*i,(h.y-t[1])/e*i]}},void 0!==n&&(t.filter=function(t){var e=u.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),o="cluster"===s.options.draw?(o=(a=this.map.getBounds()).getNorthEast(),a=a.getSouthWest(),a=this.supercluster.getClusters([a.lng,a.lat,o.lng,o.lat],this.getZoom()),this.clusterDataSet.set(a),this.transferToMercator(this.clusterDataSet),this.clusterDataSet.get(t)):s.dataSet.get(t),this.processData(o),a=r.pointToPixel(new BMap.Point(0,0)),"m"==s.options.unit?(s.options.size&&(s.options._size=s.options.size/e),s.options.width&&(s.options._width=s.options.width/e),s.options.height&&(s.options._height=s.options.height/e)):(s.options._size=s.options.size,s.options._height=s.options.height,s.options._width=s.options.width),this.drawContext(l,o,s.options,a),s.options.updateCallback&&s.options.updateCallback(n))}}},{key:"init",value:function(t){var e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(e.options.zIndex),e.options.max&&this.intensity.setMax(e.options.max),e.options.min&&this.intensity.setMin(e.options.min),this.initAnimator(),this.bindEvent()}},{key:"getZoom",value:function(){return this.map.getZoom()}},{key:"addAnimatorEvent",value:function(){this.map.addEventListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addEventListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer)}},{key:"hide",value:function(){this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){this.canvasLayer&&this.canvasLayer.draw()}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"destroy",value:function(){this.unbindEvent(),this.clearData(),this.map.removeOverlay(this.canvasLayer),this.canvasLayer=null}}]);var Zt=Nt;function Nt(t,e,n){l(this,Nt);var i=d(this,(Nt.__proto__||Object.getPrototypeOf(Nt)).call(this,t,e,n)),o=i,a=(n=n||{},i.clickEvent=i.clickEvent.bind(i),i.mousemoveEvent=i.mousemoveEvent.bind(i),i.tapEvent=i.tapEvent.bind(i),o.init(n),o.argCheck(n),o.transferToMercator(),i.canvasLayer=new ut({map:t,context:i.context,paneName:n.paneName,mixBlendMode:n.mixBlendMode,enableMassClear:n.enableMassClear,zIndex:n.zIndex,update:function(){o._canvasUpdate()}}));return e.on("change",function(){o.transferToMercator(),a.draw()}),i}function a(t){this.isAdded_=!1,this.isAnimated_=!1,this.paneName_=a.DEFAULT_PANE_NAME_,this.updateHandler_=null,this.resizeHandler_=null,this.topLeft_=null,this.centerListener_=null,this.resizeListener_=null,this.needsResize_=!0,this.requestAnimationFrameId_=null;var e=document.createElement("canvas");function n(t,e){return function(){e.apply(t)}}e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.pointerEvents="none",this.canvas=e,this.canvasCssWidth_=300,this.canvasCssHeight_=150,this.resolutionScale_=1,this.repositionFunction_=n(this,this.repositionCanvas_),this.resizeFunction_=n(this,this.resize_),this.requestUpdateFunction_=n(this,this.update_),t&&this.setOptions(t)}var n="undefined"==typeof window?{}:window,jt=(n.google&&n.google.maps&&(a.prototype=new google.maps.OverlayView,a.DEFAULT_PANE_NAME_="overlayLayer",a.CSS_TRANSFORM_=function(){for(var t=document.createElement("div"),e=["transform","WebkitTransform","MozTransform","OTransform","msTransform"],n=0;n<e.length;n++){var i=e[n];if(void 0!==t.style[i])return i}return e[0]}(),a.prototype.requestAnimFrame_=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||n.oRequestAnimationFrame||n.msRequestAnimationFrame||function(t){return n.setTimeout(t,1e3/60)},a.prototype.cancelAnimFrame_=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||n.oCancelAnimationFrame||n.msCancelAnimationFrame||function(t){},a.prototype.setOptions=function(t){void 0!==t.animate&&this.setAnimate(t.animate),void 0!==t.paneName&&this.setPaneName(t.paneName),void 0!==t.updateHandler&&this.setUpdateHandler(t.updateHandler),void 0!==t.resizeHandler&&this.setResizeHandler(t.resizeHandler),void 0!==t.resolutionScale&&this.setResolutionScale(t.resolutionScale),void 0!==t.map&&this.setMap(t.map)},a.prototype.setAnimate=function(t){this.isAnimated_=!!t,this.isAnimated_&&this.scheduleUpdate()},a.prototype.isAnimated=function(){return this.isAnimated_},a.prototype.setPaneName=function(t){this.paneName_=t,this.setPane_()},a.prototype.getPaneName=function(){return this.paneName_},a.prototype.setPane_=function(){if(this.isAdded_){var t=this.getPanes();if(!t[this.paneName_])throw new Error('"'+this.paneName_+'" is not a valid MapPane name.');t[this.paneName_].appendChild(this.canvas)}},a.prototype.setResizeHandler=function(t){this.resizeHandler_=t},a.prototype.setResolutionScale=function(t){"number"==typeof t&&(this.resolutionScale_=t,this.resize_())},a.prototype.setUpdateHandler=function(t){this.updateHandler_=t},a.prototype.onAdd=function(){this.isAdded_||(this.isAdded_=!0,this.setPane_(),this.resizeListener_=google.maps.event.addListener(this.getMap(),"resize",this.resizeFunction_),this.centerListener_=google.maps.event.addListener(this.getMap(),"center_changed",this.repositionFunction_),this.resize_(),this.repositionCanvas_())},a.prototype.onRemove=function(){this.isAdded_&&(this.isAdded_=!1,this.topLeft_=null,this.canvas.parentElement.removeChild(this.canvas),this.centerListener_&&(google.maps.event.removeListener(this.centerListener_),this.centerListener_=null),this.resizeListener_&&(google.maps.event.removeListener(this.resizeListener_),this.resizeListener_=null),this.requestAnimationFrameId_&&(this.cancelAnimFrame_.call(n,this.requestAnimationFrameId_),this.requestAnimationFrameId_=null))},a.prototype.resize_=function(){var t,e,n,i,o,a;this.isAdded_&&(t=(e=this.getMap()).getDiv().offsetWidth,e=e.getDiv().offsetHeight,n=t*this.resolutionScale_,i=e*this.resolutionScale_,o=this.canvas.width,a=this.canvas.height,o===n&&a===i||(this.canvas.width=n,this.canvas.height=i,this.needsResize_=!0,this.scheduleUpdate()),this.canvasCssWidth_===t&&this.canvasCssHeight_===e||(this.canvasCssWidth_=t,this.canvasCssHeight_=e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"))},a.prototype.draw=function(){this.repositionCanvas_()},a.prototype.repositionCanvas_=function(){var t=this.getMap(),e=t.getBounds().getNorthEast().lat(),n=t.getCenter(),t=Math.pow(2,t.getZoom()),t=n.lng()-180*this.canvasCssWidth_/(256*t);this.topLeft_=new google.maps.LatLng(e,t);e=this.getProjection().fromLatLngToDivPixel(n),t=-Math.round(this.canvasCssWidth_/2-e.x),n=-Math.round(this.canvasCssHeight_/2-e.y);this.canvas.style[a.CSS_TRANSFORM_]="translate("+t+"px,"+n+"px)",this.scheduleUpdate()},a.prototype.update_=function(){this.requestAnimationFrameId_=null,this.isAdded_&&(this.isAnimated_&&this.scheduleUpdate(),this.needsResize_&&this.resizeHandler_&&(this.needsResize_=!1,this.resizeHandler_()),this.updateHandler_&&this.updateHandler_())},a.prototype.getTopLeft=function(){return this.topLeft_},a.prototype.scheduleUpdate=function(){this.isAdded_&&!this.requestAnimationFrameId_&&(this.requestAnimationFrameId_=this.requestAnimFrame_.call(n,this.requestUpdateFunction_))}),v(Wt,It),e(Wt,[{key:"clickEvent",value:function(t){var e=t.pixel;o(Wt.prototype.__proto__||Object.getPrototypeOf(Wt.prototype),"clickEvent",this).call(this,e,t)}},{key:"mousemoveEvent",value:function(t){var e=t.pixel;o(Wt.prototype.__proto__||Object.getPrototypeOf(Wt.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"bindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&(e.setDefaultCursor("default"),e.addListener("click",this.clickEvent)),this.options.methods.mousemove&&e.addListener("mousemove",this.mousemoveEvent))}},{key:"unbindEvent",value:function(t){var e=this.map;this.options.methods&&(this.options.methods.click&&e.removeListener("click",this.clickEvent),this.options.methods.mousemove&&e.removeListener("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"_canvasUpdate",value:function(n){if(this.canvasLayer){var e,i,o,t,a,s=this,r=s.options.animation,h=this.getContext();if(s.isEnabledTime()){if(void 0===n)return void p(h);"2d"==this.context&&(h.save(),h.globalCompositeOperation="destination-out",h.fillStyle="rgba(0, 0, 0, .1)",h.fillRect(0,0,h.canvas.width,h.canvas.height),h.restore())}else p(h);if("2d"==this.context)for(var l in s.options)h[l]=s.options[l];else h.clear(h.COLOR_BUFFER_BIT);s.options.minZoom&&t.getZoom()<s.options.minZoom||s.options.maxZoom&&t.getZoom()>s.options.maxZoom||(i=1,"2d"!=this.context&&(i=this.canvasLayer.devicePixelRatio),t=this.map,e=t.getProjection(),i=Math.pow(2,t.zoom)*resolutionScale,o=e.fromLatLngToPoint(this.canvasLayer.getTopLeft()),t={transferCoordinate:function(t){t=new google.maps.LatLng(t[1],t[0]),t=e.fromLatLngToPoint(t);return[(t.x-o.x)*i,(t.y-o.y)*i]}},void 0!==n&&(t.filter=function(t){var e=r.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),t=s.dataSet.get(t),this.processData(t),a=new google.maps.LatLng(0,0),a={x:((a=e.fromLatLngToPoint(a)).x-o.x)*i,y:(a.y-o.y)*i},"m"==s.options.unit&&s.options.size?s.options._size=s.options.size/zoomUnit:s.options._size=s.options.size,this.drawContext(h,new C(t),s.options,a),s.options.updateCallback&&s.options.updateCallback(n))}}},{key:"init",value:function(t){this.options=t,this.initDataRange(t),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"addAnimatorEvent",value:function(){this.map.addListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addListener("moveend",this.animatorMoveendEvent.bind(this))}},{key:"show",value:function(){this.map.addOverlay(this.canvasLayer)}},{key:"hide",value:function(){this.map.removeOverlay(this.canvasLayer)}},{key:"draw",value:function(){self.canvasLayer.draw()}}]),Wt);function Wt(t,e,n){l(this,Wt);var e=d(this,(Wt.__proto__||Object.getPrototypeOf(Wt)).call(this,t,e,n)),i=e,n=(i.init(n=n||{}),i.argCheck(n),{map:t,animate:!1,updateHandler:function(){i._canvasUpdate()},resolutionScale:resolutionScale});e.canvasLayer=new a(n);return e.clickEvent=e.clickEvent.bind(e),e.mousemoveEvent=e.mousemoveEvent.bind(e),e.bindEvent(),e}var Ht=void 0;function qt(){return l(this,qt),d(this,(qt.__proto__||Object.getPrototypeOf(qt)).apply(this,arguments))}function Vt(t,e,n){l(this,Vt);t=d(this,(Vt.__proto__||Object.getPrototypeOf(Vt)).call(this,t,n));return t.options_=n,t.dataSet=e,t._initBaseLayer(n),t}"undefined"!=typeof maptalks&&(v(Vt,maptalks.Layer),e(Vt,[{key:"_initBaseLayer",value:function(t){var e=this.baseLayer=new It(null,this.dataSet,t);this.init(t),e.argCheck(t)}},{key:"clickEvent",value:function(t){var e;this.baseLayer&&(e=t.containerPoint,this.baseLayer.clickEvent(e,t.domEvent))}},{key:"mousemoveEvent",value:function(t){var e;this.baseLayer&&(e=t.containerPoint,this.baseLayer.mousemoveEvent(e,t.domEvent))}},{key:"getEvents",value:function(){return{click:this.clickEvent,mousemove:this.mousemoveEvent}}},{key:"init",value:function(t){var e=this.baseLayer;e.options=t,e.initDataRange(t),e.context=e.options.context||"2d",e.initAnimator()}},{key:"addAnimatorEvent",value:function(){this.map.addListener("movestart",this.animatorMovestartEvent.bind(this)),this.map.addListener("moveend",this.animatorMoveendEvent.bind(this))}}]),Ht=Vt,$t=maptalks.renderer.CanvasRenderer,v(qt,$t),e(qt,[{key:"needToRedraw",value:function(){return!!this.layer.baseLayer.isEnabledTime()||o(qt.prototype.__proto__||Object.getPrototypeOf(qt.prototype),"needToRedraw",this).call(this)}},{key:"draw",value:function(){var t=this.layer.baseLayer;this.canvas&&t.isEnabledTime()&&!this._shouldClear||(this.prepareCanvas(),this._shouldClear=!1),this._update(this.gl||this.context,this._mapvFrameTime),delete this._mapvFrameTime,this.completeRender()}},{key:"drawOnInteracting",value:function(){this.draw(),this._shouldClear=!1}},{key:"onSkipDrawOnInteracting",value:function(){this._shouldClear=!0}},{key:"_canvasUpdate",value:function(t){this.setToRedraw(),this._mapvFrameTime=t}},{key:"_update",value:function(t,n){if(this.canvas){var e=this.layer.baseLayer,i=e.options.animation,o=this.getMap();if(e.isEnabledTime()){if(void 0===n)return void p(t);"2d"==e.context&&(t.save(),t.globalCompositeOperation="destination-out",t.fillStyle="rgba(0, 0, 0, .1)",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.restore())}else p(t);if("2d"==e.context)for(var a in e.options)t[a]=e.options[a];else t.clear(t.COLOR_BUFFER_BIT);var s=1,r=("2d"===e.context&&"heatmap"!==e.options.draw&&(s=e.canvasLayer.devicePixelRatio),new maptalks.Coordinate(0,0)),h={fromColumn:"bd09mc"===e.options.coordType?"coordinates_mercator":"coordinates",transferCoordinate:function(t){return r.x=t[0],r.y=t[1],o.coordToContainerPoint(r)._multi(s).toArray()}},h=(void 0!==n&&(h.filter=function(t){var e=i.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),e.dataSet.get(h)),l=(e.processData(h),"m"==e.options.unit?(e.options.size&&(e.options._size=e.options.size/zoomUnit),e.options.width&&(e.options._width=e.options.width/zoomUnit),e.options.height&&(e.options._height=e.options.height/zoomUnit)):(e.options._size=e.options.size,e.options._height=e.options.height,e.options._width=e.options.width),new maptalks.Point(0,0)),l=o._pointToContainerPoint(l)._multi(s);e.drawContext(t,h,e.options,l),e.options.updateCallback&&e.options.updateCallback(n)}}},{key:"createCanvas",value:function(){var t,e,n,i;this.canvas||(e=(t=this.getMap()).getSize(),n=(i=maptalks.Browser.retina?2:1)*e.width,i=i*e.height,this.canvas=maptalks.Canvas.createCanvas(n,i,t.CanvasClass),"2d"===this.layer.baseLayer.context?(this.context=this.canvas.getContext("2d"),this.layer.options.globalCompositeOperation&&(this.context.globalCompositeOperation=this.layer.options.globalCompositeOperation)):this.gl=this.canvas.getContext("webgl",{alpha:!0,preserveDrawingBuffer:!0,antialias:!1}),this.onCanvasCreate(),this._bindToMapv(),this.layer.fire("canvascreate",{context:this.context,gl:this.gl}))}},{key:"_bindToMapv",value:function(){var t=this.layer.baseLayer;this.devicePixelRatio=maptalks.Browser.retina?2:1,t.canvasLayer=this,t._canvasUpdate=this._canvasUpdate.bind(this),t.getContext=function(){var t=self.getRenderer();return t.gl||t.context}}}]),Ht.registerRenderer("canvas",qt));var $t=Ht,Ht=(v(Yt,It),e(Yt,[{key:"init",value:function(t,e){if(!t)throw new Error("not map object");this.map=t,this.context=this.options.context||"2d",this.getCanvasLayer()}},{key:"_canvasUpdate",value:function(t){this.render(this.canvasLayer.canvas,t)}},{key:"render",value:function(t,n){if(t){var e=this.map,i=t.getContext(this.context),o=this.options.animation;if(this.isEnabledTime()){if(void 0===n)return p(i),this;"2d"===this.context&&(i.save(),i.globalCompositeOperation="destination-out",i.fillStyle="rgba(0, 0, 0, .1)",i.fillRect(0,0,i.canvas.width,i.canvas.height),i.restore())}else p(i);if("2d"===this.context)for(var a in this.options)i[a]=this.options[a];else i.clear(i.COLOR_BUFFER_BIT);t={transferCoordinate:function(t){t=e.lngLatToContainer(new AMap.LngLat(t[0],t[1]));return[t.x,t.y]}},t=(void 0!==n&&(t.filter=function(t){var e=o.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),this.dataSet.get(t));return this.processData(t),"m"===this.options.unit?(this.options.size&&(this.options._size=this.options.size/zoomUnit),this.options.width&&(this.options._width=this.options.width/zoomUnit),this.options.height&&(this.options._height=this.options.height/zoomUnit)):(this.options._size=this.options.size,this.options._height=this.options.height,this.options._width=this.options.width),this.drawContext(i,new C(t),this.options,{x:0,y:0}),this.options.updateCallback&&this.options.updateCallback(n),this}}},{key:"getCanvasLayer",value:function(){var t,e;this.canvasLayer.canvas||this.layer_||(t=this.canvasFunction(),e=this.map.getBounds(),this.layer_=new AMap.CanvasLayer({canvas:t,bounds:this.options.bounds||e,zooms:this.options.zooms||[0,22]}),this.layer_.setMap(this.map),this.map.on("mapmove",this.canvasFunction,this),this.map.on("zoomchange",this.canvasFunction,this))}},{key:"canvasFunction",value:function(){var t,e,n=[this.map.getSize().width,this.map.getSize().height],i=n[0],n=n[1];return this.canvasLayer.canvas?(this.canvasLayer.canvas.width=i,this.canvasLayer.canvas.height=n,t=this.map.getBounds(),this.layer_&&this.layer_.setBounds(this.options.bounds||t)):this.canvasLayer.canvas=(t=i,i=n,"undefined"!=typeof document?((n=document.createElement("canvas")).width=t,n.height=i,n):new e(t,i)),this.render(this.canvasLayer.canvas),this.canvasLayer.canvas}},{key:"removeLayer",value:function(){this.map&&(this.unEvents(),this.map.removeLayer(this.layer_),delete this.map,delete this.layer_,delete this.canvasLayer.canvas)}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"clickEvent",value:function(t){var e=t.pixel;o(Yt.prototype.__proto__||Object.getPrototypeOf(Yt.prototype),"clickEvent",this).call(this,e,t)}},{key:"mousemoveEvent",value:function(t){var e=t.pixel;o(Yt.prototype.__proto__||Object.getPrototypeOf(Yt.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"addAnimatorEvent",value:function(){this.map.on("movestart",this.animatorMovestartEvent,this),this.map.on("moveend",this.animatorMoveendEvent,this)}},{key:"onEvents",value:function(){var t=this.map;this.unEvents(),this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent,this),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent,this))}},{key:"unEvents",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.off("click",this.clickEvent,this),this.options.methods.mousemove&&t.off("mousemove",this.mousemoveEvent,this))}}]),Yt);function Yt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=arguments[1],n=arguments[2],e=(l(this,Yt),d(this,(Yt.__proto__||Object.getPrototypeOf(Yt)).call(this,t,e,n)));return e.options=n,e.canvasLayer={canvas:null,devicePixelRatio:window.devicePixelRatio},e.layer_=null,e.initDataRange(n),e.initAnimator(),e.onEvents(),t.on("complete",function(){this.init(t,n),this.argCheck(n)},e),e}v(Jt,It),e(Jt,[{key:"init",value:function(t,e){if(!(t&&t instanceof ol.Map))throw new Error("not map object");this.$Map=t,this.context=this.options.context||"2d",this.getCanvasLayer(),this.initDataRange(e),this.initAnimator(),this.onEvents()}},{key:"_canvasUpdate",value:function(t){this.render(this.canvasLayer.canvas,t)}},{key:"render",value:function(t,n){var e=this.$Map,i=t.getContext(this.context),o=this.options.animation,a=this.options.hasOwnProperty("projection")?this.options.projection:"EPSG:4326";if(this.isEnabledTime()){if(void 0===n)return p(i),this;"2d"===this.context&&(i.save(),i.globalCompositeOperation="destination-out",i.fillStyle="rgba(0, 0, 0, .1)",i.fillRect(0,0,i.canvas.width,i.canvas.height),i.restore())}else p(i);if("2d"===this.context)for(var s in this.options)i[s]=this.options[s];else i.clear(i.COLOR_BUFFER_BIT);t={transferCoordinate:function(t){return e.getPixelFromCoordinate(ol.proj.transform(t,a,"EPSG:4326"))}},void 0!==n&&(t.filter=function(t){var e=o.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),t=this.dataSet.get(t);return this.processData(t),"m"===this.options.unit?(this.options.size&&(this.options._size=this.options.size/zoomUnit),this.options.width&&(this.options._width=this.options.width/zoomUnit),this.options.height&&(this.options._height=this.options.height/zoomUnit)):(this.options._size=this.options.size,this.options._height=this.options.height,this.options._width=this.options.width),this.drawContext(i,new C(t),this.options,{x:0,y:0}),this.options.updateCallback&&this.options.updateCallback(n),this}},{key:"getCanvasLayer",value:function(){var t;this.canvasLayer.canvas||this.layer_||(t=this.getMapExtent(),this.layer_=new ol.layer.Image({layerName:this.options.layerName,minResolution:this.options.minResolution,maxResolution:this.options.maxResolution,zIndex:this.options.zIndex,extent:t,source:new ol.source.ImageCanvas({canvasFunction:this.canvasFunction.bind(this),projection:this.options.hasOwnProperty("projection")?this.options.projection:"EPSG:4326",ratio:this.options.hasOwnProperty("ratio")?this.options.ratio:1})}),this.$Map.addLayer(this.layer_),this.$Map.un("precompose",this.reRender,this),this.$Map.on("precompose",this.reRender,this))}},{key:"reRender",value:function(){var t;this.layer_&&(t=this.getMapExtent(),this.layer_.setExtent(t))}},{key:"canvasFunction",value:function(t,e,n,i,o){return this.canvasLayer.canvas?(this.canvasLayer.canvas.width=i[0],this.canvasLayer.canvas.height=i[1]):this.canvasLayer.canvas=function(t,e){var n;if("undefined"!=typeof document)return(n=document.createElement("canvas")).width=t,n.height=e,n}(i[0],i[1]),this.render(this.canvasLayer.canvas),this.canvasLayer.canvas}},{key:"getMapExtent",value:function(){var t=this.$Map.getSize();return this.$Map.getView().calculateExtent(t)}},{key:"addTo",value:function(t){this.init(t,this.options)}},{key:"removeLayer",value:function(){this.$Map&&(this.unEvents(),this.$Map.un("precompose",this.reRender,this),this.$Map.removeLayer(this.layer_),delete this.$Map,delete this.layer_,delete this.canvasLayer.canvas)}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"clickEvent",value:function(t){var e=t.pixel;o(Jt.prototype.__proto__||Object.getPrototypeOf(Jt.prototype),"clickEvent",this).call(this,{x:e[0],y:e[1]},t)}},{key:"mousemoveEvent",value:function(t){var e=t.pixel;o(Jt.prototype.__proto__||Object.getPrototypeOf(Jt.prototype),"mousemoveEvent",this).call(this,{x:e[0],y:e[1]},t)}},{key:"addAnimatorEvent",value:function(){this.$Map.on("movestart",this.animatorMovestartEvent,this),this.$Map.on("moveend",this.animatorMoveendEvent,this)}},{key:"onEvents",value:function(){var t=this.$Map;this.unEvents(),this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent,this),this.options.methods.mousemove&&t.on("pointermove",this.mousemoveEvent,this))}},{key:"unEvents",value:function(){var t=this.$Map;this.options.methods&&(this.options.methods.click&&t.un("click",this.clickEvent,this),this.options.methods.pointermove&&t.un("pointermove",this.mousemoveEvent,this))}},{key:"setDefaultCursor",value:function(t,e){var n;this.$Map&&(n=this.$Map.getTargetElement(),e?n.style.cursor!==t&&(this.previousCursor_=n.style.cursor,n.style.cursor=t):void 0!==this.previousCursor_&&(n.style.cursor=this.previousCursor_,this.previousCursor_=void 0))}}]);var Gt=Jt;function Jt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=arguments[1],n=arguments[2],e=(l(this,Jt),d(this,(Jt.__proto__||Object.getPrototypeOf(Jt)).call(this,t,e,n)));return e.options=n,e.canvasLayer={canvas:null,devicePixelRatio:window.devicePixelRatio},e.layer_=null,e.previousCursor_=void 0,e.init(t,n),e.argCheck(n),e}v(Kt,It),e(Kt,[{key:"clickEvent",value:function(t){var e=this.map.containerPointToLayerPoint([0,0]),n=this.devicePixelRatio=this.canvasLayer.devicePixelRatio=window.devicePixelRatio,i=t.layerPoint;o(Kt.prototype.__proto__||Object.getPrototypeOf(Kt.prototype),"clickEvent",this).call(this,L.point((i.x-e.x)/n,(i.y-e.y)/n),t)}},{key:"mousemoveEvent",value:function(t){var e=t.layerPoint;o(Kt.prototype.__proto__||Object.getPrototypeOf(Kt.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"bindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent)),this.map.on("movestart",this._moveStartEvent),this.map.on("moveend",this._moveEndEvent),this.map.on("zoomstart",this._zoomStartEvent)}},{key:"destroy",value:function(){this.unbindEvent(),this.clearData(),this.animator&&this.animator.stop(),this.animator=null,this.canvasLayer=null}},{key:"unbindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.off("click",this.clickEvent),this.options.methods.mousemove&&t.off("mousemove",this.mousemoveEvent)),this.map.off("movestart",this._moveStartEvent),this.map.off("moveend",this._moveEndEvent),this.map.off("zoomstart",this._zoomStartEvent)}},{key:"getContext",value:function(){return this.canvasLayer.getCanvas().getContext(this.context)}},{key:"addData",value:function(t,e){var n=t;t&&t.get&&(n=t.get()),this.dataSet.add(n),this.update({options:e})}},{key:"update",value:function(t){var e=(t=t||{}).data;null!=(e=e&&e.get?e.get():e)&&this.dataSet.set(e),o(Kt.prototype.__proto__||Object.getPrototypeOf(Kt.prototype),"update",this).call(this,{options:t.options})}},{key:"getData",value:function(){return this.dataSet}},{key:"removeData",value:function(e){var t;this.dataSet&&(t=this.dataSet.get({filter:function(t){return null==e||"function"!=typeof e||!e(t)}}),this.dataSet.set(t),this.update({options:null}))}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"_canvasUpdate",value:function(n){if(this.canvasLayer){var e,u,i,o,t,a,s,r=this,c=r.options.animation,h=this.getContext(),l=this.map;if(r.isEnabledTime()){if(void 0===n)return void this.clear(h);"2d"===this.context&&(h.save(),h.globalCompositeOperation="destination-out",h.fillStyle="rgba(0, 0, 0, .1)",h.fillRect(0,0,h.canvas.width,h.canvas.height),h.restore())}else this.clear(h);if("2d"===this.context)for(var p in r.options)h[p]=r.options[p];else h.clear(h.COLOR_BUFFER_BIT);r.options.minZoom&&l.getZoom()<r.options.minZoom||r.options.maxZoom&&l.getZoom()>r.options.maxZoom||(s=(t=l.getBounds()).getEast()-t.getWest(),t=t.getNorth()-t.getSouth(),a=l.getSize(),e=s/a.x,u=t/a.y,i=this.canvasLayer.getTopLeft(),o=l.latLngToContainerPoint(i),s={transferCoordinate:function(t){t="2d"===r.context?l.latLngToContainerPoint(L.latLng(t[1],t[0])):{x:(t[0]-i.lng)/e,y:(i.lat-t[1])/u};return[t.x-o.x,t.y-o.y]}},void 0!==n&&(s.filter=function(t){var e=c.trails||10;return n&&t.time>n-e&&t.time<n}),t=r.dataSet.get(s),this.processData(t),r.options._size=r.options.size,s={x:(a=l.latLngToContainerPoint(L.latLng(0,0))).x-o.x,y:a.y-o.y},this.drawContext(h,t,r.options,s),r.options.updateCallback&&r.options.updateCallback(n))}}},{key:"init",value:function(t){this.options=t,this.initDataRange(t),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"addAnimatorEvent",value:function(){}},{key:"moveStartEvent",value:function(){var t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start,this._hide())}},{key:"moveEndEvent",value:function(){this.canvasLayer.draw(),this._show()}},{key:"zoomStartEvent",value:function(){this._hide()}},{key:"clear",value:function(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}},{key:"_hide",value:function(){this.canvasLayer.canvas.style.display="none"}},{key:"_show",value:function(){this.canvasLayer.canvas.style.display="block"}},{key:"draw",value:function(){this.canvasLayer.draw()}}]);var Qt,Xt=Kt;function Kt(t,e,n,i){l(this,Kt);t=d(this,(Kt.__proto__||Object.getPrototypeOf(Kt)).call(this,t,n,i));if(!It)return d(t);n=t;return n.init(i=i||{}),n.argCheck(i),t.canvasLayer=e,t.clickEvent=t.clickEvent.bind(t),t.mousemoveEvent=t.mousemoveEvent.bind(t),t._moveStartEvent=t.moveStartEvent.bind(t),t._moveEndEvent=t.moveEndEvent.bind(t),t._zoomStartEvent=t.zoomStartEvent.bind(t),t.bindEvent(),t}"undefined"!=typeof L&&(Qt=L.Layer.extend({options:{attributionPrefix:null,attribution:""},initialize:function(t,e,n){n=n||{},this.dataSet=t||{},this.mapVOptions=e||{},this.render=this.render.bind(this),L.Util.setOptions(this,n),this.options.attributionPrefix&&(this.options.attribution=this.options.attributionPrefix+this.options.attribution),this.canvas=this._createCanvas(),L.stamp(this)},onAdd:function(t){this._map=t;var e=this.getPane(),e=this.container=L.DomUtil.create("div","leaflet-layer leaflet-zoom-animated",e),n=(e.appendChild(this.canvas),t.getSize());e.style.width=n.x+"px",e.style.height=n.y+"px",this.renderer=new Xt(t,this,this.dataSet,this.mapVOptions),this.draw(),this.fire("loaded")},onRemove:function(){L.DomUtil.remove(this.container),this.renderer.destroy()},addData:function(t,e){this.renderer.addData(t,e)},update:function(t){this.renderer.update(t)},getData:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet},removeData:function(t){this.renderer&&this.renderer.removeData(t)},clearData:function(){this.renderer.clearData()},draw:function(){return this._reset()},setZIndex:function(t){this.canvas.style.zIndex=t},render:function(){this.renderer._canvasUpdate()},getCanvas:function(){return this.canvas},getContainer:function(){return this.container},getTopLeft:function(){var t,e=this._map;return t=e?e.getBounds().getNorthWest():t},_createCanvas:function(){var t=document.createElement("canvas"),e=(t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=this.options.zIndex||600,"undefined"==typeof window?{}:window),e=this.devicePixelRatio=e.devicePixelRatio;return this.mapVOptions.context&&"2d"!==this.mapVOptions.context||t.getContext("2d").scale(e,e),t},_resize:function(){var t,e,n=this.canvas;n&&(t=(e=this._map).getSize(),n.width=t.x,n.height=t.y,n.style.width=t.x+"px",n.style.height=t.y+"px",t=e.getBounds(),e=e.latLngToLayerPoint(t.getNorthWest()),L.DomUtil.setPosition(n,e))},_reset:function(){this._resize(),this._render()},redraw:function(){this._resize(),this._render()},_render:function(){this.render()}}),ne=function(t,e,n){return new Qt(t,e,n)});v(oe,It),e(oe,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"clickEvent",value:function(t){var e=t.point;o(oe.prototype.__proto__||Object.getPrototypeOf(oe.prototype),"clickEvent",this).call(this,e,t)}},{key:"mousemoveEvent",value:function(t){var e=t.point;o(oe.prototype.__proto__||Object.getPrototypeOf(oe.prototype),"mousemoveEvent",this).call(this,e,t)}},{key:"addAnimatorEvent",value:function(){}},{key:"animatorMovestartEvent",value:function(){var t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start)}},{key:"animatorMoveendEvent",value:function(){this.isEnabledTime()&&this.animator}},{key:"bindEvent",value:function(){this.map,this.options.methods&&(this.options.methods.click,this.options.methods.mousemove)}},{key:"unbindEvent",value:function(){var t=this.map;this.options.methods&&(this.options.methods.click&&t.off("click",this.clickEvent),this.options.methods.mousemove&&t.off("mousemove",this.mousemoveEvent))}},{key:"getContext",value:function(){return this.canvasLayer.canvas.getContext(this.context)}},{key:"init",value:function(t){this.options=t,this.initDataRange(t),this.context=this.options.context||"2d",this.options.zIndex&&this.canvasLayer&&this.canvasLayer.setZIndex(this.options.zIndex),this.initAnimator()}},{key:"_canvasUpdate",value:function(n){this.map;var e=this.scene,i=DC.Namespace.Cesium;if(this.canvasLayer&&!this.stopAniamation){var o=this.options.animation,t=this.getContext();if(this.isEnabledTime()){if(void 0===n)return void this.clear(t);"2d"===this.context&&(t.save(),t.globalCompositeOperation="destination-out",t.fillStyle="rgba(0, 0, 0, .1)",t.fillRect(0,0,t.canvas.width,t.canvas.height),t.restore())}else this.clear(t);if("2d"===this.context)for(var a in this.options)t[a]=this.options[a];else t.clear(t.COLOR_BUFFER_BIT);var s={transferCoordinate:function(t){t=i.Cartesian3.fromDegrees(t[0],t[1]),t=i.SceneTransforms.wgs84ToWindowCoordinates(e,t);return null==t?[-1,-1]:[t.x,t.y]}},s=(void 0!==n&&(s.filter=function(t){var e=o.trails||10;return!!(n&&t.time>n-e&&t.time<n)}),this.dataSet.get(s)),r=(this.processData(s),"m"==this.options.unit&&this.options.size,this.options._size=this.options.size,i.SceneTransforms.wgs84ToWindowCoordinates(e,i.Cartesian3.fromDegrees(0,0)));this.drawContext(t,new C(s),this.options,r),this.options.updateCallback&&this.options.updateCallback(n)}}},{key:"updateData",value:function(t,e){null!=(t=t&&t.get?t.get():t)&&this.dataSet.set(t),o(oe.prototype.__proto__||Object.getPrototypeOf(oe.prototype),"update",this).call(this,{options:e})}},{key:"addData",value:function(t,e){var n=t;t&&t.get&&(n=t.get()),this.dataSet.add(n),this.update({options:e})}},{key:"getData",value:function(){return this.dataSet}},{key:"removeData",value:function(e){var t;this.dataSet&&(t=this.dataSet.get({filter:function(t){return null==e||"function"!=typeof e||!e(t)}}),this.dataSet.set(t),this.update({options:null}))}},{key:"clearData",value:function(){this.dataSet&&this.dataSet.clear(),this.update({options:null})}},{key:"draw",value:function(){this.canvasLayer.draw()}},{key:"clear",value:function(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}}]);var te,ee,ne,ie=oe;function oe(t,e,n,i){l(this,oe);var o=d(this,(oe.__proto__||Object.getPrototypeOf(oe)).call(this,t,e,n));return It?(o.map=t,o.scene=t.scene,o.dataSet=e,o.init(n=n||{}),o.argCheck(n),o.initDevicePixelRatio(),o.canvasLayer=i,o.stopAniamation=!1,o.animation=n.animation,o.clickEvent=o.clickEvent.bind(o),o.mousemoveEvent=o.mousemoveEvent.bind(o),o.bindEvent(),o):d(o)}function ae(t,e,n,i){l(this,ae),this.map=t,this.scene=t.scene,this.mapvBaseLayer=new ie(t,e,n,this),this.mapVOptions=n,this.initDevicePixelRatio(),this.canvas=this._createCanvas(),this.render=this.render.bind(this),i?this.container=i:(e=t.container.querySelector(".cesium-viewer-cesiumWidgetContainer"),this.container=e||t.container),this.addInnerContainer(),this.bindEvent(),this._reset()}"undefined"!=typeof DC&&(te=0,DC.Namespace.Cesium,e(ae,[{key:"initDevicePixelRatio",value:function(){this.devicePixelRatio=window.devicePixelRatio||1}},{key:"addInnerContainer",value:function(){this.container.appendChild(this.canvas)}},{key:"bindEvent",value:function(){var e=this,t=DC.Namespace.Cesium,n=(this.innerMoveStart=this.moveStartEvent.bind(this),this.innerMoveEnd=this.moveEndEvent.bind(this),this.scene.camera.moveStart.addEventListener(this.innerMoveStart,this),this.scene.camera.moveEnd.addEventListener(this.innerMoveEnd,this),new t.ScreenSpaceEventHandler(this.scene.canvas));n.setInputAction(function(t){e.innerMoveEnd()},t.ScreenSpaceEventType.LEFT_UP),n.setInputAction(function(t){e.innerMoveEnd()},t.ScreenSpaceEventType.MIDDLE_UP),this.handler=n}},{key:"unbindEvent",value:function(){this.scene.camera.moveStart.removeEventListener(this.innerMoveStart,this),this.scene.camera.moveEnd.removeEventListener(this.innerMoveEnd,this),this.scene.postRender.removeEventListener(this._reset,this),this.handler&&(this.handler.destroy(),this.handler=null)}},{key:"moveStartEvent",value:function(){this.mapvBaseLayer&&(this.mapvBaseLayer.animatorMovestartEvent(),this.scene.postRender.addEventListener(this._reset,this))}},{key:"moveEndEvent",value:function(){this.mapvBaseLayer&&(this.scene.postRender.removeEventListener(this._reset,this),this.mapvBaseLayer.animatorMoveendEvent(),this._reset())}},{key:"zoomStartEvent",value:function(){this._unvisiable()}},{key:"zoomEndEvent",value:function(){this._unvisiable()}},{key:"addData",value:function(t,e){null!=this.mapvBaseLayer&&this.mapvBaseLayer.addData(t,e)}},{key:"updateData",value:function(t,e){null!=this.mapvBaseLayer&&this.mapvBaseLayer.updateData(t,e)}},{key:"getData",value:function(){return this.mapvBaseLayer&&(this.dataSet=this.mapvBaseLayer.getData()),this.dataSet}},{key:"removeData",value:function(t){null!=this.mapvBaseLayer&&this.mapvBaseLayer&&this.mapvBaseLayer.removeData(t)}},{key:"removeAllData",value:function(){null!=this.mapvBaseLayer&&this.mapvBaseLayer.clearData()}},{key:"_visiable",value:function(){return this.canvas.style.display="block",this}},{key:"_unvisiable",value:function(){return this.canvas.style.display="none",this}},{key:"_createCanvas",value:function(){var t=document.createElement("canvas"),e=(t.id=this.mapVOptions.layerid||"mapv"+te++,t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=this.mapVOptions.zIndex||0,t.width=parseInt(this.map.canvas.width),t.height=parseInt(this.map.canvas.height),t.style.width=this.map.canvas.style.width,t.style.height=this.map.canvas.style.height,this.devicePixelRatio);return"2d"==this.mapVOptions.context&&t.getContext(this.mapVOptions.context).scale(e,e),t}},{key:"_reset",value:function(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()}},{key:"draw",value:function(){this._reset()}},{key:"show",value:function(){this._visiable()}},{key:"hide",value:function(){this._unvisiable()}},{key:"destroy",value:function(){this.remove()}},{key:"remove",value:function(){null!=this.mapvBaseLayer&&(this.removeAllData(),this.mapvBaseLayer.clear(this.mapvBaseLayer.getContext()),this.mapvBaseLayer=void 0,this.canvas.parentElement.removeChild(this.canvas))}},{key:"update",value:function(t){null!=t&&this.updateData(t.data,t.options)}},{key:"resizeCanvas",value:function(){var t;null!=this.canvas&&null!=this.canvas&&((t=this.canvas).style.position="absolute",t.style.top="0px",t.style.left="0px",t.width=parseInt(this.map.canvas.width),t.height=parseInt(this.map.canvas.height),t.style.width=this.map.canvas.style.width,t.style.height=this.map.canvas.style.height)}},{key:"fixPosition",value:function(){}},{key:"onResize",value:function(){}},{key:"render",value:function(){null!=this.mapvBaseLayer&&this.mapvBaseLayer._canvasUpdate()}}]),ee=ae,se=function(t,e,n,i){return new ee(t,e,n,i)});var e=se,se={getDataSet:function(t){var e=[],n=t.features;if(n)for(var i=0;i<n.length;i++){var o,a=n[i],s=a.geometry,r=a.properties,h={};for(o in r)h[o]=r[o];h.geometry=s,e.push(h)}return new C(e)}},re={CSVToArray:function(t,e){e=e||",";for(var n=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),i=[[]],o=null;o=n.exec(t);){var a=o[1];a.length&&a!==e&&i.push([]),a=o[2]?o[2].replace(new RegExp('""',"g"),'"'):o[3],i[i.length-1].push(a)}return i},getDataSet:function(t,e){for(var n=this.CSVToArray(t,e||","),i=[],o=n[0],a=1;a<n.length-1;a++){for(var s=n[a],r={},h=0;h<s.length;h++){var l=s[h];"geometry"==o[h]&&(l=JSON.parse(l)),r[o[h]]=l}i.push(r)}return new C(i)}};t.version="2.0.51",t.canvasClear=p,t.canvasResolutionScale=function(t){var e=window.devicePixelRatio||1;t.canvas.width=t.canvas.width*e,t.canvas.height=t.canvas.height*e,t.canvas.style.width=t.canvas.width/e+"px",t.canvas.style.height=t.canvas.height/e+"px",t.scale(e,e)},t.canvasDrawSimple=y,t.canvasDrawHeatmap=k,t.canvasDrawGrid=E,t.canvasDrawHoneycomb=z,t.webglDrawSimple=ot,t.webglDrawPoint=U,t.webglDrawLine=I,t.webglDrawPolygon=it,t.utilCityCenter=u,t.utilCurve=at,t.utilForceEdgeBundling=function(){var c={},p=[],v=[],d=[],g=.1,f=.1,_=1,n=2,y=6,w=70,b=.6666667,o=.6,r=1e-8;function a(t){return{x:c[t.target].x-c[t.source].x,y:c[t.target].y-c[t.source].y}}function m(t){return Math.sqrt(Math.pow(c[t.source].x-c[t.target].x,2)+Math.pow(c[t.source].y-c[t.target].y,2))}function x(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function s(t,e){var n=Math.sqrt((e.target.x-e.source.x)*(e.target.x-e.source.x)+(e.target.y-e.source.y)*(e.target.y-e.source.y)),t=((e.source.y-t.y)*(e.source.y-e.target.y)-(e.source.x-t.x)*(e.target.x-e.source.x))/(n*n);return{x:e.source.x+t*(e.target.x-e.source.x),y:e.source.y+t*(e.target.y-e.source.y)}}function k(t,e){for(var n={x:0,y:0},i=v[t],o=0;o<i.length;o++){var a,s={x:d[i[o]][e].x-d[t][e].x,y:d[i[o]][e].y-d[t][e].y};(Math.abs(s.x)>r||Math.abs(s.y)>r)&&(a=1/Math.pow((a={source:d[i[o]][e],target:d[t][e]},Math.sqrt(Math.pow(a.source.x-a.target.x,2)+Math.pow(a.source.y-a.target.y,2))),1),n.x+=s.x*a,n.y+=s.y*a)}return n}function E(t,e,n){for(var i,o,u=g/(m(p[t])*(e+1)),a=[{x:0,y:0}],s=1;s<e+1;s++){var r={x:0,y:0},h=(i=s,o=h=o=void 0,o=d[l=t][i-1],h=d[l][i+1],l=d[l][i],i=o.x-l.x+h.x-l.x,o=o.y-l.y+h.y-l.y,{x:i*=u,y:o*=u}),l=k(t,s);r.x=n*(h.x+l.x),r.y=n*(h.y+l.y),a.push(r)}return a.push({x:0,y:0}),a}function L(t){for(var e,n=0;n<p.length;n++)if(1==t)d[n].push(c[p[n].source]),d[n].push((e=p[n],{x:(c[e.source].x+c[e.target].x)/2,y:(c[e.source].y+c[e.target].y)/2})),d[n].push(c[p[n].target]);else{var i=function(t){for(var e=0,n=1;n<d[t].length;n++)e+=x(d[t][n],d[t][n-1]);return e}(n)/(t+1),o=i,a=[];a.push(c[p[n].source]);for(var s=1;s<d[n].length;s++){for(var r=x(d[n][s],d[n][s-1]);o<r;){var h=o/r,l=d[n][s-1].x,u=d[n][s-1].y;l+=h*(d[n][s].x-d[n][s-1].x),u+=h*(d[n][s].y-d[n][s-1].y),a.push({x:l,y:u}),r-=o,o=i}o-=r}a.push(c[p[n].target]),d[n]=a}}function h(t,e){var n=s(c[e.source],{source:c[t.source],target:c[t.target]}),e=s(c[e.target],{source:c[t.source],target:c[t.target]}),i={x:(n.x+e.x)/2,y:(n.y+e.y)/2},t={x:(c[t.source].x+c[t.target].x)/2,y:(c[t.source].y+c[t.target].y)/2};return Math.max(0,1-2*x(t,i)/x(n,e))}function l(t,e){var n,i,o;return n=e,Math.abs((i=a(t),o=a(n),(i.x*o.x+i.y*o.y)/(m(t)*m(n))))*(i=e,2/((n=(m(o=t)+m(i))/2)/Math.min(m(o),m(i))+Math.max(m(o),m(i))/n))*(o=e,(n=(m(i=t)+m(o))/2)/(n+x({x:(c[i.source].x+c[i.target].x)/2,y:(c[i.source].y+c[i.target].y)/2},{x:(c[o.source].x+c[o.target].x)/2,y:(c[o.source].y+c[o.target].y)/2})))*(n=t,i=e,Math.min(h(n,i),h(i,n)))}function S(){for(var t,e,n=0;n<p.length-1;n++)for(var i=n+1;i<p.length;i++)n!=i&&(t=p[n],e=p[i],l(t,e)>=o&&(v[n].push(i),v[i].push(n)))}function e(){for(var t=f,e=w,n=_,i=0;i<p.length;i++)1==_?d[i]=[]:(d[i]=[],d[i].push(c[p[i].source]),d[i].push(c[p[i].target]));for(var o=0;o<p.length;o++)v[o]=[];L(n),S();for(var a=0;a<y;a++){for(var u=0;u<e;u++){for(var s=[],r=0;r<p.length;r++)s[r]=E(r,n,t);for(var h=0;h<p.length;h++)for(var l=0;l<n+1;l++)d[h][l].x+=s[h][l].x,d[h][l].y+=s[h][l].y}t/=2,e*=b,L(n*=2)}return d}return e.nodes=function(t){return 0==arguments.length?c:(c=t,e)},e.edges=function(t){return 0==arguments.length?p:(p=function(t){for(var e=[],n=0;n<t.length;n++)c[t[n].source].x!=c[t[n].target].x&&c[t[n].source].y!=c[t[n].target].y&&e.push(t[n]);return e}(t),e)},e.bundling_stiffness=function(t){return 0==arguments.length?g:(g=t,e)},e.step_size=function(t){return 0==arguments.length?f:(f=t,e)},e.cycles=function(t){return 0==arguments.length?y:(y=t,e)},e.iterations=function(t){return 0==arguments.length?w:(w=t,e)},e.iterations_rate=function(t){return 0==arguments.length?b:(b=t,e)},e.subdivision_points_seed=function(t){return 0==arguments.length?P:(P=t,e)},e.subdivision_rate=function(t){return 0==arguments.length?n:(n=t,e)},e.compatbility_threshold=function(t){return 0==arguments.length?compatbility_threshold:(o=t,e)},e},t.utilDataRangeIntensity=M,t.utilDataRangeCategory=st,t.utilDataRangeChoropleth=rt,t.Map=ht,t.baiduMapCanvasLayer=ut,t.baiduMapAnimationLayer=Bt,t.baiduMapLayer=Zt,t.googleMapCanvasLayer=a,t.googleMapLayer=jt,t.MaptalksLayer=$t,t.AMapLayer=Ht,t.OpenlayersLayer=Gt,t.leafletMapLayer=ne,t.cesiumMapLayer=e,t.DataSet=C,t.geojson=se,t.csv=re,Object.defineProperty(t,"__esModule",{value:!0})});