T.Tool=T.Kr.extend({includes:T.iQ.OQ}),T.drawVersion="4.0",T.Tool=T.Kr.extend({includes:T.iQ.OQ}),T.aO={},T.aO.Feature=T.Tool.extend({includes:T.iQ.OQ,initialize:function(t,i){this.jE=t,this.Ow=t.Ow,this.SO=t.aw.overlayPane,i&&i.sO&&(i.sO=T.S.extend({},this.options.sO,i.sO)),T.setOptions(this,i)},enable:function(){this.eU||(this.wQ("aE",{handler:this.type}),this.jE.wQ("draw:drawstart",{layerType:this.type}),T.Tool.prototype.enable.call(this))},disable:function(){this.eU&&(T.Tool.prototype.disable.call(this),this.jE.wQ("draw:drawstop",{layerType:this.type}),this.wQ("disabled",{handler:this.type}))},oU:function(){var t=this.jE;t&&(T._Q.Oq(),T.oq.on(this.Ow,"keyup",this.DO,this))},Ar:function(){this.jE&&(T._Q.Pq(),T.oq.off(this.Ow,"keyup",this.DO,this))},setOptions:function(t){T.setOptions(this,t)},dO:function(t){this.jE.wQ("draw:created",{layer:t,layerType:this.type})},DO:function(t){27===t.keyCode&&this.disable()}}),T.aO.Polyline=T.aO.Feature.extend({v:{TYPE:"polyline",FO:1e3},Poly:T.Polyline,options:{fO:!0,GO:!1,gO:{color:"#b00b00",eO:2500},icon:new T.DivIcon({iconSize:[11,11]}),HO:5,hO:4e3,sO:{stroke:!0,color:"#0000FF",weight:3,opacity:.5,fill:!1,JO:!0},KI:!0,jO:!0,zIndexOffset:2e3},initialize:function(t,i){i&&i.gO&&(i.gO=T.S.extend({},this.options.gO,i.gO)),this.type=T.aO.Polyline.TYPE,T.aO.Feature.prototype.initialize.call(this,t,i)},oU:function(){if(this.KO=!0,this.kO=this.jE.bU.eU,this.jE.disableDoubleClickZoom(),T.aO.Feature.prototype.oU.call(this),this.jE){this.LO=[],this.lO||(this.lO=new T.fT),this.jE.addLayer(this.lO);var t=this.lO,i=this.jE;this.jE.on("layerremove",function(e){t&&t.hasLayer(e.layer)&&(t.removeLayer(e.layer),e.layer.ZO&&(e.layer.ZO.bE(function(t){t.label&&t.label.onRemove(i)}),e.layer.ZO.clearLayers(),e.layer.ZO.Qq()))}),this.ZO=new T.LayerGroup,this.jE.addLayer(this.ZO),this.CO=new this.Poly([],this.options.sO),this.VO||(this.VO=T.kr(this.jE.getCenter(),{icon:T.Lr({className:"tdt-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:6e3})),!T.oQ.ie&&T.oQ.touch&&T.oQ.mobile?(this.jE.on("touchstart",this._ontouchstart,this),this.jE.on("longpress",this._onlongpress,this),this.jE.on("touchend",this._ontouchend,this),this.jE.on("move",this._onmoveStart,this),this.jE.on("moveend",this._onmoveEnd,this)):(this.VO.on("mousedown",this.nu,this).addTo(this.jE),this.jE.on("mousemove",this.PY,this),this.jE.on("mouseup",this.cO,this),this.jE.on("dblclick ",this.BO,this)),this.jE.on("zoomend",this.hU,this)}},Ar:function(){T.aO.Feature.prototype.Ar.call(this),!T.oQ.ie&&T.oQ.touch&&T.oQ.mobile?(this.jE.off("touchstart",this._ontouchstart,this),this.jE.off("longpress",this._onlongpress,this),this.jE.off("touchend",this._ontouchend,this),this.jE.off("move",this._onmoveStart,this),this.jE.off("moveend",this._onmoveEnd,this)):(this.VO&&(this.VO.off("mousedown",this.nu,this),this.VO.off("mouseup",this.mu,this),this.jE.removeLayer(this.VO),delete this.VO),this.jE.off("mousemove",this.PY,this),this.jE.off("zoomend",this.hU,this),this.vO()),this.jE.removeLayer(this.CO),delete this.CO,this.kO&&this.jE.enableDoubleClickZoom()},NO:function(t){var i=this.jE;this.lO&&this.lO.hasLayer(t.layer)&&(this.lO.removeLayer(t.layer),t.layer.ZO&&(t.layer.ZO.bE(function(t){t.label&&t.label.onRemove(i)}),t.layer.ZO.clearLayers(),t.layer.ZO.Qq()))},bO:function(){if(!(this.LO.length<=1)){var t=this.LO.pop(),i=this.CO,e=this.CO.MO(i.Ht().length-1,1)[0];this.ZO.removeLayer(t),(i instanceof T.Polygon&&i.Ht()&&i.Ht()[0]&&i.Ht()[0].length<2||i.Ht().length<2)&&this.jE.removeLayer(i),this.nO(e,!1)}},_O:function(t){this.LO.length;poly=this.CO,this.LO.push(this.mO(t)),poly.Zt(t),(poly instanceof T.Polygon&&poly.Ht()&&poly.Ht()[0]&&2==poly.Ht()[0].length||2==poly.Ht().length)&&this.jE.addLayer(this.CO),this.nO(t,!0)},Qo:function(){if(this.CO){if(this.CO instanceof T.Polygon)var t=this.CO.Ht()[0][0];else t=this.CO.Ht()[0];var i=this.CO.qo(t,!0);if(!this.options.fO&&i||!this.Wo())return this.disable(),void(this._mouselabel&&this._mouselabel.Qq());this.dO(),this.disable()}},Wo:function(){return!0},hU:function(){this.wo()},PY:function(t){var i=(t.layerPoint,t.lnglat);this.Eo=i,this.wo(i),this.VO.sr(i),this._mouselabel&&this._mouselabel.sr&&this._mouselabel.sr(i),T.oq.preventDefault(t.originalEvent)},nO:function(t,i){this.eo(),this.Ro(t,i),this.vO()},_ontouchstart:function(t){this.ro=t.containerPoint},_onlongpress:function(t){this.ismoving||(this.mu(t),this.endDraw())},_ontouchend:function(t){this.mu(t)},_onmoveStart:function(t){this._moveStartCenter=this.jE.getCenter(),this.ismoving=!0},_onmoveEnd:function(t){var i=this,e=this.jE.getCenter(),s=this.jE.lngLatToContainerPoint(this._moveStartCenter),n=this.jE.lngLatToContainerPoint(e),o=s.sQ(n);setTimeout(function(){o.x<10&&o.y<10&&(i.ismoving=!1)},301)},nu:function(t){this.vO();var i=t.originalEvent;this.ro=T.SQ(i.clientX,i.clientY)},mu:function(t){if(this.CO)if(this.ro){var i=T.SQ(t.containerPoint.x,t.containerPoint.y);t.To||(t.To=i?i:t.containerPoint);var e=t.To.distanceTo(this.ro);Math.abs(e)<9*(window.PQ||1)&&this._O(t.lnglat),this.ro=null}else this.ro=t.containerPoint},eo:function(){this.LO.length},mO:function(t){var i=new T.Marker(t,{icon:this.options.icon,zIndexOffset:T.aO.Polyline.FO++});return this.to?i.setOpacity(1):i.setOpacity(0),this.ZO.addLayer(i),i},Yo:function(t){var i={};for(var e in t)i[e]="object"==typeof t[e]?this.Yo(t[e]):t[e];return i},wo:function(t){if(t){var i=this.LO.length;this.Uo||(this.Uo=new T.LayerGroup,this.jE.addLayer(this.Uo));var e=this.Yo(this.options.sO);if(e.lineStyle="dashed",i>0){if(t=t||this.Eo,this.Uo.getLayers().length<1){var s=new T.Polyline([this.LO[i-1].PE(),t],e);this.Uo.addLayer(s)}else this.Uo.getLayers()[0].Jt([this.LO[i-1].PE(),t]);if(this.CO instanceof T.Polygon&&i>1)if(this.Uo.getLayers().length<2){var s=new T.Polyline([this.LO[0].PE(),t],e);this.Uo.addLayer(s)}else this.Uo.getLayers()[1].Jt([this.LO[0].PE(),t])}}},vO:function(){if(this.uo)for(;this.uo.firstChild;)this.uo.removeChild(this.uo.firstChild);this.Uo&&this.Uo.getLayers().length>0&&this.Uo.clearLayers()},Io:function(t,i){var e,s,n,o=Math.floor(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))),h=this.options.HO,r=this.options.hO,a=o>r?o-r:h;for(this.uo||(this.uo=T._Q.s("div","tdt-draw-guides",this.SO));a1&&this.LO[this.LO.length-1].off("click",this.Qo,this)},dO:function(){var t=new this.Poly(this.CO.Ht(),this.options.sO);T.aO.Feature.prototype.dO.call(this,t),this.KO=!1}}),T.aO.Polygon=T.aO.Polyline.extend({v:{TYPE:"polygon"},Poly:T.Polygon,options:{So:!1,sO:{stroke:!0,color:"#0000FF",weight:3,opacity:.5,fill:!0,fillColor:"#0000FF",fillOpacity:.2,JO:!0}},initialize:function(t,i){T.aO.Polyline.prototype.initialize.call(this,t,i),this.type=T.aO.Polygon.TYPE},oU:function(){T.aO.Feature.prototype.oU.call(this),this.jE&&(this.LO=[],this.ZO=new T.LayerGroup,this.jE.addLayer(this.ZO),this.CO=new T.Polygon([],this.options.sO),this.VO||(this.VO=T.kr(this.jE.getCenter(),{icon:T.Lr({className:"tdt-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:6001})),!T.oQ.ie&&T.oQ.touch&&T.oQ.mobile?(this.jE.on("touchstart",this._ontouchstart,this),this.jE.on("longpress",this._onlongpress,this),this.jE.on("touchend",this._ontouchend,this),this.jE.on("move",this._onmoveStart,this),this.jE.on("moveend",this._onmoveEnd,this)):(this.VO.on("mousedown",this.nu,this).addTo(this.jE),this.jE.on("mousemove",this.PY,this).on("zoomend",this.hU,this),this.jE.on("mouseup",this.cO,this),this.jE.on("dblclick ",this.BO,this)))},eo:function(){this.LO.length},Oo:function(){var t=this.so;return t?T.Po.Do(t,this.options.KI):null},Wo:function(){return this.LO.length>=3},nO:function(t,i){var e;!this.options.fO&&this.options.So&&(e=this.CO.Ht(),this.so=T.Po.Fo(e)),T.aO.Polyline.prototype.nO.call(this,t,i)},ao:function(){var t=this.LO.length;t>0&&(this.LO[0].off("click",this.Qo,this),t>2&&this.LO[t-1].off("dblclick",this.Qo,this))}}),T.aO.fo=T.aO.Feature.extend({options:{GO:!1},initialize:function(t,i){T.aO.Feature.prototype.initialize.call(this,t,i)},oU:function(){T.aO.Feature.prototype.oU.call(this),this.jE&&(this.Go=this.jE.AE.aE(),this.Go&&this.jE.AE.disable(),this.Ow.style.cursor="crosshair",this.jE.on("mousedown",this.nu,this).on("mousemove",this.PY,this))},Ar:function(){T.aO.Feature.prototype.Ar.call(this),this.jE&&(this.Go&&this.jE.AE.enable(),this.Ow.style.cursor="",this.jE.off("mousedown",this.nu,this).off("mousemove",this.PY,this),T.oq.off(document,"mouseup",this.mu,this),this.go&&(this.jE.removeLayer(this.go),delete this.go)),this.Ho=!1},nu:function(t){this.Ho=!0,this.lu=t.lnglat,T.oq.on(document,"mouseup",this.mu,this).preventDefault(t.originalEvent)},PY:function(t){var i=t.lnglat;this.Ho&&this.ho(i)},mu:function(){this.go&&this.dO(),this.disable(),this.options.GO&&this.enable()}}),T.aO.Rectangle=T.aO.fo.extend({v:{TYPE:"rectangle"},options:{sO:{stroke:!0,color:"#0000FF",weight:3,opacity:.5,fill:!0,fillColor:"#0000FF",fillOpacity:.2,JO:!0}},initialize:function(t,i){this.type=T.aO.Rectangle.TYPE,T.aO.fo.prototype.initialize.call(this,t,i)},ho:function(t){this.go?this.go.setBounds(new T.Kq(this.lu,t)):(this.go=new T.Rectangle(new T.Kq(this.lu,t),this.options.sO),this.jE.addLayer(this.go))},dO:function(){var t=new T.Rectangle(this.go.getBounds(),this.options.sO);T.aO.fo.prototype.dO.call(this,t)}}),T.aO.Circle=T.aO.fo.extend({v:{TYPE:"circle"},options:{sO:{stroke:!0,color:"#0000FF",weight:3,opacity:.5,fill:!0,fillColor:"#0000FF",fillOpacity:.2,JO:!0},showRadius:!0,KI:!0},initialize:function(t,i){this.type=T.aO.Circle.TYPE,T.aO.fo.prototype.initialize.call(this,t,i)},ho:function(t){this.go?this.go.setRadius(this.lu.distanceTo(t)):(this.go=new T.Circle(this.lu,this.lu.distanceTo(t),this.options.sO),this.jE.addLayer(this.go))},dO:function(){var t=new T.Circle(this.lu,this.go.getRadius(),this.options.sO);T.aO.fo.prototype.dO.call(this,t)},PY:function(t){var i,e=t.lnglat;this.options.showRadius,this.options.KI;this.Ho&&(this.ho(e),i=this.go.getRadius().toFixed(1))}}),T.Icon.DrawDefault=T.Icon.extend({options:{iconSize:[25,41],iconAnchor:[11,40],popupAnchor:[1,-41],shadowSize:[41,41]},tr:function(t){var i=t+"Url";if(this.options[i])return this.options[i];var e=T.Icon.Default.imagePath;return e+"/marker-"+t+(T.oQ.retina&&"icon"===t?"-2x":"")+".png"}}),T.aO.Marker=T.aO.Feature.extend({v:{TYPE:"marker"},options:{icon:new T.Icon.DrawDefault,GO:!1,zIndexOffset:2e3},initialize:function(t,i){this.type=T.aO.Marker.TYPE,T.aO.Feature.prototype.initialize.call(this,t,i)},oU:function(){if(T.aO.Feature.prototype.oU.call(this),this.jE.getContainer().style.cursor="pointer",this.jE)if(!T.oQ.ie&&T.oQ.touch&&T.oQ.mobile)this.jE.on("touchend",this.pY,this);else{if(!this.VO){var t=T.Lr({className:".tdt-mouse-marker-m",iconAnchor:[20,20],iconSize:[40,40]});this.VO=T.kr(this.jE.getCenter(),{icon:t,opacity:0,zIndexOffset:this.options.zIndexOffset})}this.VO.on("click",this.pY,this).addTo(this.jE),this._mouselabel=new T.Label({text:this.text?this.text:"点击标注",position:new T.dq(-1e4,-1e4),Jo:[20,-9],className:"tdt-label-m ",zIndex:4999}).addTo(this.jE),this.jE.on("mousemove",this.PY,this)}},Ar:function(){T.aO.Feature.prototype.Ar.call(this),this.jE&&(T.oQ.touch&&T.oQ.mobile?this.jE.off("touchend",this.pY,this):(this.jE.getContainer().style.cursor="",this._mouselabel.Qq(),this.II&&(this.II.off("click",this.pY,this),this.jE.off("click",this.pY,this).removeLayer(this.II),delete this.II),this.VO.off("click",this.pY,this),this.jE.removeLayer(this.VO),delete this.VO,this.jE.off("mousemove",this.PY,this)))},PY:function(t){var i=t.lnglat;this.VO.sr(i),!T.oQ.ie&&T.oQ.touch&&T.oQ.mobile||this._mouselabel.sr(i),this.II?(i=this.VO.PE(),this.II.sr(i)):(this.II=new T.Marker(i,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset-1}),this.II.on("click",this.pY,this),this.II.setOpacity(0),this.jE.on("click",this.pY,this).addLayer(this.II)),this.follow&&this.II.setOpacity(1)},pY:function(t){this.dO(t),this.disable()},dO:function(t){var i=new T.Marker(this.II.PE(),{icon:this.options.icon});T.aO.Feature.prototype.dO.call(this,i)}}),T.jo=T.jo||{},T.jo.Poly=T.Tool.extend({options:{icon:new T.DivIcon({iconSize:[11,11],className:"tdt-div-icon-black tdt-editing-icon"})},initialize:function(t,i){this.CO=t,T.setOptions(this,i),this.Ko=T.Polygon&&this.CO instanceof T.Polygon},oU:function(){this.CO.jE&&(this.ZO||this.ko(),this.CO.jE.addLayer(this.ZO))},Ar:function(){this.CO.jE&&(this.CO.jE.removeLayer(this.ZO),delete this.ZO,delete this.LO)},Lo:function(){this.ZO.clearLayers(),this.ko()},ko:function(){this.ZO||(this.ZO=new T.LayerGroup),this.LO=[];var t,i,e,s,n=this.CO.ht;for(this.Ko&&(n=n[0]),t=0,e=n.length;tn.length?n.length:s+2;e=n.slice(o,t),this.CO instanceof T.Polygon&&2==e.length&&(0==o?e.splice(0,0,n[n.length-1]):n.length==t&&e.splice(n.length-1,n.length-1,n[0]))}else{for(var h,r,a=0;at&&(e.Vo+=i)})},lo:function(t,i){var e,s,n,o=this.Mo(t,i),h=this._createMidMarker(o,null,"tdt-div-icon-transparent-border");t._o=i.bo=h,s=function(){var e=i.Vo;h.Vo=e,o.lat=h.PE().lat,o.lng=h.PE().lng,this.CO.MO(e,0,o),this.LO.splice(e,0,h),this.No(e,1),i.Vo++,this.Zo(t,h),this.Zo(h,i),this.CO.wQ("editstart")},n=function(){h.off("dragstart",s,this),h.off("dragend",n,this),this.lo(t,h),this.lo(h,i)},e=function(){s.call(this),n.call(this),this.Bo()},h.on("dragstart",s,this).on("dragend",n,this),this.ZO.addLayer(h)},Zo:function(t,i){t&&(t.mo=i),i&&(i.no=t)},Mo:function(t,i){var e=this.CO.jE,s=e.nq(t.PE()),n=e.nq(i.PE());return e._q(s.aQ(n).FQ(2))}});var initHook=function(){this.jt||(T.jo.Poly&&(this.jt=new T.jo.Poly(this),this.options.editable&&this.jt.enable()),this.on("AQ",function(){this.jt&&this.jt.aE()&&this.jt.oU()}),this.on("remove",function(){this.jt&&this.jt.aE()&&this.jt.Ar()}))};T.Polyline._(initHook),T.Polygon._(initHook),T.Polyline.M({MO:function(t,i,e){var s,n=this.ht;return s=e?n.splice(t,i,e):n.splice(t,i),this.redraw(),s}}),T.Polygon.M({MO:function(t,i,e){var s,n=this.ht[0];return s=e?n.splice(t,i,e):n.splice(t,i),this.redraw(),s}}),T.jo.fo=T.Tool.extend({options:{qP:new T.DivIcon({iconSize:[11,11],className:"tdt-div-icon-black tdt-editing-icon tdt-edit-move"}),WP:new T.DivIcon({iconSize:[11,11],className:"tdt-div-icon-black tdt-editing-icon tdt-edit-resize"})},initialize:function(t,i){this.go=t,T.S.setOptions(this,i)},oU:function(){this.go.jE&&(this.jE=this.go.jE,this.ZO||this.ko(),this.jE.addLayer(this.ZO))},Ar:function(){if(this.go.jE){this.wP(this.EP);for(var t=0,i=this.eP.length;t2){for(var h=0;h=1e4?(1e-4*t).toFixed(2)+" ha":t.toFixed(2)+" m²":(t*=.836127,e=t>=3097600?(t/3097600).toFixed(2)+" mi²":t>=4840?(t/4840).toFixed(2)+" acres":Math.ceil(t)+" yd²"),e},oo:function(t,i){var e;return i?e=t>1e3?(t/1e3).toFixed(2)+" km":Math.ceil(t)+" m":(t*=1.09361,e=t>1760?(t/1760).toFixed(2)+" miles":Math.ceil(t)+" yd"),e}}),T.S.extend(T.ut,{SP:function(t,i,e,s){return this.sP(t,e,s)!==this.sP(i,e,s)&&this.sP(t,i,e)!==this.sP(t,i,s)},sP:function(t,i,e){return(e.y-t.y)*(i.x-t.x)>(i.y-t.y)*(e.x-t.x)}}),T.Polyline.M({intersects:function(){var t,i,e,s=this.lt[0],n=s?s.length:0;if(this.DP())return!1;for(t=n-1;t>=3;t--)if(i=s[t-1],e=s[t],this.dP(i,e,t-2))return!0;return!1},qo:function(t,i){return!!this.jE&&this.FP(this.jE.kw(t),i)},FP:function(t,i){var e=this.lt[0],s=e?e.length:0,n=e?e[s-1]:null,o=s-2;return!this.DP(1)&&this.dP(n,t,o,i?1:0)},DP:function(t){var i=this.lt[0],e=i?i.length:0;return e+=t||0,!this.lt[0]||e<=3},dP:function(t,i,e,s){var n,o,h=this.lt[0];s=s||0;for(var r=e;r>s;r--)if(n=h[r-1],o=h[r],T.ut.SP(t,i,n,o))return!0;return!1}}),T.Polygon.M({intersects:function(){var t,i,e,s,n,o=this.lt[0];return!this.DP()&&(!!(t=T.Polyline.prototype.intersects.call(this))||(i=o.length,e=o[0],s=o[i-1],n=i-2,this.dP(s,e,n,1)))}}),T.MarkTool=T.aO.Marker.extend({options:{follow:!1},initialize:function(t,i){this.follow=i&&i.follow?i.follow:this.options.follow,this.options.GO=!1,T.aO.Marker.prototype.initialize.call(this,t,i),this.fP||(this.fP=new T.fT),t.addLayer(this.fP);var e=this.fP;t.on("layerremove",function(t){e&&e.hasLayer(t.layer)&&e.removeLayer(t.layer)})},PY:function(t){T.aO.Marker.prototype.PY.call(this,t)},dO:function(t){this.VO?this.GP=new T.Marker(this.VO.PE(),{icon:this.options.icon}):this.GP=new T.Marker(t.lnglat,{icon:this.options.icon}),T.aO.Feature.prototype.dO.call(this,this.GP),this.fP.addLayer(this.GP),this.wQ("mouseup",{currentLnglat:this.GP.PE(),currentMarker:this.GP,allMarkers:this.getMarkers()})},setPointImage:function(t){var i=T.ur({iconUrl:t,iconSize:[20,30],iconAnchor:[8,29]});this.options.icon=i},clear:function(){this.fP.bE(function(t){t.Qq()})},getMarkers:function(){return this.fP.getLayers()},getMarkControlPoint:function(){return null==this.GP?null:this.GP.PE()},gP:function(){this.fP.bE(function(t){t instanceof T.Marker&&t.AE.enable()})},HP:function(){this.fP.bE(function(t){t instanceof T.Marker&&t.AE.disable()})},enable:function(){this.eU||(T.aO.Marker.prototype.enable.call(this),this.GP=null)},open:function(){this.enable()},close:function(){this.disable()}}),T.RectangleTool=T.aO.Rectangle.extend({initialize:function(t,i){i&&(i.color&&(this.options.sO.color=i.color),i.weight&&(this.options.sO.weight=i.weight),i.opacity&&(this.options.sO.opacity=i.opacity),i.fillColor&&(this.options.sO.fillColor=i.fillColor),i.fillOpacity&&(this.options.sO.fillOpacity=i.fillOpacity),i.lineStyle&&(this.options.sO.lineStyle=i.lineStyle)),T.aO.Rectangle.prototype.initialize.call(this,t,i),this.fP||(this.fP=new T.fT),t.addLayer(this.fP);var e=this.fP;t.on("layerremove",function(t){e&&e.hasLayer(t.layer)&&e.removeLayer(t.layer)})},oU:function(){T.aO.Rectangle.prototype.oU.call(this)},dO:function(){var t=new T.Rectangle(this.go.getBounds(),this.options.sO);T.aO.fo.prototype.dO.call(this,t),this.fP.addLayer(t),this.wQ("draw",{currentBounds:t.getBounds(),currentRectangle:t,allRectangles:this.getRectangles()}),t.redraw()},clear:function(){this.fP.bE(function(t){t.Qq()})},getRectangles:function(){return this.fP.getLayers()},open:function(){this.enable()},close:function(){this.disable()}}),T.CircleTool=T.aO.Circle.extend({initialize:function(t,i){i&&(i.color&&(this.options.sO.color=i.color),i.fillColor&&(this.options.sO.fillColor=i.fillColor),i.weight&&(this.options.sO.weight=i.weight),i.opacity&&(this.options.sO.opacity=i.opacity),i.fillOpacity&&(this.options.sO.fillOpacity=i.fillOpacity),i.lineStyle&&(this.options.sO.lineStyle=i.lineStyle)),T.aO.Circle.prototype.initialize.call(this,t,i),this.fP||(this.fP=new T.fT),t.addLayer(this.fP);var e=this.fP;t.on("layerremove",function(t){e&&e.hasLayer(t.layer)&&e.removeLayer(t.layer)})},dO:function(){var t=new T.Circle(this.lu,this.go.getRadius(),this.options.sO);T.aO.fo.prototype.dO.call(this,t),this.fP.addLayer(t);var i=this.go.getRadius();this.wQ("drawend",{currentCenter:this.lu,currentRadius:i,currentCircle:t,allCircles:this.getCircles()}),t.redraw()},PY:function(t){if(T.aO.Circle.prototype.PY.call(this,t),this.go){var i=this.go.getRadius(),e=new T.Circle(this.lu,this.go.getRadius(),this.options.sO);this.wQ("draw",{currentCenter:this.lu,currentRadius:i,currentCircle:e,allCircles:this.getCircles()})}},getCircles:function(){return this.fP.getLayers()},clear:function(){this.fP.bE(function(t){t.Qq()})},open:function(){this.enable()},close:function(){this.disable()}}),T.PolylineTool=T.aO.Polyline.extend({initialize:function(t,i){i&&(i.color&&(this.options.sO.color=i.color),i.weight&&(this.options.sO.weight=i.weight),i.opacity&&(this.options.sO.opacity=i.opacity),i.lineStyle&&(this.options.sO.lineStyle=i.lineStyle),i.showLabel?(this.to=i.showLabel,this.options.GO=!1):this.options.GO=!0),T.aO.Polyline.prototype.initialize.call(this,t,i),this.options.fO=!0,this.options.icon=T.Lr({className:"tdt-img3"})},oU:function(){T.aO.Polyline.prototype.oU.call(this)},BO:function(){this.ZO.getLayers().length<2&&this.disable(),this.isdb=!1,this.KO=!1,this.Qo()},Ar:function(){var t=this.jE;this.KO&&(this._mouselabel&&this._mouselabel.Qq(),this.ZO.bE(function(i){i.label&&i.label.onRemove(t),i.Qq()})),t.off("mouseup",this.cO,this),this.to||this.ZO.bE(function(t){t.Qq()}),T.aO.Polyline.prototype.Ar.call(this);t.off("dblclick ",this.BO,this)},cO:function(t){function i(t){return function(){0==e.isdb&&e.mu(t)}}this.isdb=!1;var e=this;t.To=T.SQ(t.originalEvent.clientX,t.originalEvent.clientY),window.setTimeout(i(t),50)},dO:function(){this._mouselabel&&this._mouselabel.Qq();var t=new this.Poly(this.CO.Ht(),this.options.sO);t.to=this.to;var i=this.ZO.getLayers().length,e=t.ZO=this.ZO,s=this;if(T.aO.Feature.prototype.dO.call(this,t),this.lO.addLayer(t),e.getLayers().length>0&&(e.bE(function(i){i.label&&i.label.hP("tdt-img1",i,function(){if(index=0,2==e.getLayers().length)return void t.Qq();for(;index1)){var n=e.getLayers()[i-1];n.label&&(n.label.setBorderLine(.5),n.label.setBorderColor("#CE0000"),n.label.Ow.childNodes[0].innerText=" 总长:"+(this.getDistance(t.Ht())/1e3).toFixed(3)+" 公里 ",n.label.hP("tdt-img2",t,function(){t.Qq()}))}this.wQ("draw",{currentLnglats:t.getLngLats(),currentDistance:this.getDistance(t.Ht()),currentPolyline:t,allPolylines:this.getPolylines()}),t.redraw()},JP:function(t){var i=t.ZO.getLayers();for(index=0;index0&&this.to){var e="";if(1==this.ZO.getLayers().length)e="起点";else{var s=this.CO.Ht().slice(0);s.push(i.PE()),e=""+(this.getDistance(s)/1e3).toFixed(3)+" 公里"}if(e){var n=new T.Label({text:e,position:i.getLngLat(),Jo:[10,-15],className:"tdt-label1 ",zIndex:T.aO.Polyline.FO++}).addTo(this.jE);i.label=n}}return i},_O:function(t){T.aO.Polyline.prototype._O.call(this,t),this.wQ("addpoint",{currentLnglats:this.CO.getLngLats(),currentDistance:this.getDistance(this.CO.Ht()),currentPolyline:this.CO,allPolylines:this.getPolylines()})},setTips:function(t){this.text=t},getDistance:function(t){var e=0;for(i=0;i"+o+" ",position:i.getLngLat(),Jo:[10,-15],className:"tdt-label1 ",zIndex:T.aO.Polyline.FO++}).addTo(this.jE)),e>3&&(this.KP.Ow.childNodes[0].innerText=o,this.KP.sr(i.getLngLat()))}return i},dO:function(){var t=new this.Poly(this.CO.Ht(),this.options.sO);if(t.to=this.to,T.aO.Feature.prototype.dO.call(this,t),this.jP.addLayer(t),this.wQ("draw",{currentLnglats:t.getLngLats()[0],currentArea:this.getArea(t.Ht()[0]),currentPolygon:t,allPolygons:this.getPolygons()}),this._mouselabel&&this._mouselabel.Qq(),this.to&&this.KP){this.KP.setBorderLine(.5),this.KP.setBorderColor("#CE0000"),this.KP.Ow.childNodes[0].innerText="总面积:"+this.KP.Ow.childNodes[0].innerText;t.KP=this.KP,this.KP.hP("tdt-img2",t,function(){t.Qq()})}t.redraw()},_O:function(t){T.aO.Polygon.prototype._O.call(this,t),this.wQ("addpoint",{currentPolygon:this.CO,currentLnglats:this.CO.getLngLats()[0],currentArea:this.getArea(this.CO.Ht()),allPolygons:this.getPolygons()})},setTips:function(t){this.text=t},getPolygons:function(){return this.jP.getLayers()},getArea:function(t){return T.Po.Fo(t)},endDraw:function(){this.isdb=!1,this.KO=!1,this.Qo()},clear:function(){this.jP.bE(function(t){t.Qq()})},open:function(){this.enable()},close:function(){this.disable()}}),T.Control.PadTipControl=T.Control.extend({initialize:function(t){this.setOptions(t)},onAdd:function(t){this.map=t;var i=this.div=T._Q.s("a","tdt-noDataTips"),e=this.left=T._Q.s("a","tdt-tabtop_left",i);e.style.color="#FFFFFF";var s=T._Q.s("a","tdt-tabtop_rt",i);return self=this,s.onclick=function(){t.removeControl(self)},i},setCenter:function(){this.div.style.marginRight=(this.map.Ow.offsetWidth-this.div.offsetWidth)/2+"px"},setContext:function(t){this.left.innerHTML=t},onRemove:function(t){var i=this.div.parentNode;i&&(i.removeChild(this.div),this.map=null,this.div=null)}}),T.labelVersion="0.2.2-dev",T.Label=T.Overlay.extend({includes:T.iQ.OQ,options:{type:1,className:"",JO:!1,kP:"right",LP:!1,Jo:[12,-15],offset:new T.Point(0,0),opacity:1,Nr:!1},initialize:function(t,i){if(T.setOptions(this,t),this.br=i,this.lP=T.oQ.any3d&&this.options.Nr,this.ZP=!1,t&&(t.text&&this.setContent(t.text),t.position&&this.setLngLat(t.position),this.options.zIndex&&(this.Jr=this.options.zIndex),t.offset&&t.offset instanceof T.Point)){this.options.offset=t.offset;var e=this.options.offset;this.options.Jo=[e.x+12,e.y-15]}this.options.JO=!0,this.options.LP=!0},onAdd:function(t){this.jE=t,this.fu=this.options.hE?t.aw[this.options.hE]:this.br instanceof T.Marker?t.aw.markerPane:t.aw.popupPane,this.Ow||this.DW(),this.fu.appendChild(this.Ow),this.hr(),this.Oe(),this.setOpacity(this.options.opacity),t.on("moveend",this.TE,this).on("viewreset",this.CP,this),this.lP&&t.on("Ge",this.VP,this),T.oQ.touch&&!this.options.LP&&(T.oq.on(this.Ow,"click",this.close,this),t.on("click",this.close,this))},onRemove:function(t){this.fu.removeChild(this.Ow),t.off({Ge:this.VP,moveend:this.TE,viewreset:this.CP},this),this.cP(),this.wQ("remove",{}),this.jE=null},sr:function(t){return this.or=T.fq(t),this.jE&&this.WT(),this},setContent:function(t){return this.BP=this.ET,this.ET=t,this.eT(),this},getElement:function(){return this.Ow},close:function(){var t=this.jE;t&&(T.oQ.touch&&!this.options.LP&&(T.oq.off(this.Ow,"click",this.close),t.off("click",this.close,this)),t.removeLayer(this))},vP:function(t){this.Jr=t,this.Ow&&this.Jr&&(this.Ow.style.zIndex=t)},setOpacity:function(t){this.options.opacity=t,this.Ow&&T._Q.setOpacity(this.Ow,t)},DW:function(){this.options.className?this.Ow=T._Q.s("div",this.options.className+" tdt-zoom-animated"):this.Ow=T._Q.s("div","tdt-label tdt-zoom-animated"),this.vP(this.Jr)},Oe:function(){this.jE&&(this.Ow.style.visibility="hidden",this.eT(),this.WT(),this.Ow.style.visibility="")},eT:function(){this.ET&&this.jE&&this.NP!==this.ET&&"string"==typeof this.ET&&(this.Ow.innerHTML=this.ET,this.NP=this.ET,this._labelWidth=this.Ow.offsetWidth)},WT:function(){var t=this.jE.kw(this.or);this.bP(t)},bP:function(t){var i=this.jE,e=this.Ow,s=i.BW(i.getCenter()),n=i.Zw(t),o=this.options.kP,h=this._labelWidth,r=T.SQ(this.options.Jo);"right"===o||"auto"===o&&n.xthis.options.dp&&this.lp.getZoom()this._lastMiniMapZoom?(i=this.lp.getZoom()+1,this.Cp.setZoom(this.Cp.getZoom()-1)):i=this.lp.getZoom():i=s,this._lastMiniMapZoom=this.Cp.getZoom(),i},EA:function(){return this.Bp?this.vp:this.options.Gp?!!this.lp.getBounds().contains(this.Cp.getBounds()):this.vp},YA:function(t){return"number"==typeof t},tA:function(t){return"undefined"!=typeof t}}),T.Map.n({UA:!1}),T.Map._(function(){this.options.UA&&(this.UA=(new MiniMap).addTo(this))}),T.Control.OverviewMap=T.Control.sp.extend({includes:T.iQ.OQ,options:{anchor:"TMAP_ANCHOR_BOTTOM_RIGH",size:new T.SQ(150,150),isOpen:!1},initialize:function(t){t&&(t.size&&(this.options.width=t.size.x,this.options.height=t.size.y),this.ZP=t.isOpen,this.vp=t.isOpen),this.options.Dp=!0,T.Control.sp.prototype.initialize.call(this,t)},onAdd:function(t){var i=T.Control.sp.prototype.onAdd.call(this,t);this.ZP?this.TA():this.rA();var e=T.Icon.Default.imagePath;return this.setButtonImage(e+"/Open.png",e+"/Close.png"),i},setButtonImage:function(t,i){this.ButtonImageUrl="url("+t+")",this.ButtonImageReverseUrl="url("+i+")",this.ZP?T.oQ.ielt9&&(this.eA.style.backgroundImage=this.ButtonImageUrl):T.oQ.ielt9&&(this.eA.style.backgroundImage=this.ButtonImageReverseUrl),T.oQ.ielt9||(this.eA.style.backgroundImage=this.ButtonImageUrl)},_setButtonImage:function(t){return this.eA.style.backgroundImage="url("+t+")",this},setBorderColor:function(t){this._minimapContainer.style.borderColor=t},setBorderWidth:function(t){this._minimapContainer.style.borderWidth=t+"px"},setRectBorderColor:function(t){this.options.Jp.color=t,this.options.Jp.fillColor=t,this.bp.setStyle(this.options.Jp)},setRectBackColor:function(t){this.options.jp.color=t,this.options.jp.fillColor=t,this.Mp.setStyle(this.options.jp)},RA:function(){T.Control.sp.prototype.RA.call(this),this.wQ("viewchange",{isOpen:!this.vp}),this.ZP=!this.vp,this.ZP?this.ButtonImageUrl&&(this.eA.style.backgroundImage=this.ButtonImageUrl):this.ButtonImageReverseUrl&&(this.eA.style.backgroundImage=this.ButtonImageReverseUrl)},changeView:function(){this.RA()},isOpen:function(){return!this.vp},getMiniMap:function(){return this.Cp}}),T.uA=T.fT.extend({options:{IA:80,iA:null,OA:!1,oA:!0,PA:!0,pA:!1,AA:null,aA:!0,Tw:!1,SA:!1,sA:1,DA:{weight:1.5,color:"#222",opacity:.5},dA:!1,FA:200,fA:50,GA:null,gA:{}},initialize:function(t){T.S.setOptions(this,t),this.options.iA||this.setStyles(this.options.styles,!0),this.HA=T.lT(),this.HA.TQ(this),this.hA=T.lT(),this.hA.TQ(this),this.JA=0,this.jA=[],this.KA=[],this.kA=null,this.LA=[];var i=T._Q.Iq&&this.options.Tw;T.extend(this,i?this.lA:this.ZA),this.CA=i?T.VA:T.cA},addLayer:function(t){if(t instanceof T.LayerGroup)return this.addLayers([t]);if(!t.PE)return this.hA.addLayer(t),this;if(!this.jE)return this.jA.push(t),this;if(this.hasLayer(t))return this;this.BA&&this.BA(),this.Wi(t,this.vA),this.bA.NA();var i=t,e=this.jE.getZoom();if(t.MA)for(;i.MA.fW>=e;)i=i.MA;return this.kA.contains(i.PE())&&(this.options.SA?this.nA(t,i):this._A(t,i)),this._viewChangeEndNotClustering(),this},removeLayer:function(t){return t instanceof T.LayerGroup?this.removeLayers([t]):t.PE?this.jE?t.MA?(this.BA&&(this.BA(),this.Qa(t)),this.qa(t,!0),this.bA.NA(),t.off("move",this.Wa,this),this.HA.hasLayer(t)&&(this.HA.removeLayer(t),t.wa&&t.wa()),this):this:(!this.mA(this.jA,t)&&this.hasLayer(t)&&this.KA.push(t),this):(this.hA.removeLayer(t),this)},addLayers:function(t){if(!T.S.l(t))return this.addLayer(t);var i,e=this.HA,s=this.hA,n=this.options.dA,o=this.options.FA,h=this.options.GA,r=t.length,a=0,l=!0;if(this.jE){var u=(new Date).getTime(),c=T.D(function(){for(var f=(new Date).getTime();ao)break}if(i=t[a],i instanceof T.LayerGroup)l&&(t=t.slice(),l=!1),this.Ea(i,t),r=t.length;else if(i.PE){if(!this.hasLayer(i)&&(this.Wi(i,this.vA),i.MA&&2===i.MA.ea())){var p=i.MA.Ra(),m=p[0]===i?p[1]:p[0];e.removeLayer(m)}}else s.addLayer(i)}h&&h(a,r,(new Date).getTime()-u),a===r?(this.bA.NA(),this.HA.bE(function(t){t instanceof T.VA&&t.ra&&t.Ta()}),this.bA.ta(null,this.fW,this.kA)):setTimeout(c,this.options.fA)},this);c(),this._viewChangeEndNotClustering()}else for(var f=this.jA;a=0;i--)t.extend(this.jA[i].PE());return t.extend(this.hA.getBounds()),t},bE:function(t,i){var e,s=this.jA.slice(),n=this.KA;for(this.bA&&this.bA.Ra(s),e=s.length-1;e>=0;e--)n.indexOf(s[e])===-1&&t.call(i,s[e]);this.hA.bE(t,i)},getLayers:function(){var t=[];return this.bE(function(i){t.push(i)}),t},getLayer:function(t){var i=null;return t=parseInt(t,10),this.bE(function(e){T.d(e)===t&&(i=e)}),i},hasLayer:function(t){if(!t)return!1;var i,e=this.jA;for(i=e.length-1;i>=0;i--)if(e[i]===t)return!0;for(e=this.KA,i=e.length-1;i>=0;i--)if(e[i]===t)return!1;return!(!t.MA||t.MA.ia!==this)||this.hA.hasLayer(t)},Oa:function(t,i){"function"!=typeof i&&(i=function(){});var e=function(){!t.Fr&&!t.MA.Fr||this.JA||(this.jE.off("moveend",e,this),this.off("animationend",e,this),t.Fr?i():t.MA.Fr&&(this.rQ("spiderfied",i,this),t.MA.oa()))};if(t.Fr&&this.jE.getBounds().contains(t.PE()))i();else if(t.MA.fW=0;e--)if(t[e]===i)return t.splice(e,1),!0},Ga:function(t,i){for(var e=this.jE,s=this.Ua;i>=0&&s[i].ga(t,e.nq(t.PE(),i));i--);},Wa:function(t){this.Ha||(t.target.or=t.ha,this.removeLayer(t.target),t.target.or=t.KT,this.addLayer(t.target))},qa:function(t,i,e){var s=this.Ya,n=this.Ua,o=this.HA,h=this.jE;i&&this.Ga(t,this.vA);var r,a=t.MA,l=a.LO;for(this.mA(l,t);a&&(a.Ja--,a.ja=!0,!(a.fW<0));)i&&a.Ja<=1?(r=a.LO[0]===t?a.LO[1]:a.LO[0],s[a.fW].ga(a,h.nq(a.Ka,a.fW)),n[a.fW].ka(r,h.nq(r.PE(),a.fW)),this.mA(a.MA.La,a),a.MA.LO.push(r),r.MA=a.MA,a.Fr&&(o.removeLayer(a),e||o.addLayer(r))):e&&a.Fr||a.Ta(),a=a.MA;delete t.MA},la:function(t,i){for(;i;){if(t===i)return!0;i=i.parentNode}return!1},wQ:function(t,i,e){if(i&&i.layer instanceof T.VA){if(i.originalEvent&&this.la(i.layer.Fr,i.originalEvent.relatedTarget))return;t="cluster"+t}T.fT.prototype.wQ.call(this,t,i,e)},EQ:function(t,i){return T.fT.prototype.EQ.call(this,t,i)||T.fT.prototype.EQ.call(this,"cluster"+t,i)},Za:function(t){var i=t.ea(),e=" marker-cluster-";return e+=i<10?"small1":i<100?"medium1":"large1",new T.DivIcon({html:"
"+i+"
",className:"marker-cluster"+e,iconSize:new T.Point(40,40)})},sa:function(){var t=this.jE,i=this.options.OA,e=this.options.oA,s=this.options.PA;(i||s)&&this.on("clusterclick",this.Ca,this),e&&(this.on("clustermouseover",this.Va,this),this.on("clustermouseout",this.Fa,this),t.on("zoomend",this.Fa,this))},Ca:function(t){var i=t.layer,e=i;return 1===e.La.length?void this.jE.centerAndZoom(e.or,this.jE.getZoom()+1):(e.fW===this.vA&&e.Ja===i.Ja&&this.options.OA?i.oa():this.options.PA&&i.Pa(),void(t.originalEvent&&13===t.originalEvent.keyCode&&this.jE.Ow.focus()))},Va:function(t){var i=this.jE;this.JA||(this.ca&&i.removeLayer(this.ca),t.layer.ea()>2&&t.layer!==this.Ba&&(this.ca=new T.Polygon(t.layer.va(),this.options.gA),i.addLayer(this.ca)))},Fa:function(){this.ca&&(this.jE.removeLayer(this.ca),this.ca=null)},Da:function(){var t=this.options.OA,i=this.options.oA,e=this.options.PA,s=this.jE;(t||e)&&this.off("clusterclick",this.Ca,this),i&&(this.off("clustermouseover",this.Va,this),this.off("clustermouseout",this.Fa,this),s.off("zoomend",this.Fa,this))},aa:function(){this.jE&&(this.Na(),this.fW=Math.round(this.jE.fW),this.kA=this.Aa())},mw:function(){if(!this.JA){var t=this.Aa();this.bA.ba(this.kA,this.fW,t),this.bA.ta(null,Math.round(this.jE.fW),t),this.kA=t}},Ia:function(){var t=this.jE.getMaxZoom(),i=this.options.IA,e=i;"function"!=typeof i&&(e=function(){return i}),this.options.AA&&(t=this.options.AA-1),this.vA=t,this.Ya={},this.Ua={};for(var s=t;s>=0;s--)this.Ya[s]=new T.Ma(e(s)),this.Ua[s]=new T.Ma(e(s));this.bA=new this.CA(this,-1)},Wi:function(t,i){var e,s,n=this.Ya,o=this.Ua;for(this.options.pA&&this.na(t),t.on("move",this.Wa,this);i>=0;i--){e=this.jE.nq(t.PE(),i);var h=n[i]._a(e);if(h)return h.ma(t),void(t.MA=h);if(h=o[i]._a(e)){var r=h.MA;r&&this.qa(h,!1);var a=new this.CA(this,i,h,t);n[i].ka(a,this.jE.nq(a.Ka,i)),h.MA=a,t.MA=a;var l=a;for(s=i-1;s>r.fW;s--)l=new this.CA(this,s,l),n[s].ka(l,this.jE.nq(h.PE(),s));return r.ma(l),void this.Ga(h,i)}o[i].ka(t,e)}this.bA.ma(t),t.MA=this.bA},QS:function(t){this.LA.push(t),this.qS||(this.qS=setTimeout(T.D(this.WS,this),300))},WS:function(){for(var t=0;tt?(this.wS(),this.eS(this.fW,t)):this.mw()},Aa:function(){return this.options.aA?T.oQ.mobile?this.rS(this.jE.getBounds()):this.rS(this.jE.getBounds().lq(1)):this.RS},rS:function(t){var i=this.pa;return void 0!==i&&(t.Cq()>=i&&(t.Lq.lat=1/0),t.Bq()<=-i&&(t.kq.lat=-(1/0))),t},_A:function(t,i){if(i===t)this.HA.addLayer(t);else if(2===i.Ja){i.TS();var e=i.Ra();this.HA.removeLayer(e[0]),this.HA.removeLayer(e[1])}else i.Ta()},Ea:function(t,i){var e,s=t.getLayers(),n=0;for(i=i||[];n=0;e--)h=a[e],s.contains(h.or)||n.removeLayer(h)}),this.uS(),this.bA.IS(s,i),n.bE(function(t){t instanceof T.VA||!t.Fr||t.wa()}),this.bA.tS(s,t,i,function(t){t.iS(i)}),this.Ha=!1,this.QS(function(){this.bA.tS(s,t,0,function(t){n.removeLayer(t),t.wa()}),this.OS()})},eS:function(t,i){this.oS(this.bA,t-1,i),this.bA.ta(null,i,this.Aa()),this.bA.ba(this.kA,t,this.Aa())},nA:function(t,i){var e=this,s=this.HA;s.addLayer(t),i!==t&&(i.Ja>2?(i.Ta(),this.uS(),this.wS(),t.fr(this.jE.kw(i.PE())),t.US(),this.QS(function(){s.removeLayer(t),t.wa(),e.OS()})):(this.uS(),e.wS(),e.oS(i,this.jE.getMaxZoom(),this.jE.getZoom())))}},oS:function(t,i,e){var s=this.Aa();t.PS(s,i+1,e);var n=this;this.uS(),t.IS(s,e),this.QS(function(){if(1===t.Ja){var o=t.LO[0];this.Ha=!0,o.sr(o.PE()),this.Ha=!1,o.wa&&o.wa()}else t.tS(s,e,0,function(t){t.ba(s,i+1)});n.OS()})},OS:function(){this.jE&&(this.jE.ow.className=this.jE.ow.className.replace(" tdt-cluster-anim","")),this.JA--,this.wQ("animationend")},uS:function(){T.S.H(document.body.offsetWidth)}}),T.pS=function(t){return new T.uA(t)},T.VA=T.Marker.extend({initialize:function(t,i,e,s){T.Marker.prototype.initialize.call(this,e?e.Ka||e.PE():new T.dq(0,0),{icon:this}),this.ia=t,this.fW=i,this.LO=[],this.La=[],this.Ja=0,this.ra=!0,this.ja=!0,this.Qr=new T.Kq,e&&this.ma(e),s&&this.ma(s)},Ra:function(t){t=t||[];for(var i=this.La.length-1;i>=0;i--)this.La[i].Ra(t);for(var e=this.LO.length-1;e>=0;e--)t.push(this.LO[e]);return t},ea:function(){return this.Ja},Pa:function(){for(var t,i=this.La.slice(),e=this.ia.jE,s=e.nW(this.Qr),n=this.fW+1,o=e.getZoom();i.length>0&&s>n;){n++;var h=[];for(t=0;tn?this.ia.jE.gW(this.or,n):s<=o?this.ia.jE.gW(this.or,o+1):this.ia.jE._W(this.Qr)},getBounds:function(){var t=new T.Kq;return t.extend(this.Qr),t},Ta:function(){this.ra=!0,this.Fr&&this.setIcon(this)},Rr:function(){return this.ra&&(this.AS=this.ia.options.iA(this),this.ra=!1),this.AS.Rr()},Tr:function(){return this.AS.Tr()},ma:function(t,i){this.ra=!0,this.ja=!0,this.aS(t),t instanceof T.VA?(i||(this.La.push(t),t.MA=this),this.Ja+=t.Ja):(i||this.LO.push(t),this.Ja++),this.MA&&this.MA.ma(t,!0)},aS:function(t){this.fLatLng||(this.fLatLng=t.or),this.Ka||(this.Ka=t.Ka||t.or)},SS:function(){var t=this.Qr;t.kq&&(t.kq.lat=1/0,t.kq.lng=1/0),t.Lq&&(t.Lq.lat=-(1/0),t.Lq.lng=-(1/0))},NA:function(){var t,i,e,s,n=this.LO,o=this.La,h=0,r=0,a=this.Ja;if(0!==a){for(this.SS(),t=0;t=0;e--)s=n[e],s.Fr&&(s.fr(i),s.US())},function(t){var e,s,n=t.La;for(e=n.length-1;e>=0;e--)s=n[e],s.Fr&&(s.fr(i),s.US())})},PS:function(t,i,e){this.tS(t,e,0,function(s){s.dS(t,s.ia.jE.kw(s.PE()).hQ(),i),s.YS()&&i-1===e?(s.wa(),s.ba(t,i)):s.US(),s.TS()})},IS:function(t,i){this.tS(t,0,i,null,function(t){t.wa()})},ta:function(t,i,e){this.tS(e,-1,i,function(s){if(i!==s.fW)for(var n=s.LO.length-1;n>=0;n--){var o=s.LO[n];e.contains(o.or)&&(t&&(o.DS=o.PE(),o.sr(t),o.US&&o.US()),s.ia.HA.addLayer(o))}},function(i){i.TS(t)})},iS:function(t){for(var i=this.LO.length-1;i>=0;i--){var e=this.LO[i];e.DS&&(e.sr(e.DS),delete e.DS)}if(t-1===this.fW)for(var s=this.La.length-1;s>=0;s--)this.La[s].FS();else for(var n=this.La.length-1;n>=0;n--)this.La[n].iS(t)},FS:function(){this.DS&&(this.sr(this.DS),delete this.DS)},ba:function(t,i,e){var s,n;this.tS(t,-1,i-1,function(t){for(n=t.LO.length-1;n>=0;n--)s=t.LO[n],e&&e.contains(s.or)||(t.ia.HA.removeLayer(s),s.wa&&s.wa())},function(t){for(n=t.La.length-1;n>=0;n--)s=t.La[n],e&&e.contains(s.or)||(t.ia.HA.removeLayer(s),s.wa&&s.wa())})},tS:function(t,i,e,s,n){var o,h,r=this.La,a=this.fW;if(i>a)for(o=r.length-1;o>=0;o--)h=r[o],t.intersects(h.Qr)&&h.tS(t,i,e,s,n);else if(s&&s(this),n&&this.fW===e&&n(this),e>a)for(o=r.length-1;o>=0;o--)h=r[o],t.intersects(h.Qr)&&h.tS(t,i,e,s,n)},YS:function(){return this.La.length>0&&this.La[0].Ja===this.Ja}}),T.Marker.M({US:function(){return this.options.fS=this.options.opacity||1,this.setOpacity(0)},wa:function(){var t=this.setOpacity(this.options.opacity||this.options.fS);return delete this.options.fS,t}}),T.Ma=function(t){this.GS=t,this.gS=t*t,this.HS={},this.hS={}},T.Ma.prototype={ka:function(t,i){var e=this.JS(i.x),s=this.JS(i.y),n=this.HS,o=n[s]=n[s]||{},h=o[e]=o[e]||[],r=T.S.d(t);this.hS[r]=i,h.push(t)},jS:function(t,i){this.ga(t),this.ka(t,i)},ga:function(t,i){var e,s,n=this.JS(i.x),o=this.JS(i.y),h=this.HS,r=h[o]=h[o]||{},a=r[n]=r[n]||[];for(delete this.hS[T.S.d(t)],e=0,s=a.length;e=0;e--)s=i[e],n=this.getDistant(s,t),n>0&&(r.push(s),n>o&&(o=n,h=s));return{maxPoint:h,newPoints:r}},lS:function(t,i){var e=[],s=this.LS(t,i);return s.maxPoint?(e=e.concat(this.lS([t[0],s.maxPoint],s.newPoints)),e=e.concat(this.lS([s.maxPoint,t[1]],s.newPoints))):[t[0]]},va:function(t){var i,e=!1,s=!1,n=!1,o=!1,h=null,r=null,a=null,l=null,u=null,c=null;for(i=t.length-1;i>=0;i--){var f=t[i];(e===!1||f.lat>e)&&(h=f,e=f.lat),(s===!1||f.latn)&&(a=f,n=f.lng),(o===!1||f.lng=0;i--)t=e[i].PE(),s.push(t);return T.kS.va(s)}}),T.VA.M({ZS:2*Math.PI,CS:25,VS:Math.PI/6,cS:28,BS:11,vS:5,NS:9,oa:function(){if(this.ia.Ba!==this&&!this.ia.JA){var t,i=this.Ra(),e=this.ia,s=e.jE,n=s.kw(this.or);this.ia.BA(),this.ia.Ba=this,i.length>=this.NS?t=this.bS(i.length,n):(n.y+=10,t=this.MS(i.length,n)),this.nS(i,t)}},_S:function(t){this.ia.JA||(this.mS(t),this.ia.Ba=null)},MS:function(t,i){var e,s,n=this.ia.options.sA*this.CS*(2+t),o=n/this.ZS,h=this.ZS/t,r=[];for(r.length=t,e=t-1;e>=0;e--)s=this.VS+e*h,r[e]=new T.Point(i.x+o*Math.cos(s),i.y+o*Math.sin(s)).JQ();return r},bS:function(t,i){var e,s=this.ia.options.sA,n=s*this.BS,o=s*this.cS,h=s*this.vS*this.ZS,r=0,a=[];for(a.length=t,e=t-1;e>=0;e--)r+=o/n+5e-4*e,a[e]=new T.Point(i.x+n*Math.cos(r),i.y+n*Math.sin(r)).JQ(),n+=h/r;return a},ua:function(){var t,i,e=this.ia,s=e.jE,n=e.HA,o=this.Ra();for(e.Ha=!0,this.setOpacity(1),i=o.length-1;i>=0;i--)t=o[i],n.removeLayer(t),t.Qs&&(t.sr(t.Qs),delete t.Qs),t.setZIndexOffset&&t.setZIndexOffset(0),t.qs&&(s.removeLayer(t.qs),delete t.qs);e.wQ("Ws",{cluster:this,markers:o}),e.Ha=!1,e.Ba=null}}),T.cA=T.VA.extend({nS:function(t,i){var e,s,n,o,h=this.ia,r=h.jE,a=h.HA,l=this.ia.options.DA;for(h.Ha=!0,e=0;e=0;e--)r=u.Dw(i[e]),s=t[e],s.Qs=s.or,s.sr(r),s.wa&&s.wa(),p&&(n=s.qs,o=n.Yt,o.style.strokeDashoffset=0,n.setStyle({opacity:y}));this.setOpacity(.3),l.Ha=!1,setTimeout(function(){l.OS(),l.wQ("spiderfied",{cluster:a,markers:t})},200)},mS:function(t){var i,e,s,n,o,h,r=this,a=this.ia,l=a.jE,u=a.HA,c=t?l.DE(this.or,t.zoom,t.center):l.kw(this.or),f=this.Ra(),d=T.jT.SVG;for(a.Ha=!0,a.wS(),this.setOpacity(1),e=f.length-1;e>=0;e--)i=f[e],i.Qs&&(i.sr(i.Qs),delete i.Qs,h=!0,i.fr&&(i.fr(c),h=!1),i.US&&(i.US(),h=!1),h&&u.removeLayer(i),d&&(s=i.qs,n=s.Yt,o=n.getTotalLength()+.1,n.style.strokeDashoffset=o,s.setStyle({opacity:0})));a.Ha=!1,setTimeout(function(){var t=0;for(e=f.length-1;e>=0;e--)i=f[e],i.qs&&t++;for(e=f.length-1;e>=0;e--)i=f[e],i.qs&&(i.wa&&i.wa(),i.setZIndexOffset&&i.setZIndexOffset(0),t>1&&u.removeLayer(i),l.removeLayer(i.qs),delete i.qs);a.OS(),a.wQ("Ws",{cluster:r,markers:f})},200)}}),T.uA.M({Ba:null,_S:function(){this.BA.apply(this,arguments)},Sa:function(){this.jE.on("click",this.ws,this),this.jE.options.Nr&&this.jE.on("zoomstart",this.Es,this),this.jE.on("zoomend",this.ua,this),T.oQ.touch||this.jE.vT(this)},da:function(){this.jE.off("click",this.ws,this),this.jE.off("zoomstart",this.Es,this),this.jE.off("Ge",this.es,this),this.jE.off("zoomend",this.ua,this),this.ua()},Es:function(){this.jE&&this.jE.on("Ge",this.es,this)},es:function(t){T._Q.Eq(this.jE.ow,"tdt-touching")||(this.jE.off("Ge",this.es,this),this.BA(t))},ws:function(){this.BA()},BA:function(t){this.Ba&&this.Ba._S(t)},ua:function(){this.Ba&&this.Ba.ua()},Qa:function(t){t.qs&&(this.HA.removeLayer(t),t.wa&&t.wa(),t.setZIndexOffset&&t.setZIndexOffset(0),this.jE.removeLayer(t.qs),delete t.qs)}}),T.uA.M({Rs:function(t){return t?t instanceof T.uA?t=t.bA.Ra():t instanceof T.LayerGroup?t=t.hW:t instanceof T.VA?t=t.Ra():t instanceof T.Marker&&(t=[t]):t=this.bA.Ra(),this.rs(t),this.Ts(),this.options.pA&&this.ts(t),this},rs:function(t){var i,e;for(i in t)for(e=t[i].MA;e;)e.ra=!0,e=e.MA},Ts:function(){this.HA.bE(function(t){t instanceof T.VA&&t.ra&&t.Ta()})},ts:function(t){var i,e;for(i in t)e=t[i],this.hasLayer(e)&&e.setIcon(this.na(e))}}),T.Marker.M({Ys:function(t,i){var e=this.options.icon;return T.setOptions(e,t),this.setIcon(e),i&&this.MA&&this.MA.ia.Rs(this),this}}),T.Us=T.DivIcon.extend({options:{url:"",size:[12,12],offset:[],textColor:"#ff00ff",textSize:10},initialize:function(t){t&&(t.bgPos&&(this.options.bgPos=t.offset),t.size&&(this.options.iconSize=t.size),t.textColor&&(this.options.textColor=t.textColor),t.textSize&&(this.options.textSize=t.textSize),t.url&&(this.options.url=t.url)),this.options.className="tdt-cluster0",T.DivIcon.prototype.initialize.call(this,t)},er:function(t,i){T.DivIcon.prototype.er.call(this,t,i),t.className=this.options.className||"",this.options.url&&(t.style.backgroundImage="url("+this.options.url+")"),this.options.textColor&&(t.style.color=this.options.textColor),this.options.textSize&&(t.style.fontSize=this.options.textSize+"pt"),t.style.lineHeight=t.style.height}}),T.MarkerClusterer=T.uA.extend({options:{markers:{},girdSize:60,maxZoom:30,minClusterSize:2,isAverangeCenter:!1,styles:[{url:T.w.E+"/img/map/cluster/cluster0.png",size:[42,42],offset:new T.Point(-15,-13),textColor:"#000000",textSize:8,range:[0,80]},{url:T.w.E+"/img/map/cluster/cluster1.png",size:[42,42],offset:new T.Point(-20,-17),textColor:"#ffffff",textSize:10,range:[80,200]},{url:T.w.E+"/img/map/cluster/cluster2.png",size:[45,45],soffset:new T.Point(-10,-22),textColor:"#000000",textSize:10,range:[200,500]},{url:T.w.E+"/img/map/cluster/cluster3.png",size:[50,50],soffset:new T.Point(-10,-22),textColor:"#ffffff",textSize:10,range:[500,1e3]},{url:T.w.E+"/img/map/cluster/cluster4.png",size:[55,55],soffset:new T.Point(-10,-22),textColor:"#000000",textSize:10,range:[1e3]}]},initialize:function(t,i){T.S.setOptions(this,i),i&&i.minClusterSize&&(this.options.styles=i.styles),T.uA.prototype.initialize.call(this,i),i.markers&&this.addLayers(i.markers),this.options.oA=!1,t.addLayer(this),t.on("zoomend moveend",this._viewChangeEndNotClustering,this)},_viewChangeEndNotClustering:function(){var t=this.HA,i=this.Aa(),e=this.options.minClusterSize,s=this.options.isAverangeCenter;targetZoom=this.fW,t.bE(function(i){t.removeLayer(i)}),this.bA.tS(i,-1,targetZoom,function(i){if(i.fW!==targetZoom)for(var e,s=i.LO,n=0;ns.range[0]){e=s,e.childCount=childCount,e.iconSize=s.size;break}}var n="
"+childCount+"
";return e.html=n,new T.Us(e)},i||this.Rs())}}),T.Map.ContextMenu=T.Kr.extend({Tu:T.oQ.msPointer?"MSPointerDown":T.oQ.pointer?"pointerdown":"touchstart",v:{us:"tdt-contextmenu"},initialize:function(t){T.Kr.prototype.initialize.call(this,t),this.Is||(this.Is=[]),this.is=!1;var i=this.Ow=T._Q.s("div",T.Map.ContextMenu.us,t.Ow);i.style.zIndex=1e4,i.style.position="absolute",t.options.Os&&(i.style.width=t.options.Os+"px"),this.os(),T.oq.on(i,"click",T.oq.uw).on(i,"mousedown",T.oq.uw).on(i,"dblclick",T.oq.uw).on(i,"contextmenu",T.oq.uw)},oU:function(){T.oq.on(document,"keydown",this.QI,this),this.jE.on({contextmenu:this.Ps,mousedown:this.ps,movestart:this.ps,zoomstart:this.ps},this),T.oq.on(this.jE.getContainer(),"mouseleave",this.ps,this)},Ar:function(){T.oq.off(document,"keydown",this.QI,this),this.jE.off({contextmenu:this.Ps,mousedown:this.ps,movestart:this.ps,zoomstart:this.ps},this),T.oq.off(this.jE.getContainer(),"mouseleave",this.ps,this)},As:function(t,i){t instanceof T.dq&&(t=this.jE.BW(t)),this.as(t,i)},hide:function(){this.ps()},addItem:function(t){if(this.Ow)this.Ss(t);else if("-"!=t){var i=new T.MenuItem(t.text,t.callback);i.ss=0,this.Ds||(this.Ds=[]),this.Ds.push(i)}else this.Ds.push(t)},Ss:function(t,i){this.Is||(this.Is=[]),i=void 0!==i?i:this.Is.length;var e=this.ds(this.Ow,t,i);return this.Is.push(e),this.kW=!0,this.jE.wQ("contextmenu.additem",{contextmenu:this,el:e.el,index:i}),e.el},removeItem:function(t){var i=this.Ow;isNaN(t)||(t=i.children[t]),t&&(this.Fs(T.S.d(t)),this.kW=!0,this.jE.wQ("contextmenu.removeitem",{contextmenu:this,el:t}))},fs:function(){for(var t;this.Ow.children.length;)t=this.Ow.children[0],this.Fs(T.S.d(t))},Gs:function(){var t,i,e;for(i=0,e=this.Is.length;i":i.Ls&&(a=""),h.innerHTML=a+s.text,h.href="#",s.el=h,T.oq.on(h,"mouseover",this.ls,this.el).on(h,"mouseout",this.Zs,this.el).on(h,"mousedown",T.oq.stopPropagation).on(h,"click",r),s.id=T.S.d(h),s.callback=r,s.ss=0,s.Cs(i.isable),s},Fs:function(t){var i,e,s,n;for(s=0,n=this.Is.length;se.x?(s.style.left="auto",s.style.right=Math.max(e.x-t.x,0)+"px"):(s.style.left=Math.max(t.x,0)+"px",s.style.right="auto"),t.y+n.y>e.y?(s.style.top="auto",s.style.bottom=Math.max(e.y-t.y,0)+"px"):(s.style.top=Math.max(t.y,0)+"px",s.style.bottom="auto")},Bs:function(t){var i=this.Hw,e=t.style.display;return i&&!this.kW||(i={},t.style.left="-999999px",t.style.right="auto",t.style.display="block",i.x=t.offsetWidth,i.y=t.offsetHeight,t.style.left="auto",t.style.display=e,this.kW=!1),i},nu:function(t){this.ps()},QI:function(t){var i=t.keyCode;27===i&&this.ps()},ls:function(t){T._Q.Rq(t.target||t.srcElement,"over")},Zs:function(t){T._Q.Tq(t.target||t.srcElement,"over")}}),T.MenuItem=T.c.extend({initialize:function(t,i,e){this.text=t,this.callback=i,e&&(this.weight=e.weight,this.icon=e.icon),this.ss=0,this.isable=!0},setText:function(t){if(1!=this.ss)return this.text=t,this.el&&(this.el.innerHTML=this.text,T._Q.Rq(this.el,"tdt-contextmenu-item"),T.oq.on(this.el,"mouseover",this.ls,this.el).on(this.el,"mouseout",this.Zs,this.el)),this},ls:function(t){T._Q.Rq(this,"over")},Zs:function(t){T._Q.Tq(this,"over")},setCallback:function(t){return this.el&&(this.callback&&T.oq.off(this.el,"click",this.callback),this.callback=this.Ks(this.el,t),T.oq.on(this.el,"click",this.callback,this)),this.callback=t,this},Ks:function(t,i){return function(){this.cs&&i(this.cs)}},enable:function(){return this.isable=!0,this.Cs(this.isable),this},disable:function(){return this.isable=!1,this.Cs(this.isable),this},setIcon:function(t){var t;return this.el&&(t&&(html=""),this.el.innerHTML=html+this.text),this},Cs:function(t){var i=T.Map.ContextMenu.us+"-item",e=this.el;e&&e&&T._Q.Eq(e,i)&&(t?T._Q.Tq(e,i+"-disabled"):T._Q.Rq(e,i+"-disabled"))}}),T.ContextMenu=T.Map.ContextMenu.extend({includes:T.iQ.OQ,options:{width:120,Items:[]},initialize:function(t,i){t.width&&(this.options.width=t.width),t.Items&&(this.options.Items=t.Items),i&&this.Ns(i,this.options)},as:function(t,i){T.Map.ContextMenu.prototype.as.call(this,t,i),this.Is.length&&this.wQ("open",{pixel:t})},ps:function(){T.Map.ContextMenu.prototype.ps.call(this),this.is&&this.wQ("close")},Ns:function(t,i){t.options.contextmenu=!0,t.options.Os=this.options.width,t.options.Ds=this.options.Items,T.Map.ContextMenu.prototype.initialize.call(this,t),this.Is=this.getItems(),this.enable()},getItem:function(t){var i=this.getItems();return i[t]},removeItem:function(t){t.hasOwnProperty("el")?T.Map.ContextMenu.prototype.removeItem.call(this,t.el):T.Map.ContextMenu.prototype.removeItem.call(this,t)},addSeparator:function(){this.addItem("-")},removeSeparator:function(t){for(var i=0,e=0;this.Is[i];)1==this.Is[i].ss&&(e==t&&this.removeItem(i),e++),i++},getItems:function(){var t;t=this.Is?this.Is:this.Ds;var i=[];if(this.Is)for(index=0;index0&&this.JY(e,t,t.type)}},jY:function(t,i){var e,s;if(!this.KY||this._prehoveredLayer!=this.KY){for(e in this.SY)if(s=this.SY[e],s.options.mR&&s.HY(i)){T._Q.Rq(this.Ow,"tdt-interactive"),this._prehoveredLayer=this.KY,this.KY=s,this._prehoveredLayer!=this.KY&&this.JY([s],t,"mouseover");break}this.KY&&this._prehoveredLayer!=this.KY&&this.JY([this.KY],t)}},AY:function(t,i){var e=this.KY;!e||"mouseout"!==t.type&&e.HY(i)||(T._Q.Tq(this.Ow,"tdt-interactive"),this.JY([e],t,"mouseout"),this.KY=null)},JY:function(t,i,e){this.oE(i,e||i.type,[t[0]])},oE:function(t,i,e){if(!t._stopped&&(e=(e||[]).concat(this.jE.YE(t,i)),e.length)){var s=e[0];"contextmenu"===i&&s.EQ(i,!0)&&T.oq.preventDefault(t);var n={originalEvent:t};if("keypress"!==t.type){var o=!!s.PE;n.lnglat=o?s.PE():this.jE.Dw(n.layerPoint)}for(var h=0;h