UNPKG

flagwind-map

Version:
10 lines 144 kB
/*! * flagwind-map v1.0.40 * * Authors: * chendebao <hbchendb1985@gmail.com> * * Licensed under the MIT License. * Copyright (C) 2018-2019 Flagwind Inc. All rights reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.flagwind={})}(this,function(exports){"use strict";var __extends=this&&this.__extends||(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},function(t,e){function n(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),c,__assign=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},flagwind,q,r,flagwind,V,W,X,flagwind,Ba,Ca,flagwind,flagwind,flagwind,flagwind,jf,kf,flagwind,yf,zf,flagwind,rg,sg,flagwind,gh,hh,flagwind,oh,ph,flagwind,Ph,Qh,flagwind,ti,ui,flagwind,flagwind,flagwind,flagwind,flagwind,zo,Ao,flagwind,flagwind,vq,wq,flagwind,Eq,Fq,flagwind,flagwind,Dr,Er,flagwind,flagwind,Mr,Nr,flagwind,ls,flagwind,flagwind,flagwind,flagwind,flagwind,Ot,Pt,flagwind,Gw,Hw,flagwind,Lw,Mw,flagwind,Qw,Rw,flagwind,sx,tx,flagwind,cy,dy,flagwind,jy,ky,flagwind,py,qy,flagwind,vy,wy,flagwind,Ay,By,flagwind,Fy,Gy,flagwind,Ky,Ly,flagwind,Uy,Vy,flagwind,Zy,$y,flagwind,xz,yz,flagwind,Vz,Wz,flagwind,iA,jA,flagwind,wA,xA,flagwind,flagwind,NB,OB,flagwind,XB,YB,flagwind,OC,PC,QC,flagwind,flagwind,tE,uE,flagwind,DE,EE,flagwind,PE,QE,flagwind,flagwind,flagwind,eH,fH,flagwind,lH,mH,flagwind,AH,BH,flagwind,OH,flagwind,QH,RH,flagwind;q=flagwind||(flagwind={}),r=function(){function t(){this.rawData=[]}return t.prototype.clientSideClustering=function(t,e,n,i){console.time("fake-server-side-cluster");for(var o,r,s,a,l,p,h=i.extent,c=Math.round(i.width/t),u=Math.round(i.height/t),d=(h.xmax-h.xmin)/c,y=(h.ymax-h.ymin)/u,f=this.rawData.length,g=[],m=0;m<c;m++){r=(o=h.xmin+d*m)+d;for(var v=0;v<u;v++){a=(s=h.ymin+y*v)+y;var w=new esri.geometry.Extent({xmin:o,xmax:r,ymin:s,ymax:a});w.setSpatialReference(new esri.SpatialReference({wkid:4326})),g.push({extent:w,clusterCount:0,subTypeCounts:[],singles:[],points:[]})}}for(m=0;m<f;m++)if(p=this.rawData[m],!((l=esri.geometry.lngLatToXY(p.x,p.y))[0]<h.xmin||l[0]>h.xmax||l[1]<h.ymin||l[1]>h.ymax)){v=0;for(var b=g.length;v<b;v++){var M=g[v];if(!(l[0]<M.extent.xmin||l[0]>M.extent.xmax||l[1]<M.extent.ymin||l[1]>M.extent.ymax)){M.x=0<M.clusterCount?(p.x+M.x*M.clusterCount)/(M.clusterCount+1):p.x,M.y=0<M.clusterCount?(p.y+M.y*M.clusterCount)/(M.clusterCount+1):p.y,n&&M.points.push([p.x,p.y]),M.clusterCount++;for(var L=!1,S=0,_=M.subTypeCounts.length;S<_;S++)if(M.subTypeCounts[S].name===p.facilityType){M.subTypeCounts[S].count++,L=!0;break}L||M.subTypeCounts.push({name:p.facilityType,count:1}),M.singles.push(p)}}}for(var E=[],k=(m=0,g.length);m<k;m++)1===g[m].clusterCount?E.push(g[m].singles[0]):0<g[m].clusterCount&&(g[m].singles.length>e&&(g[m].singles=[]),E.push(g[m]));return console.timeEnd("fake-server-side-cluster"),E},t.prototype.getData=function(){return this.rawData},t.prototype.setData=function(t){this.rawData=t},t}(),q.DataManager=r,V=flagwind||(flagwind={}),W=function(t,e,n,i){this.type=t,this.listener=e,this.scope=n,this.once=i},X=function(){function t(t){this._source=t||this,this._events=new V.Map}return t.prototype.addListener=function(t,e,n,i){if(void 0===n&&(n=this),void 0===i&&(i=!1),!t||!e)throw new V.ArgumentException;var o=this._events.get(t);o||(o=new Array,this._events.set(t,o));for(var r=0,s=o;r<s.length;r++){var a=s[r];if(a.listener===e&&a.scope===n)return}o.push(new W(t,e,n,i))},t.prototype.removeListener=function(t,e,n){if(void 0===n&&(n=this),!t||!e)throw new V.ArgumentException;var i=this._events.get(t);if(i){for(var o=0,r=i.length;o<r;o++){var s=i[o];if(s.listener===e&&s.scope===n){i.splice(o,1);break}}0===i.length&&this._events.delete(t)}},t.prototype.hasListener=function(t){var e=this._events.get(t);return!!e&&0<e.length},t.prototype.dispatchEvent=function(){var t,e=arguments;switch(e.length){case 1:e[0]instanceof V.EventArgs?t=e[0]:V.Type.isString(e[0])&&(t=new V.EventArgs(e[0]));break;case 2:t=new V.EventArgs(e[0],e[1])}t.source=this._source;var n=this._events.get(t.type);if(n&&0!==n.length){for(var i=new Array,o=0,r=n;o<r.length;o++){(s=r[o]).listener.call(s.scope,t),s.once&&i.push(s)}for(;i.length;){var s=i.pop();this.removeListener(s.type,s.listener,s.scope)}}},t}(),V.EventProvider=X,Ba=flagwind||(flagwind={}),Ca=function(i){function t(t,e){var n=i.call(this)||this;return n.id=t,n.title=e,n.isShow=!0,n.id=t,n}return __extends(t,i),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.layer.graphics},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.graphics.map(function(t){return t.attributes})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"count",{get:function(){return this.layer?this.graphics.length:0},enumerable:!0,configurable:!0}),t.prototype.appendTo=function(t){this.layer.addToMap(t)},t.prototype.removeLayer=function(t){this.layer.removeFromMap(t)},t.prototype.clear=function(){this.layer.clear()},t.prototype.show=function(){this.isShow=!0,this.layer.show()},t.prototype.hide=function(){this.isShow=!1,this.layer.hide()},t.prototype.getGraphicById=function(t){for(var e=this.graphics,n=0;n<e.length;n++){if(e[n].attributes.id===t)return e[n]}return null},t.prototype.removeGraphicById=function(t){var e=this.getGraphicById(t);null!=e&&this.layer.remove(e)},t.prototype.on=function(t,e,n,i){void 0===n&&(n=this),void 0===i&&(i=!1),this.addListener(t,e,n,i)},t.prototype.off=function(t,e,n){void 0===n&&(n=this),this.removeListener(t,e,n)},t.prototype.add=function(t){this.layer.add(t)},t.prototype.remove=function(t){this.layer.remove(t)},t}(Ba.EventProvider),Ba.FlagwindFeatureLayer=Ca,function(r){r.BUSINESS_LAYER_OPTIONS={onLayerClick:function(t){console.log("onLayerClick")},onMapLoad:function(){console.log("onMapLoad")},onEvent:function(t,e){console.log("onEvent")},onCheckChanged:function(t){console.log("onCheckChanged")},onPositionChanged:function(t,e,n){console.log("onPositionChanged")},onVisibleChanged:function(t){console.log("onVisibleChanged")},changeStandardModel:function(t){return t},getInfoWindowContext:function(t){return{title:"\u8be6\u7ec6\u4fe1\u606f",content:"\u6ca1\u6709\u5b9a\u5236\u8be6\u7ec6\u4fe1\u606f"}},getDataList:function(){return new Promise(function(t,e){t([])})},getLastStatus:function(){return new Promise(function(t,e){t([])})},showInfoWindowCompleted:null,timeout:3e3,autoInit:!0,enableEdit:!0,selectMode:0,showTooltip:!1,showInfoWindow:!1,symbol:null,dataType:"point"};var t=function(o){function t(t,e,n){var i=o.call(this,e,n.title||"\u8bbe\u5907\u56fe\u5c42")||this;return i.flagwindMap=t,i.id=e,i.layerType=r.LayerType.point,i.isLoading=!1,i.options=__assign({},r.BUSINESS_LAYER_OPTIONS,n),i.layer=i.onCreateGraphicsLayer({id:i.id}),i.layerType=n.layerType,i.flagwindMap=t,i.options.autoInit&&i.onInit(),i}return __extends(t,o),Object.defineProperty(t.prototype,"map",{get:function(){return this.flagwindMap.map},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spatial",{get:function(){return this.flagwindMap.spatial},enumerable:!0,configurable:!0}),t.prototype.saveGraphicList=function(t){for(var e=0;e<t.length;e++)this.saveGraphicByModel(t[e])},t.prototype.updateGraphicList=function(t){for(var e=0;e<t.length;e++)this.updateGraphicByModel(t[e])},t.prototype.addGraphicList=function(t){for(var e=0;e<t.length;e++){this.getGraphicById(t[e].id)?console.warn("\u5df2\u5b58\u5728id\uff1a"+t[e].id+"\u8981\u7d20\u70b9"):this.addGraphicByModel(t[e])}},t.prototype.saveGraphicByModel=function(t){if((t=this.onChangeStandardModel(t))&&t.id){var e=this.getGraphicById(t.id);return e?this.updateGraphicByModel(t,e):this.addGraphicByModel(t)}},t.prototype.addGraphicByModel=function(t){var e=this.creatGraphicByModel(t);e&&this.add(e)},t.prototype.creatGraphicByModel=function(t){return t=this.onChangeStandardModel(t),this.onValidModel(t)?(void 0===t.selected&&(t.selected=!1),this.onCreatGraphicByModel(t)):(console.warn("\u65e0\u6548\u7684\u8981\u7d20\uff1a"+t),null)},t.prototype.updateGraphicByModel=function(t,e){void 0===e&&(e=null),t=this.onChangeStandardModel(t),this.onValidModel(t)&&(e||(e=this.getGraphicById(t.id)),null!=e&&(t=__assign({},e.attributes,t),this.onUpdateGraphicByModel(t)))},t.prototype.clearSelectStatus=function(){for(var t=this.graphics,e=0;e<t.length;e++)(t[e].attributes.selected||"boolean"!=typeof t[e].attributes.selected)&&this.setSelectStatus(t[e].attributes,!1);this.options.onCheckChanged({target:t?t.map(function(t){return t.attributes}):[],check:!1,selectedItems:this.getSelectedGraphics().map(function(t){return t.attributes})})},t.prototype.setSelectStatusByModels=function(t,e){e&&this.clearSelectStatus();for(var n=0;n<t.length;n++){var i=this.onChangeStandardModel(t[n]),o=this.getGraphicById(i.id);o&&this.setSelectStatus(o.attributes,!0)}this.options.onCheckChanged({target:t,check:!0,selectedItems:this.getSelectedGraphics().map(function(t){return t.attributes})})},t.prototype.getSelectedGraphics=function(){return this.graphics.filter(function(t){return t.attributes&&t.attributes.selected})},t.prototype.setSelectStatus=function(t,e){t.selected=e,this.onUpdateGraphicByModel(t)},t.prototype.getPoint=function(t){return this.flagwindMap.getPoint(t)},t.prototype.formPoint=function(t){return this.flagwindMap.onFormPoint(t)},t.prototype.openInfoWindow=function(t,e,n){var i=this.getGraphicById(t);i?e?this.flagwindMap.onShowInfoWindow({graphic:i,context:e,options:n||{}}):this.showInfoWindow({graphic:i}):console.warn("\u8be5\u6761\u6570\u636e\u4e0d\u5728\u56fe\u5c42\u5185\uff01id:",t)},t.prototype.closeInfoWindow=function(){this.flagwindMap.closeInfoWindow()},t.prototype.gotoCenterById=function(t){var e=this.getGraphicById(t);if(e){var n=this.getPoint(e.attributes);this.flagwindMap.centerAt(n.x,n.y)}else console.trace("-----\u8be5\u6761\u6570\u636e\u4e0d\u5728\u56fe\u5c42\u5185\uff01id:",t)},t.prototype.addToMap=function(){this.onAddLayerBefor(),this.flagwindMap.addFeatureLayer(this),this.onAddLayerAfter()},t.prototype.removeFromMap=function(){this.flagwindMap.removeFeatureLayer(this.id)},t.prototype.showInfoWindow=function(t){var e=this.onGetInfoWindowContext(t.graphic.attributes);this.flagwindMap.onShowInfoWindow({graphic:t.graphic,context:{type:"html",title:e.title,content:e.content},options:{}}),this.options.showInfoWindowCompleted&&this.options.showInfoWindowCompleted(t.graphic.attributes)},t.prototype.showDataList=function(){var e=this;return this.isLoading=!0,this.fireEvent("showDataList",{action:"start"}),this.options.getDataList().then(function(t){e.isLoading=!1,e.saveGraphicList(t),e.fireEvent("showDataList",{action:"end",attributes:t})}).catch(function(t){e.isLoading=!1,console.log("\u52a0\u8f7d\u56fe\u5c42\u6570\u636e\u65f6\u53d1\u751f\u4e86\u9519\u8bef\uff1a",t),e.fireEvent("showDataList",{action:"error",attributes:t})})},t.prototype.start=function(){var t=this;this.timer=setInterval(function(){t.updateStatus()},this.options.timeout||2e4)},t.prototype.stop=function(){this.timer&&clearInterval(this.timer)},t.prototype.updateStatus=function(){var e=this;this.isLoading=!0,this.fireEvent("updateStatus",{action:"start"}),this.options.getLastStatus().then(function(t){e.isLoading=!1,e.saveGraphicList(t),e.fireEvent("updateStatus",{action:"end",attributes:t})}).catch(function(t){e.isLoading=!1,console.log("\u52a0\u8f7d\u5361\u53e3\u72b6\u6001\u65f6\u53d1\u751f\u4e86\u9519\u8bef\uff1a",t),e.fireEvent("updateStatus",{action:"error",attributes:t})})},t.prototype.onGetInfoWindowContext=function(t){return this.options.getInfoWindowContext(t)},t.prototype.onInit=function(){var t=this;this.addToMap(),this.flagwindMap.loaded?this.onLoad():this.flagwindMap.on("onLoad",function(){return t.onLoad()})},t.prototype.onAddLayerBefor=function(){},t.prototype.onAddLayerAfter=function(){},t.prototype.onLoad=function(){try{this.layer._map||(this.layer._map=this.flagwindMap.innerMap),this.registerEvent(),this.onMapLoad()}catch(t){console.error(t)}},t.prototype.onMapLoad=function(){this.options.onMapLoad()},t.prototype.registerEvent=function(){var e=this;this.on("onClick",function(t){e.onLayerClick(e,t.data)}),this.on("onMouseOver",function(t){e.options.showTooltip&&e.flagwindMap.onShowTooltip(t.data.graphic),e.fireEvent("onMouseOver",t.data)}),this.on("onMouseOut",function(t){e.options.showTooltip&&e.flagwindMap.onHideTooltip(),e.fireEvent("onMouseOut",t.data)})},t.prototype.onLayerClick=function(t,e){if(t.options.onLayerClick&&t.options.onLayerClick(e),t.options.showInfoWindow&&(e.graphic.attributes.eventName="",t.showInfoWindow(e)),t.options.selectMode){if(t.options.selectMode===r.SelectMode.multiple){var n=e.graphic.attributes;e.graphic.attributes.selected?t.setSelectStatus(n,!1):t.setSelectStatus(n,!0)}else{t.clearSelectStatus();n=e.graphic.attributes;t.setSelectStatus(n,!0)}t.options.onCheckChanged({target:[e.graphic.attributes],check:e.graphic.attributes.selected,selectedItems:t.getSelectedGraphics()})}},t.prototype.fireEvent=function(t,e){this.options.onEvent(t,e)},t.prototype.onValidModel=function(t){switch(this.layerType){case r.LayerType.point:return t.id&&t.longitude&&t.latitude;case r.LayerType.polyline:return t.id&&t.polyline;case r.LayerType.polygon:return t.id&&t.polygon;default:return t.id&&t.longitude&&t.latitude}},t.prototype.onChangeStandardModel=function(t){return this.options.changeStandardModel(t)},t}(r.FlagwindFeatureLayer);r.FlagwindBusinessLayer=t}(flagwind||(flagwind={})),function(l){l.ESRI_CLUSTER_LAYER_OPTIONS={onEvent:function(t,e){switch(t){case"onMouseOver":e.graphic.getNode()&&e.graphic.getNode().classList.add("marker-scale");break;case"onMouseOut":e.graphic.getNode()&&e.graphic.getNode().classList.remove("marker-scale")}},symbol:{width:32,height:32},enableCluster:!0,cluster:{font:{color:"#FF0000",outline:null,size:6},singleFlareAtCount:10,flareShowMode:"mouse",preClustered:!1,ratio:75,areaDisplay:!1,levels:{xl:{start:1001,end:1/0,size:32,color:{line:[200,52,59,.8],fill:[250,65,74,.8]}},lg:{start:151,end:1e3,size:28,color:{line:[41,163,41,.8],fill:[51,204,51,.8]}},md:{start:20,end:150,size:24,color:{line:[82,163,204,.8],fill:[102,204,255,.8]}},sm:{start:0,end:19,size:22,color:{line:[230,184,92,.8],fill:[255,204,102,.8]}}},clusteringBegin:function(){console.log("clustering begin")},clusteringComplete:function(){console.log("clustering complete")}},layerType:"point"};var t=function(o){function t(t,e,n){var i=o.call(this,t,e,__assign({},l.ESRI_CLUSTER_LAYER_OPTIONS,n))||this;return i.options.enableCluster&&(i.dataManager=new l.DataManager),i}return __extends(t,o),t.prototype.onCreateGraphicsLayer=function(t){var e,n=this;return(e=this.enableCluster?this.createClusterLayer(this.options.cluster):new esri.layers.GraphicsLayer(t)).on("mouse-over",function(t){return n.dispatchEvent("onMouseOver",t)}),e.on("mouse-out",function(t){return n.dispatchEvent("onMouseOut",t)}),e.on("mouse-up",function(t){return n.dispatchEvent("onMouseUp",t)}),e.on("mouse-down",function(t){return n.dispatchEvent("onMouseDown",t)}),e.on("click",function(t){return n.dispatchEvent("onClick",t)}),e.on("dbl-click",function(t){return n.dispatchEvent("onDblClick",t)}),e.addToMap=function(t){t.addLayer(this)},e.removeFromMap=function(t){try{this._map||(this._map=t),t.removeLayer(this)}catch(t){console.warn(t)}},e},t.prototype.createClusterLayer=function(t){var e=new esri.layers.ClusterLayer(__assign({id:this.id,spatialReference:this.flagwindMap.spatial,xPropertyName:"longitude",yPropertyName:"latitude",subTypeFlareProperty:"kind",singleFlareTooltipProperty:""},t)),n=(new esri.symbol.SimpleMarkerSymbol).setSize(6).setColor(t.font.color).setOutline(t.font.outline),i=new esri.renderer.ClassBreaksRenderer(n,"clusterCount"),o=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,t.levels.xl.size,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.xl.color.line),1),new dojo.Color(t.levels.xl.color.fill)),r=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,t.levels.lg.size,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.lg.color.line),1),new dojo.Color(t.levels.lg.color.fill)),s=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,t.levels.md.size,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.md.color.line),1),new dojo.Color(t.levels.md.color.fill)),a=new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE,t.levels.sm.size,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.sm.color.line),1),new dojo.Color(t.levels.sm.color.fill));if(i.addBreak(t.levels.sm.start,t.levels.sm.end,a),i.addBreak(t.levels.md.start,t.levels.md.end,s),i.addBreak(t.levels.lg.start,t.levels.lg.end,r),i.addBreak(t.levels.xl.start,t.levels.xl.end,o),t.areaDisplay){var l=(new esri.symbol.SimpleFillSymbol).setStyle(esri.symbol.SimpleFillSymbol.STYLE_SOLID).setColor(new dojo.Color([0,0,0,.2])).setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color([0,0,0,.3]),1)),p=new esri.renderer.ClassBreaksRenderer(l,"clusterCount"),h=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.xl.color.line),1),new dojo.Color(t.levels.xl.color.fill)),c=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.lg.color.line),1),new dojo.Color(t.levels.lg.color.fill)),u=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.md.color.line),1),new dojo.Color(t.levels.md.color.fill)),d=new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new dojo.Color(t.levels.sm.color.line),1),new dojo.Color(t.levels.sm.color.fill));p.addBreak(t.levels.sm.start,t.levels.sm.end,d),p.addBreak(t.levels.md.start,t.levels.md.end,u),p.addBreak(t.levels.lg.start,t.levels.lg.end,c),p.addBreak(t.levels.xl.start,t.levels.xl.end,h),e.setRenderer(i,p)}else e.setRenderer(i);return e.allData=[],e._graphics=[],e},t.prototype.addClusters=function(){var t=this.graphics.map(function(t){return t.attributes});if(this.layer.clear(),this.dataManager.setData(t),this.options.cluster.preClustered)this.getPreClusteredGraphics();else{var e=this.dataManager.getData();this.layer.addData(e)}},t.prototype.getPreClusteredGraphics=function(){var t=this.options,e=t.displaySingleFlaresAtCount,n=t.ratio,i=this.dataManager.clientSideClustering(n,e,t.areaDisplay,this.flagwindMap.map);this.layer.addPreClusteredData(i)},t.prototype.getImageUrl=function(t){var e=this.options.symbol.imageUrl;if("string"==typeof e&&e){var n="imageUrl"+(t.status||"")+(t.selected?"checked":""),i=this.options[n]||this.options.symbol[n]||e,o=i.lastIndexOf("."),r=i.substring(0,o),s=i.substring(o+1);return t.selected?r+"_checked."+s:r+"."+s}var a=t.status;null==a&&(a="");n="image"+a+(t.selected?"checked":"");return this.options[n]||this.options.symbol[n]||this.options.image},Object.defineProperty(t.prototype,"enableCluster",{get:function(){return this.options.enableCluster},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"singles",{get:function(){return this.layer.singles||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clusters",{get:function(){return this.layer.clusters||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.enableCluster?this.layer._graphics:this.layer.graphics},enumerable:!0,configurable:!0}),t.prototype.saveGraphicList=function(t){for(var e=0;e<t.length;e++)this.saveGraphicByModel(t[e]);this.enableCluster&&this.addClusters()},t.prototype.addGraphicList=function(t){for(var e=0;e<t.length;e++)this.addGraphicByModel(t[e]);this.enableCluster&&this.addClusters()},t.prototype.updateGraphicList=function(t){for(var e=0;e<t.length;e++)this.updateGraphicByModel(t[e]);this.enableCluster&&this.addClusters()},t.prototype.onCreatGraphicByModel=function(t){var e=this.getImageUrl(t),n=this.getPoint(t),i=this.options.symbol.width,o=this.options.symbol.height,r=new esri.symbol.PictureMarkerSymbol(e,i,o),s=__assign({},t,{__type:this.layerType});return new esri.Graphic(n,r,s)},t.prototype.onUpdateGraphicByModel=function(t){var e=this.getImageUrl(t),n=this.getPoint(t),i=this.options.symbol.width,o=this.options.symbol.height,r=new esri.symbol.PictureMarkerSymbol(e,i,o),s=this.getGraphicById(t.id),a=s.geometry;s.setGeometry(n),s.setSymbol(r),s.attributes=__assign({},s.attributes,t,{__type:this.layerType}),s.draw(),l.MapUtils.isEqualPoint(n,a)||this.options.onPositionChanged(n,a,s.attributes)},t.prototype.add=function(t){this.enableCluster?this.layer._graphics.push(t):this.layer.add(t)},t.prototype.remove=function(t){if(this.enableCluster){var e=this.layer._graphics.indexOf(t);0<=e&&this.layer._graphics.splice(e,1)}else this.layer.remove(t)},t}(l.FlagwindBusinessLayer);l.EsriClusterLayer=t}(flagwind||(flagwind={})),function(r){var t;(t=r.MapType||(r.MapType={})).arcgis="arcgis",t.minemap="minemap",r.MAP_OPTIONS={onMapLoad:function(){console.log("onMapLoad")},onZoomStart:function(t){console.log("onZoomStart")},onZoom:function(t){console.log("onMapZoom")},onZoomEnd:function(t){console.log("onZoomEnd")},onMapClick:function(t){console.log("onMapClick")},formPoint:function(t,e){return{lat:t,lon:e}},toPoint:function(t,e){return{lat:t,lon:e}}};var e=function(o){function t(t,e,n){var i=o.call(this)||this;return i.mapSetting=t,i.mapElement=e,i.featureLayers=[],i.baseLayers=[],i.loaded=!1,i.options=__assign({},r.MAP_OPTIONS,n),i}return __extends(t,o),t.prototype.onFormPoint=function(t){var e={lat:t.y,lon:t.x};return t.latitude&&t.longitude&&(e.lon=t.longitude,e.lat=t.latitude),this.spatial.wkid!==this.mapSetting.wkidFromApp&&(e=3857===this.spatial.wkid&&4326===this.mapSetting.wkidFromApp?r.MapUtils.mercator2lonlat(e.lat,e.lon):102100===this.spatial.wkid&&4326===this.mapSetting.wkidFromApp?r.MapUtils.mercator_decrypt(e.lat,e.lon):4326===this.spatial.wkid&&3857===this.mapSetting.wkidFromApp?r.MapUtils.mercator_decrypt(e.lat,e.lon):4326===this.spatial.wkid&&3889===this.mapSetting.wkidFromApp?r.MapUtils.gcj_decrypt_exact(e.lat,e.lon):this.options.formPoint(e.lat,e.lon)),{longitude:parseFloat(e.lon.toFixed(8)),latitude:parseFloat(e.lat.toFixed(8))}},t.prototype.onToPoint=function(t){var e={lat:t.latitude||t.lat,lon:t.longitude||t.lon};return this.validGeometryModel(t)||(e.lon=t.x||e.lon,e.lat=t.y||e.lat),this.spatial.wkid!==this.mapSetting.wkidFromApp&&(e=102100===this.spatial.wkid&&4326===this.mapSetting.wkidFromApp?r.MapUtils.mercator_encrypt(e.lat,e.lon):4326===this.spatial.wkid&&3857===this.mapSetting.wkidFromApp?r.MapUtils.mercator_encrypt(e.lat,e.lon):4326===this.spatial.wkid&&3589===this.mapSetting.wkidFromApp?r.MapUtils.gcj_decrypt_exact(e.lat,e.lon):this.options.toPoint(e.lat,e.lon)),this.onCreatePoint({x:e.lon,y:e.lat,spatial:this.spatial})},t.prototype.validGeometryModel=function(t){return r.MapUtils.validGeometryModel(t)},t.prototype.on=function(t,e,n,i){void 0===n&&(n=this),void 0===i&&(i=!1),this.addListener(t,e,n,i)},t.prototype.off=function(t,e,n){void 0===n&&(n=this),this.removeListener(t,e,n)},Object.defineProperty(t.prototype,"map",{get:function(){return this.innerMap},enumerable:!0,configurable:!0}),t.prototype.closeInfoWindow=function(){this.onCloseInfoWindow()},t.prototype.centerAt=function(){var t,e=arguments;switch(e.length){case 0:this.mapSetting.center&&2===this.mapSetting.center.length&&(t=this.getPoint({x:this.mapSetting.center[0],y:this.mapSetting.center[1]}));break;case 1:case 2:t=this.onCreatePoint({x:e[0],y:e[1],spatial:this.spatial})}return t?this.onCenterAt(t):new Promise(function(t,e){t()})},t.prototype.setZoom=function(t){return this.onZoom(t)},t.prototype.getPoint=function(t){return this.onToPoint(t)},t.prototype.getBaseLayerById=function(e){var t=this.baseLayers.filter(function(t){return t.id===e});return t&&0<t.length?t[0]:null},t.prototype.showBaseLayers=function(){this.baseLayers&&this.baseLayers.forEach(function(t){return t.show()})},t.prototype.hideBaseLayers=function(){this.baseLayers&&this.baseLayers.forEach(function(t){return t.hide()})},t.prototype.showBaseLayer=function(t){var e=this.getBaseLayerById(t);return!!e&&(e.show(),!0)},t.prototype.hideBaseLayer=function(t){var e=this.getBaseLayerById(t);return!!e&&(e.hide(),!0)},t.prototype.destroy=function(){this.onDestroy()},t.prototype.getFeatureLayerById=function(e){var t=this.featureLayers.filter(function(t){return t.id===e});return null!=t&&0<t.length?t[0]:null},t.prototype.addFeatureLayer=function(t){if(this.getFeatureLayerById(t.id))throw Error("\u56fe\u5c42"+t.id+"\u5df2\u5b58\u5728");this.featureLayers.push(t),t.appendTo(this.innerMap)},t.prototype.removeFeatureLayer=function(t){var e=this.getFeatureLayerById(t);if(e){e.removeLayer(this.innerMap);var n=this.featureLayers.indexOf(e);return this.featureLayers.splice(n,1),!0}return!1},t.prototype.showFeatureLayer=function(t){var e=this.getFeatureLayerById(t);return!!e&&(e.show(),!0)},t.prototype.hideFeatureLayer=function(t){var e=this.getFeatureLayerById(t);return!!e&&(e.hide(),!0)},t.prototype.onInit=function(){var n=this;this.onCreateMap(),this.onCreateBaseLayers(),this.on("onLoad",function(){try{n.loaded=!0,n.centerAt(),n.onMapLoad()}catch(t){console.error(t)}});for(var t=Object.keys(this.options).filter(function(t){return 0<=t.indexOf("on")}),e=function(e){return"onMapClick"===e?"continue":"onMapLoad"===e?"continue":void(i.options[e]&&i.on(e,function(t){n.options[e](t.data)}))},i=this,o=0,r=t;o<r.length;o++){e(r[o])}this.on("onClick",function(t){n.options.onMapClick(t)})},t.prototype.onMapLoad=function(){this.options.onMapLoad&&this.options.onMapLoad()},t}(r.EventProvider);r.FlagwindMap=e}(flagwind||(flagwind={})),jf=flagwind||(flagwind={}),kf=function(){function t(t){this.flagwindMap=t,this.enabled=!1}return t.prototype.startup=function(e){var n=this,t=e.menus;this.menu=new dijit.Menu({onOpen:function(t){n.point=n.getMapPointFromMenuPosition(t,n.flagwindMap.innerMap)}});for(var i=0;i<t.length;i++)this.menu.addChild(new dijit.MenuItem({label:t[i],onClick:function(t){e.onClick(this.label)}}));this.menu.startup()},t.prototype.enable=function(){this.enabled?console.warn("\u5df2\u7ecf\u5f00\u542f\u5feb\u6377\u83dc\u5355"):(this.enabled=!0,this.menu.bindDomNode(this.flagwindMap.innerMap.container))},t.prototype.disable=function(){this.enabled=!1,this.menu.unBindDomNode(this.flagwindMap.innerMap.container)},t.prototype.getMapPointFromMenuPosition=function(t,e){var n=t.x,i=t.y;switch(t.corner){case"TR":n+=t.w;break;case"BL":i+=t.h;break;case"BR":n+=t.w,i+=t.h}var o=new esri.geometry.Point(n-e.position.x,i-e.position.y);return e.toMap(o)},t}(),jf.EsriContextMenu=kf,yf=flagwind||(flagwind={}),zf=function(o){function t(t,e){var n=o.call(this,"edit_"+t.id,"\u7f16\u8f91\u56fe\u5c42")||this;n.graphic=null,n.originInfo={},n.options=__assign({},yf.EDIT_LAYER_OPTIONS,e),n.layer=n.onCreateGraphicsLayer({id:n.id}),n.businessLayer=t;var i=n.businessLayer.options.getInfoWindowContext;return n.businessLayer.options.getInfoWindowContext=function(t){var e=i(t);return e.content+="<a key='"+t.id+"' id='edit_point_"+t.id+"' class='fm-btn edit-point'>\u66f4\u65b0\u5750\u6807</a>",e},n.businessLayer.options.showInfoWindowCompleted=function(t){dojo.connect(dojo.byId("edit_point_"+t.id),"onclick",function(t){var e=t.target.attributes.key.value;n.activateEdit(e)})},n.flagwindMap=t.flagwindMap,n.editObj=new esri.toolbars.Edit(n.flagwindMap.innerMap),n.flagwindMap.addFeatureLayer(n),n.flagwindMap.innerMap.loaded?n.onLoad():n.flagwindMap.innerMap.on("load",function(){n.onLoad()}),n}return __extends(t,o),t.prototype.activateEdit=function(t){var e=this.businessLayer.getGraphicById(t);if(e){this.businessLayer.hide(),this.show();var n=this.businessLayer.creatGraphicByModel(e.attributes);this.layer.add(n),n.attributes.eventName="start";var i=esri.toolbars.Edit.MOVE;this.editObj.activate(i,n,null),this.graphic=n,this.originInfo=n.attributes,this.showInfoWindow()}else console.log("\u65e0\u6548\u7684\u4ee3\u7801\uff1a"+t)},t.prototype.cancelEdit=function(t){this.editObj.deactivate(),this.clear(),this.hide(),this.flagwindMap.innerMap.infoWindow.hide(),this.businessLayer.show();var e=this.businessLayer.getGraphicById(t);e.attributes.eventName="delete",this.businessLayer.showInfoWindow({graphic:e})},t.prototype.onLoad=function(){this.layer._map||(this.layer._map=this.flagwindMap.innerMap);try{this.registerEvent()}catch(t){console.error(t)}},Object.defineProperty(t.prototype,"map",{get:function(){return this.flagwindMap.map},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"spatial",{get:function(){return this.flagwindMap.spatial},enumerable:!0,configurable:!0}),t.prototype.onCreateGraphicsLayer=function(t){var e=new esri.layers.GraphicsLayer(t);return e.addToMap=function(t){t.addLayer(this)},e.removeFromMap=function(t){t.removeLayer(this)},e},t.prototype.onChanged=function(t,e){return this.options.onEditInfo(t,e)},t.prototype.showInfoWindow=function(){var n=this,t=this.businessLayer.title;this.map.infoWindow.setTitle(t);var e="";e='<div><span class=\'opertate-tooltip\'>\u64cd\u4f5c\u63d0\u793a\uff1a\u8bf7\u62d6\u52a8\u56fe\u6807\u81f3\u76ee\u6807\u4f4d\u7f6e\uff0c\u70b9\u51fb "\u5b8c\u6210" \u4f1a\u63d0\u793a\u4fdd\u5b58\u4fee\u6539\uff0c\u70b9\u51fb"\u53d6\u6d88"\u5c06\u53d6\u6d88\u4fee\u6539\uff01</span></div><br/>',e+="<a><span id='resetOrdinate' class='btn btn-primary btn-transparent outline mt5 deleteOrdinate' key="+this.graphic.attributes.id+">\u53d6\u6d88</span></a>",e+="<a><span id='applyOrdinate' class='btn btn-primary btn-transparent outline mt5 deleteOrdinate' key="+this.graphic.attributes.id+">\u5b8c\u6210</span></a>",this.map.infoWindow.setContent(e);var i=this.graphic.geometry;this.map.infoWindow.show(i),dojo.connect(dojo.byId("resetOrdinate"),"onclick",function(t){var e=t.target.attributes.key.value;n.cancelEdit(e)}),dojo.connect(dojo.byId("applyOrdinate"),"onclick",function(t){var e=t.target.attributes.key.value;n.confirm(e)})},t.prototype.confirm=function(i){var o=this;this.options.confirm({title:"\u786e\u5b9a\u8981\u8fdb\u884c\u66f4\u6539\u5417\uff1f",content:"\u521d\u59cb\u5750\u6807\u503c\uff08\u7ecf\u5ea6\uff09:"+this.originInfo.longitude+",\uff08\u7eac\u5ea6\uff09:"+this.originInfo.latitude+"\r\u5f53\u524d\u5750\u6807\u503c\uff08\u7ecf\u5ea6\uff09:"+this.graphic.geometry.x.toFixed(8)+",\uff08\u7eac\u5ea6\uff09:"+this.graphic.geometry.y.toFixed(8),onOk:function(){var t=o.graphic.geometry,e=o.businessLayer.formPoint(t),n=__assign({},o.graphic.attributes,e);o.options.onEditInfo({id:i,latitude:n.latitude,longitude:n.longitude},!0).then(function(t){o.businessLayer.removeGraphicById(n.id),o.businessLayer.addGraphicList([n])})},onCancel:function(){o.options.onEditInfo({id:i,latitude:o.originInfo.latitude,longitude:o.originInfo.longitude},!1)}}),this.graphic.attributes.eventName="stop",this.clear(),this.hide(),this.map.infoWindow.hide(),this.businessLayer.show()},t.prototype.registerEvent=function(){var e=this;dojo.connect(this.layer,"onClick",function(t){e.graphic=t.graphic,e.onLayerClick(e,t)}),console.log("\u7f16\u8f91\u5bf9\u8c61\uff1a"+this.editObj),dojo.on(this.editObj,"graphic-first-move",function(t){console.log("\u8981\u7d20\u79fb\u52a8---------graphic-first-move"),e.flagwindMap.innerMap.infoWindow.hide()}),dojo.on(this.editObj,"graphic-click",function(t){e.showInfoWindow()}),dojo.on(this.editObj,"graphic-move-stop",function(t){e.showInfoWindow()})},t.prototype.onLayerClick=function(t,e){t.businessLayer.options.onLayerClick&&t.businessLayer.options.onLayerClick(e),t.businessLayer.options.showInfoWindow&&t.businessLayer.showInfoWindow(e)},t}(yf.FlagwindFeatureLayer),yf.EsriEditLayer=zf,rg=flagwind||(flagwind={}),sg=function(n){function t(t){var e=n.call(this)||this;return e.options=t,e.isShow=!0,e.layer=e.onCreateGraphicsLayer(t),e}return __extends(t,n),Object.defineProperty(t.prototype,"graphics",{get:function(){return this.layer.graphics},enumerable:!0,configurable:!0}),t.prototype.appendTo=function(t){this.layer.addToMap(t)},t.prototype.removeLayer=function(t){this.layer.removeFromMap(t)},t.prototype.clear=function(){this.layer.clear()},t.prototype.show=function(){this.isShow=!0,this.layer.show()},t.prototype.hide=function(){this.isShow=!1,this.layer.hide()},t.prototype.setGeometry=function(t,e){this.getGraphicByName(t).forEach(function(t){t.setGeometry(e)})},t.prototype.setSymbol=function(t,e){this.getGraphicByName(t).forEach(function(t){t.setSymbol(e)})},t.prototype.showGraphic=function(t){this.getGraphicByName(t).forEach(function(t){t.show()})},t.prototype.hideGraphic=function(t){this.getGraphicByName(t).forEach(function(t){t.hide()})},t.prototype.addGraphic=function(i){for(var o=this,t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];void 0!==t&&t.forEach(function(t,e){if(t){var n=t.attributes;n.__master=0===e,n.__name=i,o.layer.add(t)}})},t.prototype.getMasterGraphicByName=function(n){return this.graphics.forEach(function(t){var e=t.attributes;if(n===e.__name&&e.__master)return t}),null},t.prototype.getGraphicByName=function(t){for(var e=[],n=0;n<this.graphics.length;n++){this.graphics[n].attributes.__name===t&&e.push(this.graphics[n])}return e},t.prototype.removeGraphicByName=function(t){var e=this,n=this.getGraphicByName(t);null!=n&&n.forEach(function(t){e.layer.remove(t)})},t.prototype.on=function(t,e,n,i){void 0===n&&(n=this),void 0===i&&(i=!1),this.addListener(t,e,n,i)},t.prototype.off=function(t,e,n){void 0===n&&(n=this),this.removeListener(t,e,n)},t}(rg.EventProvider),rg.FlagwindGroupLayer=sg,gh=flagwind||(flagwind={}),hh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onCreateGraphicsLayer=function(t){var e=new esri.layers.GraphicsLayer(t);return e.addToMap=function(t){t.addLayer(this)},e.removeFromMap=function(t){t.removeLayer(this)},e},e}(gh.FlagwindGroupLayer),gh.EsriGroupLayer=hh,oh=flagwind||(flagwind={}),ph=function(){function t(t,e,n){this.flagwindMap=t,this.isShow=!0,this.id=e||"heatmapLayer",this.options=__assign({},oh.HEATMAP_LAYER_OPTIONS,n),this.map=t.map,this.dataMap=new oh.Map,this.heatLayer=this.createHeatLayer(),this.appendTo(this.map)}return t.prototype.createHeatLayer=function(){var t={id:this.id,opacity:.7},e=new esri.layers.FeatureLayer({featureSet:null,layerDefinition:{geometryType:"esriGeometryPoint",fields:[{name:"count",type:"esriFieldTypeDouble",alias:"count"}]}},t);return this.heatmapRenderer=new esri.renderer.HeatmapRenderer(__assign({field:"count",blurRadius:this.options.blurRadius||12,colorStops:this.options.colorStops||[{ratio:0,color:"rgb(255, 219, 0, 0)"},{ratio:.6,color:"rgb(250, 146, 0)"},{ratio:.85,color:"rgb(250, 73, 0)"},{ratio:.95,color:"rgba(250, 0, 0)"}]},this.options)),e.setRenderer(this.heatmapRenderer),e},t.prototype.appendTo=function(t){t.addLayer(this.heatLayer)},t.prototype.removeLayer=function(t){t.removeLayer(this.heatLayer)},t.prototype.resize=function(){this.map.innerMap.resize()},t.prototype.clear=function(){this.dataMap.clear(),this.heatLayer.clear()},t.prototype.show=function(){this.isShow=!0,this.heatLayer.show()},t.prototype.hide=function(){this.isShow=!1,this.heatLayer.hide()},t.prototype.setMaxPixelIntensity=function(t){this.heatmapRenderer.setMaxPixelIntensity(t)},t.prototype.showDataList=function(t){var o=this,e=this.onChangeStandardModel(t);0!==e.length?(this.setMaxPixelIntensity(e.reduce(function(t,e){return Math.max(e.count,t)},1)),e.forEach(function(t){var e=o.flagwindMap.getPoint(t),n=new esri.symbol.SimpleMarkerSymbol,i=new esri.Graphic(e,n,t);o.heatLayer.add(i)})):console.log("\u672a\u4f20\u5165\u70ed\u70b9\u6570\u636e")},t.prototype.onChangeStandardModel=function(t){var o=this;return t.forEach(function(t){var e=o.options.changeStandardModel(t);if(e){var n=e.longitude+":"+e.latitude,i=o.dataMap.get(n);void 0!==i?(i.members.push(t),i.count=i.count+(e.count||1)):(i={longitude:e.longitude,latitude:e.latitude,members:[t],count:e.count||1},o.dataMap.set(n,i))}}),this.dataMap.values()},t}(),oh.EsriHeatmapLayer=ph,Ph=flagwind||(flagwind={}),Qh=function(i){function t(t,e){var n=i.call(this,e.id,e.title)||this;return n.flagwindMap=t,n.options=e,n.options=__assign({},Ph.LOCATION_LAYER_OPTIONS,n.options),n.layer=n.onCreateGraphicsLayer({id:n.id}),n.flagwindMap.addFeatureLayer(n),n.registerEvent(),n}return __extends(t,i),t.prototype.registerEvent=function(){var e=this;this.flagwindMap.on("onClick",function(t){e.point=t.data.mapPoint,e.locate()},this)},t.prototype.onCreateGraphicsLayer=function(t){var e=this,n=new esri.layers.GraphicsLayer(t);return n.on("mouse-over",function(t){return e.dispatchEvent("onMouseOver",t)}),n.on("mouse-out",function(t){return e.dispatchEvent("onMouseOut",t)}),n.on("mouse-up",function(t){return e.dispatchEvent("onMouseUp",t)}),n.on("mouse-down",function(t){return e.dispatchEvent("onMouseDown",t)}),n.on("click",function(t){return e.dispatchEvent("onClick",t)}),n.on("dbl-click",function(t){return e.dispatchEvent("onDblClick",t)}),n.addToMap=function(t){t.addLayer(this)},n.removeFromMap=function(t){t.removeLayer(this)},n},t.prototype.locate=function(){this.clear();var t=this.createGraphic(this.point);this.layer.add(t),this.options.onMapClick({point:this.point})},t.prototype.getFillSymbol=function(t,e){e=e||[38,101,196],t=t||2;var n=[60,137,253,.6];return new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,new esri.Color(n),t),new esri.Color(n))},t.prototype.createSymbol=function(t,e){var n=new esri.symbol.SimpleMarkerSymbol;return n.setPath(t),n.setSize(40),n.setColor(new dojo.Color(e)),n.setOutline(null),n},t.prototype.createGraphic=function(t){return new esri.Graphic(t,this.createSymbol("M511.999488 299.209616m-112.814392 0a110.245 110.245 0 1 0 225.628784 0 110.245 110.245 0 1 0-225.628784 0ZM47.208697 523.662621A0 11.396 0 1 1 47.208697 524.685927ZM511.949346 7.981788c-173.610036 0-314.358641 140.748604-314.358641 314.358641s314.358641 523.932774 314.358641 523.932774 314.358641-350.322737 314.358641-523.932774S685.558359 7.981788 511.949346 7.981788L511.949346 7.981788zM511.949346 453.323623c-86.805018 0-157.177785-70.371744-157.177785-157.176762 0-86.830601 70.372767-157.182902 157.177785-157.182902 86.825484 0 157.201322 70.352301 157.201322 157.182902C669.150668 382.952902 598.774831 453.323623 511.949346 453.323623L511.949346 453.323623zM511.949346 453.323623M583.236949 788.686646l-19.674085 34.075073c201.221908 3.617387 357.506347 30.455639 357.506347 63.026452 0 35.039028-180.857091 63.442938-403.955238 63.442938-309.208341 0-403.962401-28.404933-403.962401-63.442938 0-32.067346 151.486156-58.57507 348.201423-62.841234l-19.780509-34.259268c-214.366276 7.369851-378.251833 47.647183-378.251833 96.232738 0 53.81465 105.338117 97.443309 449.084065 97.443309 248.02077 0 449.082018-43.62559 449.082018-97.443309C961.487759 836.332806 797.602202 796.055474 583.236949 788.686646z","#13227a"))},t}(Ph.FlagwindFeatureLayer),Ph.EsriLocationLayer=Qh,ti=flagwind||(flagwind={}),ui=function(o){function t(t,e,n){var i=o.call(this,t,e,__assign({onMapClick:function(t){console.log("onMapClick:"+t.data.mapPoint.x+","+t.data.mapPoint.y)}},n))||this;return i.mapSetting=t,i.onInit(),i}return __extends(t,o),t.prototype.onAddEventListener=function(t,e){dojo.on(this.map,t,e)},t.prototype.onCenterAt=function(e){var n=this;return new Promise(function(t){n.map.centerAt(e).then(function(){t()})})},t.prototype.onCreatePoint=function(t){return new esri.geometry.Point(t.x,t.y,t.spatial||this.spatial)},t.prototype.onCreateMap=function(){var e=this;this.spatial=new esri.SpatialReference({wkid:this.mapSetting.wkid||4326});var t=this.mapSetting,n={wkid:t.wkid,center:t.center,logo:t.logo,slider:t.slider,sliderPosition:t.sliderPosition};if(void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.minZoom&&(n.minZoom=t.minZoom),void 0!==t.maxZoom&&(n.maxZoom=t.maxZoom),t.basemap&&"none"!==t.basemap&&(n.basemap=t.basemap),t.extent&&4===t.extent.length){var i=this.getPoint({x:t.extent[0],y:t.extent[1]}),o=this.getPoint({x:t.extent[2],y:t.extent[3]}),r=new esri.geometry.Extent(i.x,i.y,o.x,o.y,this.spatial);n.extent=r}var s=new esri.Map(this.mapElement,n);s.infoWindow.anchor="top",this.innerMap=s,this.tooltipElement=document.createElement("div"),this.tooltipElement.classList.add("flagwind-map-tooltip"),this.innerMap.root.appendChild(this.tooltipElement),s.on("load",function(t){e.dispatchEvent("onLoad",t)}),s.on("click",function(t){e.dispatchEvent("onClick",t)}),s.on("dbl-click",function(t){e.dispatchEvent("onDbClick",t)}),s.on("mouse-out",function(t){e.dispatchEvent("onMouseOut",t)}),s.on("mouse-over",function(t){e.dispatchEvent("onMouseOver",t)}),s.on("mouse-move",function(t){e.dispatchEvent("onMouseMove",t)}),s.on("mouse-wheel",function(t){e.dispatchEvent("onMouseWheel",t)}),s.on("zoom",function(t){e.dispatchEvent("onZoom",t)}),s.on("zoom-start",function(t){e.dispatchEvent("onZoomStart",t)}),s.on("zoom-end",function(t){e.dispatchEvent("onZoomEnd",t)}),s.on("pan",function(t){e.dispatchEvent("onPan",t)}),s.on("pan-start",function(t){e.dispatchEvent("onPanStart",t)}),s.on("pan-end",function(t){e.dispatchEvent("onPanEnd",t)}),s.on("update-start",function(t){e.dispatchEvent("onUpdateStart",t)}),s.on("update-end",function(t){e.dispatchEvent("onUpdateEnd",t)}),s.on("extent-change",function(t){e.dispatchEvent("onExtentChange",t)}),s.on("resize",function(t){e.dispatchEvent("onResize",t)})},t.prototype.onShowInfoWindow=function(t){if(this.innerMap.infoWindow&&this.innerMap.infoWindow.hide(),!t.context)throw new Error("\u672a\u8bbe\u7f6econtext,\u65e0\u6cd5\u663e\u793a\u7a97\u53e3");var e=this.getPoint(t.graphic.attributes);if(this.innerMap.infoWindow.setTitle(t.context.title),this.innerMap.infoWindow.setContent(t.context.content),t.options)if(t.options.width&&t.options.height&&this.innerMap.infoWindow.resize(t.options.width,t.options.height),t.options.offset){var n=this.innerMap.toScreen(e);n.x+=t.options.offset.x,n.y+=t.options.offset.y,this.innerMap.infoWindow.show(n)}else this.innerMap.infoWindow.show(e);else this.innerMap.infoWindow.show(e)},t.prototype.onCloseInfoWindow=function(){this.innerMap.infoWindow&&this.innerMap.infoWindow.hide()},t.prototype.onCreateBaseLayers=function(){var n=this,i=new Array;if(this.mapSetting.baseUrl){var t=new ti.EsriTiledLayer("base_arcgis_tiled",this.mapSetting.baseUrl,this.spatial,"\u74e6\u7247\u56fe\u5c42");i.push(t)}return this.mapSetting.tiledUrls&&this.mapSetting.tiledUrls.forEach(function(t){if(t.url){var e=new ti.EsriTiledLayer(t.id,t.url,n.spatial,t.title);i.push(e)}}),this.baseLayers=i,this.baseLayers.forEach(function(t){t.appendTo(n.innerMap)}),i},t.prototype.toScreen=function(){var t,e=arguments;switch(e.length){case 1:t=this.onToPoint(e[0]);break;case 2:t=this.onCreatePoint({x:e[0],y:e[1],spatial:this.spatial})}return t?this.innerMap.toScreen(t):null},t.prototype.onZoom=function(e){var n=this;return new Promise(function(t){n.map.setZoom(e).then(function(){t()})})},t.prototype.onShowTooltip=function(t){var e=t.attributes,n=new esri.geometry.Point(e.longitude,e.latitude,this.spatial),i=this.innerMap.toScreen(n),o=e.name;this.tooltipElement.innerHTML="<div>"+o+"</div>",this.tooltipElement.style.left=i.x+15+"px",this.tooltipElement.style.top=i.y+15+"px",this.tooltipElement.style.display="block"},t.prototype.onHideTooltip=function(){this.tooltipElement.style.display="none"},t.prototype.onDestroy=function(){try{this.tooltipElement&&(this.tooltipElement.remove(),this.tooltipElement=null),this.featureLayers&&(this.featureLayers.forEach(function(t){t.clear()}),this.featureLayers=[]),this.baseLayers&&(this.baseLayers=[]),this.innerMap&&this.innerMap.destroy&&(this.innerMap.destroy(),this.innerMap=null)}catch(t){console.error(t)}},t}(ti.FlagwindMap),ti.EsriMap=ui,function(l){l.ESRI_POINT_LAYER_OPTIONS={getImageUrl:null,onEvent:function(t,e){switch(t){case"onMouseOver":e.graphic.getNode()&&e.graphic.getNode().classList.add("marker-scale");break;case"onMouseOut":e.graphic.getNode()&&e.graphic.getNode().classList.remove("marker-scale")}},symbol:{width:32,height:32},layerType:"point"};var t=function(i){function t(t,e,n){return i.call(this,t,e,__assign({},l.ESRI_POINT_LAYER_OPTIONS,n))||this}return __extends(t,i),t.prototype.onCreateGraphicsLayer=function(t){var e=this,n=new esri.layers.GraphicsLayer(t);return n.on("mouse-over",function(t){return e.dispatchEvent("onMouseOver",t)}),n.on("mouse-out",function(t){return e.dispatchEvent("onMouseOut",t)}),n.on("mouse-up",function(t){return e.dispatchEvent("onMouseUp",t)}),n.on("mouse-down",function(t){return e.dispatchEvent("onMouseDown",t)}),n.on("click",function(t){return e.dispatchEvent("onClick",t)}),n.on("dbl-click",function(t){return e.dispatchEvent("onDblClick",t)}),n.addToMap=function(t){t.addLayer(this)},n.removeFromMap=function(t){try{this._map||(this._map=t),t.removeLayer(this)}catch(t){console.warn(t)}},n},t.prototype.getImageUrl=function(t){if(this.options.getImageUrl)return this.options.getImageUrl(t);var e=this.options.symbol.imageUrl;if("string"==typeof e&&e){var n="imageUrl"+(t.status||"")+(t.selected?"checked":""),i=this.options[n]||this.options.symbol[n]||e,o=i.lastIndexOf("."),r=i.substring(0,o),s=i.substring(o+1);return t.selected?r+"_checked."+s:r+"."+s}var a=t.status;null==a&&(a="");n="image"+a+(t.selected?"checked":"");return this.options[n]||this.options.symbol[n]||this.options.image},t.prototype.onCreatGraphicByModel=function(t){var e=this.getImageUrl(t),n=this.getPoint(t),i=this.options.symbol.width,o=this.options.symbol.height,r=new esri.symbol.PictureMarkerSymbol(e,i,o),s=__assign({},t,{__type:this.layerType});return new esri.Graphic(n,r,s)},t.prototype.onUpdateGraphicByModel=function(t){var e=this.getImageUrl(t),n=this.getPoint(t),i=this.options.symbol.width,o=this.options.symbol.height,r=new esri.symbol.PictureMarkerSymbol(e,i,o),s=this.getGraphicById(t.id),a=s.geometry;s.setGeometry(n),s.setSymbol(r),s.attributes=__assign({},s.attributes,t,{__type:this.layerType}),s.draw(),l.MapUtils.isEqualPoint(n,a)||this.options.onPositionChanged(n,a,s.attributes)},t}(l.FlagwindBusinessLayer);l.EsriPointLayer=t}(flagwind||(flagwind={})),function(o){o.ESRI_POLYGON_LAYER_OPTIONS={onEvent:function(t,e){"onMouseOver"===t?(e.graphic.symbol.setColor([247,247,247,.05]),e.graphic.draw()):"onMouseOut"===t&&(e.graphic.symbol.setColor([0,49,0,.45]),e.graphic.draw())},symbol:{lineWidth:3,lineColor:[255,255,255,.6],fillColor:[0,49,0,.45],lineType:"STYLE_DASH",fillType:"STYLE_SOLID"},layerType:"polygon"};var t=function(i){function t(t,e,n){return i.call(this,t,e,__assign({},o.ESRI_POLYGON_LAYER_OPTIONS,n))||this}return __extends(t,i),t.prototype.onCreateGraphicsLayer=function(t){var e=this,n=new esri.layers.GraphicsLayer(t);return n.on("mouse-over",function(t){return e.dispatchEvent("onMouseOver",t)}),n.on("mouse-out",function(t){return e.dispatchEvent("onMouseOut",t)}),n.on("mouse-up",function(t){return e.dispatchEvent("onMouseUp",t)}),n.on("mouse-down",function(t){return e.dispatchEvent("onMouseDown",t)}),n.on("click",function(t){return e.dispatchEvent("onClick",t)}),n.on("dbl-click",function(t){return e.dispatchEvent("onDblClick",t)}),n.addToMap=function(t){t.addLayer(this)},n.removeFromMap=function(t){t.removeLayer(this)},n},t.prototype.onCreatGraphicByModel=function(t){var e=this.getPolygon(t.polygon),n=this.getFillSymbol(this.options.symbol),i=__assign({},t,{__type:"polygon"});return new esri.Graphic(e,n,i)},t.prototype.onUpdateGraphicByModel=function(t){var e=this.getPolygon(t.polygon),n=this.getFillSymbol(this.options.symbol),i=this.getGraphicById(t.id);i.setGeometry(e),i.setSymbol(n),i.attributes=__assign({},i.attributes,t,{__type:"polygon"}),i.draw()},t.prototype.getPolygon=function(t){if(!t)return null;for(var e=new esri.geometry.Polygon(this.spatial),n=t.split(";"),i=[],o=0;o<n.length;o++)if(n[o]&&!(n[o].length<=0)){var r=n[o].split(","),s=this.getPoint({x:parseFloat(r[0]),y:parseFloat(r[1])});i.push([s.x,s.y])}return e.addRing(i),e},t.prototype.getFillSymbol=function(t){return new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol[t.fillType],new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol[t.lineType],new esri.Color(t.lineColor),t.lineWidth),new esri.Color(t.fillColor))},t}(o.FlagwindBusinessLayer);o.EsriPolygonLayer=t}(flagwind||(flagwind={})),function(r){r.ESRI_POLYLINE_LAYER_OPTIONS={symbol:{lineWidth:4,lineColor:[255,0,0],lineType:"STYLE_DASH",lineMiterLimit:2},layerType:"polyline"};var t=function(o){function t(t,e,n){var i=o.call(this,t,e,__assign({},r.ESRI_POLYLINE_LAYER_OPTIONS,n))||this;return i.onInit(),i}return __extends(t,o),t.prototype.onCreateGraphicsLayer=function(t){var e=this,n=new esri.layers.GraphicsLayer(t);return n.on("mouse-over",function(t){return e.dispatchEvent("onMouseOver",t)}),n.on("mouse-out",function(t){return e.dispatchEvent("onMouseOut",t)}),n.on("mouse-up",function(t){return e.dispatchEvent("onMouseUp",t)}),n.on("mouse-down",function(t){return e.dispatchEvent("onMouseDown",t)}),n.on("click",function(t){return e.dispatchEvent("onClick",t)}),n.on("dbl-click",function(t){return e.dispatchEvent("onDblClick",t)}),n.addToMap=fun