"use strict";(self["webpackChunk"]=self["webpackChunk"]||[]).push([[601],{7601:function(t,a,s){s.r(a),s.d(a,{default:function(){return l}});var n=function(){var t=this,a=t._self._c;return a("div",{staticClass:"tiandimap"},[a("div",{staticClass:"searchWrap"},[a("div",{staticClass:"search"},[a("input",{ref:"input",staticClass:"text"}),a("div",{staticClass:"btn",on:{click:t.searchFn}},[t._v("搜索")])]),t.showRes?a("div",{staticClass:"result"},t._l(t.dataList,(function(s){return a("div",{key:s.hotPointID,staticClass:"item",on:{click:function(a){return t.toLocal(s)}}},[a("span",{staticClass:"name"},[t._v(t._s(s.name))]),a("span",{staticClass:"addr"},[t._v(t._s(s.address))])])})),0):t._e()]),a("div",{staticClass:"map",staticStyle:{position:"absolute",width:"100vw",height:"100vh"},attrs:{id:"mapDiv"}})])},e=[],i=(s(1454),{name:"TiandiMap",data(){return{map:null,showRes:!1,dataList:[]}},computed:{},mounted(){this.initMap()},methods:{initMap(){this.map=new T.Map("mapDiv");const t=new T.LngLat(116.40969,39.89945);this.map.centerAndZoom(t,12),this.getGeoLocation()},getGeoLocation(){const t=new T.Geolocation,a=function(t){if(0==this.getStatus()){this.map.centerAndZoom(t.lnglat,15);const a=new T.Marker(t.lnglat);this.map.addOverLay(a)}if(1==this.getStatus()){this.map.centerAndZoom(t.lnglat,t.level);const a=new T.Marker(t.lnglat);this.map.addOverLay(a)}};t.getCurrentPosition(a)},searchFn(){const t=t=>{this.showRes=!0,this.dataList=t.pois},a={pageCapacity:100,onSearchComplete:t},s=new T.LocalSearch(this.map,a);s.search(this.$refs.input.value)},toLocal(t){this.showRes=!1;const a=t.lonlat?.split(","),s=new T.Marker(new T.LngLat(Number(a[0]),Number(a[1])));this.map.addOverLay(s),this.map.panTo(new T.LngLat(Number(a[0]),Number(a[1])));const n=new T.InfoWindow(`地址:${t.address}`);s.addEventListener("click",(function(){s.openInfoWindow(n)}))}}}),o=i,c=s(1656),r=(0,c.A)(o,n,e,!1,null,"00dbcf1a",null),l=r.exports}}]); //# sourceMappingURL=601.72d67bf0.js.map