(function(e){function t(t){for(var n,l,i=t[0],s=t[1],c=t[2],u=0,d=[];u<i.length;u++)l=i[u],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&d.push(o[l][0]),o[l]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);p&&p(t);while(d.length)d.shift()();return r.push.apply(r,c||[]),a()}function a(){for(var e,t=0;t<r.length;t++){for(var a=r[t],n=!0,i=1;i<a.length;i++){var s=a[i];0!==o[s]&&(n=!1)}n&&(r.splice(t--,1),e=l(l.s=a[0]))}return e}var n={},o={app:0},r=[];function l(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,l),a.l=!0,a.exports}l.m=e,l.c=n,l.d=function(e,t,a){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(l.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(a,n,function(t){return e[t]}.bind(null,n));return a},l.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="/geohash_tool/";var i=window["webpackJsonp"]=window["webpackJsonp"]||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var p=s;r.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"024c":function(e,t){e.exports=AMap},"034f":function(e,t,a){"use strict";var n=a("8589"),o=a.n(n);o.a},"56d7":function(e,t,a){"use strict";a.r(t);a("a133"),a("ed0d"),a("f09c"),a("e117");var n=a("0261"),o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app"}},[a("Main",{attrs:{msg:"this is a main component"}})],1)},r=[],l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"map_container"},[a("div",{staticClass:"ui_container"},[a("el-row",[a("el-col",{attrs:{span:10}},[a("div",{staticClass:"option_input_label"},[e._v("geohash位数:")])]),a("el-col",{attrs:{span:14}},[a("el-input",{attrs:{placeholder:"geohash位数精度"},model:{value:e.geohash_precision,callback:function(t){e.geohash_precision=t},expression:"geohash_precision"}})],1)],1),a("el-row",{staticStyle:{"margin-top":"20px"}},[a("el-col",{attrs:{span:24}},[a("div",[e._v("点击地图时标记选项：")])])],1),a("el-row",{staticStyle:{"margin-top":"5px"}},[a("el-col",{attrs:{span:12}},[a("el-radio",{staticClass:"option_radio_style",attrs:{label:"1"},model:{value:e.labelType,callback:function(t){e.labelType=t},expression:"labelType"}},[e._v("标注点击区域")])],1),a("el-col",{attrs:{span:12}},[a("el-radio",{staticClass:"option_radio_style",attrs:{label:"2"},model:{value:e.labelType,callback:function(t){e.labelType=t},expression:"labelType"}},[e._v("标注相邻9区域")])],1)],1),a("el-row",{staticStyle:{"margin-top":"20px"}},[a("el-col",{attrs:{span:24}},[a("div",[e._v("点击地图时添加删除选项：")])])],1),a("el-row",{staticStyle:{"margin-top":"5px"}},[a("el-col",{attrs:{span:12}},[a("el-radio",{staticClass:"option_radio_style",attrs:{label:"1"},model:{value:e.addRemoveType,callback:function(t){e.addRemoveType=t},expression:"addRemoveType"}},[e._v("点击时添加")])],1),a("el-col",{attrs:{span:12}},[a("el-radio",{staticClass:"option_radio_style",attrs:{label:"2"},model:{value:e.addRemoveType,callback:function(t){e.addRemoveType=t},expression:"addRemoveType"}},[e._v("点击时删除")])],1)],1),a("el-row",{staticStyle:{"margin-top":"20px"}},[a("el-col",{attrs:{span:24}},[a("el-button",{on:{click:function(t){return e.clearMarker()}}},[e._v("清除标注块")])],1)],1)],1),a("div",{staticClass:"mapStyle",attrs:{id:"mapDiv"}})])},i=[],s=(a("2eeb"),a("024c")),c=a.n(s),p=a("e384"),u={data:function(){return{map:void 0,geohash_precision:6,markers:{},labelType:"1",addRemoveType:"1"}},mounted:function(){this.initMap()},methods:{initMap:function(){this.map=new c.a.Map("mapDiv",{center:[114.085947,22.547],zoom:15,rotateEnable:!1,dragEnable:!0}),this.map.on("complete",(function(){console.log("map has loaded")})),this.map.on("click",this.mapClick)},mapClick:function(e){var t=e.lnglat.lng,a=e.lnglat.lat;console.log("map click. lng:",t,", lat:",a);var n=this.geohash_precision;"string"==typeof n&&(n=parseInt(n));var o=p["a"].encode(a,t,n);if(console.log(o),"1"==this.addRemoveType&&(this.markerGeohash(o),"2"==this.labelType)){var r=p["a"].neighbours(o);for(var l in console.log("neighboursCode:",r),r)this.markerGeohash(r[l])}},rectClick:function(e){var t=e.target.getExtData();console.log("rectClick:",t),"2"==this.addRemoveType&&this.removeMarker(t)},labelClick:function(e){var t=e.target.getExtData();console.log("getExtData:",t),"2"==this.addRemoveType&&this.removeMarker(t)},markerGeohash:function(e){if(!this.markers.hasOwnProperty(e)){var t=p["a"].bounds(e);console.log("bounds:",t);var a=new c.a.LngLat(t.sw.lon,t.sw.lat,!0),n=new c.a.LngLat(t.ne.lon,t.ne.lat,!0),o=new c.a.Bounds(a,n),r=new c.a.Rectangle({map:this.map,zIndex:10,bounds:o,strokeColor:"#00FFFF",strokeOpacity:.9,strokeWeight:1,fillColor:"#FFFF00",fillOpacity:.5,strokeStyle:"solid",bubble:!0,extData:e});r.on("click",this.rectClick);var l=p["a"].decode(e),i=new c.a.LngLat(l.lon,l.lat,!0),s=new c.a.Text({map:this.map,text:e,position:i,anchor:"center",zIndex:5,extData:e});s.on("click",this.labelClick),this.markers[e]={rect:r,label:s}}},removeMarker:function(e){if(this.markers.hasOwnProperty(e)){var t=this.markers[e];t.rect.setMap(null),t.label.setMap(null),delete this.markers[e]}},clearMarker:function(){for(var e in this.markers){var t=this.markers[e];t.rect.setMap(null),t.label.setMap(null)}this.markers={}}}},d=u,f=(a("c266"),a("9ca4")),h=Object(f["a"])(d,l,i,!1,null,null,null),v=h.exports,m={name:"App",components:{Main:v}},b=m,g=(a("034f"),Object(f["a"])(b,o,r,!1,null,null,null)),y=g.exports,k=(a("3880"),a("b705")),_=a.n(k);n["default"].use(_.a),n["default"].config.productionTip=!1,new n["default"]({render:function(e){return e(y)}}).$mount("#app")},8589:function(e,t,a){},ac3d:function(e,t,a){},c266:function(e,t,a){"use strict";var n=a("ac3d"),o=a.n(n);o.a}});