webpackJsonp([14],{jkqj:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("Dd8w"),i=a.n(n),o=a("mvHQ"),r=a.n(o),s=a("//Fk"),m=a.n(s),l={name:"MonitorMap",props:{mapUrl:{type:String,default:"http://www.962121.net/gis_system/smimap/index.html#/"},iconUrl:{type:String,default:"http://www.962121.net/hmfmstest/shanghaiwuye/web/dataV/propertyinspector/static/icons/"},mapJs:{type:String,default:"http://www.962121.net/gis_system/smimap/mapdebug/ShsmiGis.Bridge.js"}},data:function(){return{map:null}},mounted:function(){this.inject().then(this.initMap)},computed:{sizeRate:function(){return Math.floor(1.48*screen.height/100/11)}},methods:{inject:function(){var e=this;return new m.a(function(t,a){if(document.getElementById("_mapjs"))t();else{var n=document.createElement("script");n.type="text/javascript",n.src=e.mapJs,n.setAttribute("id","_mapjs"),document.head.appendChild(n),window.onload=function(){return t()}}})},initMap:function(){var e=this,t=window.ShsmiGis;this.map=new t.Bridge({id:"map",url:this.mapUrl,onReady:function(){e.addListener(),e.$emit("complete")}})},addListener:function(){var e=this;this.map.addEventListener(function(t){switch(t.action.toLowerCase()){case"selectfeatures":if(!t.layername)return;e.$emit("event",t)}},this)},addPoint:function(e){var t=e.name,a=e.mode,n=void 0===a?"add":a,i=e.key,o=e.data,s=e.labelKey,m=void 0===s?null:s,l=e.icon,d=void 0===l?"test.png":l,c=e.size,p=void 0===c?20:c,u=e.color;if(this.map){this.removePoint(t);var h=this.getMapParams({data:o,key:i,labelKey:m,icon:d,size:p,color:u});h.name=t,h.mode=n,this.map.Invoke({ActionName:"displayJsonData",Parameters:r()(h)})}},removePoint:function(e){this.map&&this.map.Invoke({ActionName:"displayJsonData",Parameters:r()({name:e,mode:"delete"})})},drawStreet:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#00f2ff";this.map.Invoke({ActionName:"displayJsonData",Parameters:r()({name:e,mode:"add",dataArray:[{points:t.map(function(e){return{codX:e[0],codY:e[1],codZ:0}})}],popupEnabled:!1,legendVisible:!1,type:"polyline",renderer:{type:"unique-value",defaultSymbol:{type:"simple-line",color:a,width:3*this.sizeRate}}})})},getMapParams:function(e){var t=this,a=e.data,n=void 0===a?[]:a,o=e.key,r=e.labelKey,s=e.icon,m=e.size,l=e.color,d=void 0===l?"#47B3FF":l,c=[],p=[],u=[];for(var h in n[0])u.push({name:h,alias:h,type:"string"});return u.push({name:"name",alias:"标签",type:"string"}),n.forEach(function(e){var a={codX:e.X||e.x,codY:e.Y||e.y,codZ:0,attrs:i()({},e)};a.attrs.name=r?e[r]:"",c.push(a),p.push({value:e[o],label:(e[r]||e[o])+"",symbol:{type:"point-3d",symbolLayers:[{type:"icon",size:m*t.sizeRate,resource:{href:t.iconUrl+(e.icon||s)}}]}})}),{dataArray:c,popupEnabled:!1,legendVisible:!1,type:"point",fieldJsonArray:u,renderer:{type:"unique-value",field:o,defaultLabel:"无数据",uniqueValueInfos:p},labelsymbol:{symbol:{type:"text",color:d,haloSize:0,haloColor:"white"},labelPlacement:"center-right"}}},addGifPoint:function(e){var t=this,a=e.name,n=e.data,i=e.labelKey,o=e.icon,s=e.size,m=void 0===s?200:s,l=e.color,d=void 0===l?"#00FFFF":l;if(this.map){Array.isArray(n)||(n=[n]);var c={name:a,mode:"add",datas:n.map(function(e){return{name:i?e[i]:null,value:m*t.sizeRate,corrd:[e.X||e.x,e.Y||e.y],color:d}}),symbol:o?"image://"+this.iconUrl+o:"circle",position:"right"};this.map.Invoke({ActionName:"flashlayer",Parameters:r()(c)})}},removeGifPoint:function(e){this.map&&this.map.Invoke({ActionName:"flashlayer",Parameters:r()({name:e,mode:"delete"})})},focus:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6;if(this.map&&e&&t){var n={codX:e,codY:t,zoomlevel:a};this.map.Invoke({ActionName:"goToPosition",Parameters:r()(n)})}else console.error("传入的坐标点不能为空")},zoomIn:function(){this.map.Invoke({ActionName:"mapzoom",Parameters:{zoommode:"zoomin"}})},zoomOut:function(){this.map.Invoke({ActionName:"mapzoom",Parameters:{zoommode:"zoomout"}})}}},d={render:function(){var e=this.$createElement;return(this._self._c||e)("iframe",{attrs:{id:"map",frameborder:"0",scrolling:"no",allowtransparency:"true"}})},staticRenderFns:[]};var c=a("VU/8")(l,d,!1,function(e){a("lfRr")},"data-v-614ddbf4",null);t.default=c.exports},lfRr:function(e,t){}});
//# sourceMappingURL=14.d17ef94162fa21a5819a.js.map