You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
47 KiB
6 lines
47 KiB
|
3 years ago
|
var co=Object.defineProperty,lo=Object.defineProperties;var so=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var Et=Object.prototype.hasOwnProperty,Pt=Object.prototype.propertyIsEnumerable;var Ct=(f,r,g)=>r in f?co(f,r,{enumerable:!0,configurable:!0,writable:!0,value:g}):f[r]=g,l=(f,r)=>{for(var g in r||(r={}))Et.call(r,g)&&Ct(f,g,r[g]);if(A)for(var g of A(r))Pt.call(r,g)&&Ct(f,g,r[g]);return f},N=(f,r)=>lo(f,so(r));var kt=(f,r)=>{var g={};for(var b in f)Et.call(f,b)&&r.indexOf(b)<0&&(g[b]=f[b]);if(f!=null&&A)for(var b of A(f))r.indexOf(b)<0&&Pt.call(f,b)&&(g[b]=f[b]);return g};(function(f,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],r):(f=typeof globalThis!="undefined"?globalThis:f||self,r(f.VueTianditu={},f.VueDemi))})(this,function(f,r){"use strict";function g({events:t,emit:n,instance:e,emitted:o,extData:a}){t instanceof Object&&(t=Object.keys(t)),t.forEach(i=>{e.addEventListener(i,s=>{n(i,N(l({},s),{extData:a})),o==null||o(i)})})}const b={v:"4.0",tk:"",plugins:[]},Nt={D3:["https://cdn.bootcss.com/d3/3.5.17/d3.min.js","http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/D3SvgOverlay.min.js"],CarTrack:["https://cdn.bootcss.com/d3/3.5.17/d3.min.js","http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/D3SvgOverlay.min.js","http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/CarTrack.min.js"],HeatmapOverlay:["http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/HeatmapOverlay.min.js"],BufferTool:["https://cdn.bootcss.com/Turf.js/3.0.14/turf.js","http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/BufferTool.min.js"],ImageOverLayer:["http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/ImageOverlay.min.js"]};let I=!1;async function R(t={}){if(I)return new Promise(n=>{setTimeout(()=>n(R(t)))});if(globalThis.T)return;{I=!0;const{v:n,tk:e,plugins:o}=l(l({},b),t);await x(`https://api.tianditu.gov.cn/api?v=${n}&tk=${e}`),await Promise.all(o.map(a=>Nt[a]).flat().map(a=>x(a))),I=!1}}function x(t){return new Promise((n,e)=>{var a,i;const o=(a=globalThis.document)==null?void 0:a.createElement("script");o||n(),o.src=t,o.type="text/javascript",o.async=!0,o.defer=!0,o.onload=()=>n(),o.onerror=s=>n(),(i=globalThis.document)==null||i.body.appendChild(o)})}function m(){return new Promise(t=>{const n=r.inject("mapRoot"),e=r.inject("mapEmitter");(n==null?void 0:n.value)?t(n==null?void 0:n.value):e==null||e.on("mapInit",o);function o(a){e==null||e.off("mapInit",o),t(a)}})}function z(t){return{all:t=t||new Map,on:function(n,e){var o=t.get(n);o?o.push(e):t.set(n,[e])},off:function(n,e){var o=t.get(n);o&&(e?o.splice(o.indexOf(e)>>>0,1):t.set(n,[]))},emit:function(n,e){var o=t.get(n);o&&o.slice().map(function(a){a(e)}),(o=t.get("*"))&&o.slice().map(function(a){a(n,e)})}}}const $t={icon:{type:[String,Object]},draggable:{type:Boolean,default:!1},title:{type:String,default:""},zIndexOffset:{type:Number,default:0},opacity:{type:Number,default:1}},Ot={position:{type:Array,default:()=>[0,0]},visible:{type:Boolean,default:!0},extData:{type:void 0}},j={click:()=>!0,dblclick:()=>!0,mousedown:()=>!0,mouseup:()=>!0,mouseout:()=>!0,mouseover:()=>!0,dragstart:()=>!0,drag:()=>!0,dragend:()=>!0,remove:()=>!0},Rt={init:t=>t instanceof T.Marker},Lt=l(l({},$t),Ot),At=l(l({},j),Rt);function Z(t){const{draggable:n,title:e,zIndexOffset:o,opacity:a,position:i}=t;return new T.Marker(w(i),{draggable:n,title:e,zIndexOffset:o,opacity:a})}function It({props:t,instance:n}){r.watch(()=>t.position,e=>e&&n.setLngLat(w(e))),r.watch(()=>t.draggable,e=>e?n.enableDragging():n.disableDragging()),r.watch(()=>t.icon,e=>e&&n.setIcon(L(e)),{immediate:!0}),r.watch(()=>t.zIndexOffset,e=>e&&n.setZIndexOffset(e),{immediate:!0}),r.watch(()=>t.opacity,e=>e&&n.setOpacity(e),{immediate:!0}),r.watch(()=>t.visible,e=>e?n.show():n.hide(),{immediate:!0})}const w=t=>{const[n,e]=t;return new T.LngLat(n,e)},E=t=>t.map(n=>{const[e,o]=n;return new T.LngLat(e,o)}),C=t=>{const[[n,e],[o,a]]=t;return new T.LngLatBounds(new T.Ln
|
||
|
|
<strong>${c.name}</strong>
|
||
|
|
<div>\u5730\u5740\uFF1A${c.address}</div>
|
||
|
|
<div>\u5750\u6807\uFF1A${c.lonlat}</div>
|
||
|
|
`,n("poi-click",c)}function i(c){e(1,c.name,Number(c.gbCode)),n("suggest-click",c)}function s(c){var u;t.current=c.current||1,(u=t.localSearch)==null||u.gotoPage(t.current)}return{onSearch:_t(e,100),onSearchComplete:o,onPoiClick:a,onSuggestClick:i,onPageChange:s}}function jn(){const t={tdtMap:null,localSearch:null,keyword:"",queryType:1,showRoute:!1},n={pois:!1,statistics:!1,area:!1,suggests:!1,prompt:!1,lineData:!1},e={markers:[],target:null,content:"",current:1,total:0};return r.reactive(l(l(l({},t),n),e))}const Zn=r.defineComponent({setup(){return()=>d("svg",{class:"tdt-icon",attrs:{t:"1636975674954",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7028",width:"200",height:"200"}},[d("path",{attrs:{d:"M789.804097 737.772047 742.865042 784.699846 898.765741 940.600545 945.704796 893.672746Z","p-id":"7029"}}),d("path",{attrs:{d:"M456.92259 82.893942c-209.311143 0-379.582131 170.282245-379.582131 379.582131s170.270988 379.570875 379.582131 379.570875c209.287607 0 379.558595-170.270988 379.558595-379.570875S666.210197 82.893942 456.92259 82.893942zM770.128989 462.477097c0 172.721807-140.508127 313.229934-313.206398 313.229934-172.720783 0-313.229934-140.508127-313.229934-313.229934s140.508127-313.229934 313.229934-313.229934C629.620861 149.247162 770.128989 289.75529 770.128989 462.477097z","p-id":"7030"}})])}}),Wn=r.defineComponent({setup(){return()=>d("svg",{class:"tdt-icon",attrs:{t:"1638934785539",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8230",width:"200",height:"200"}},[d("path",{attrs:{d:"M301.952 387.669333l144.981333 54.357334c56.234667 21.077333 113.578667 80.597333 132.565334 137.557333l15.658666 46.933333a42.666667 42.666667 0 1 1-80.981333 26.965334l-15.616-46.933334c-10.88-32.512-49.493333-72.533333-81.578667-84.608L155.733333 423.936c-38.016-14.250667-36.522667-68.565333 2.261334-80.64l682.666666-213.333333a42.666667 42.666667 0 0 1 53.418667 53.418666l-213.333333 682.666667a42.666667 42.666667 0 0 1-81.408-25.429333l189.013333-604.928-486.4 151.978666z","p-id":"8231"}})])}}),gt=r.defineComponent({setup(){return()=>d("svg",{class:"tdt-icon",attrs:{t:"1636975957032",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7161",width:"200",height:"200"}},[d("path",{attrs:{d:"M562.281173 510.800685l294.996664-293.466821c13.94971-13.878079 14.020318-36.367279 0.14224-50.316989-13.913894-13.984503-36.367279-14.020318-50.316989-0.14224L512.034792 460.377272 219.528855 166.982082c-13.842263-13.878079-36.367279-13.94971-50.316989-0.071631-13.913894 13.878079-13.948687 36.403095-0.071631 50.352805L461.576587 510.587837 166.721139 803.876604c-13.94971 13.878079-14.020318 36.367279-0.14224 50.316989 6.939039 6.974855 16.084327 10.497075 25.229614 10.497075 9.073656 0 18.148335-3.451612 25.087375-10.354835l294.926056-293.360398 295.17472 296.064996c6.939039 6.974855 16.048511 10.462283 25.193799 10.462283 9.109472 0 18.184151-3.487428 25.12319-10.390651 13.913894-13.878079 13.94971-36.367279 0.071631-50.316989L562.281173 510.800685z","p-id":"7162"}})])}});var uo="";const M=r.defineComponent({props:{value:{type:String,default:""},modelValue:{type:String,default:""},placeholder:{type:String,default:"\u8F93\u5165\u5173\u952E\u5B57\u641C\u7D22"},searchBtn:{type:Boolean,default:!0},routeBtn:{type:Boolean,default:!0}},emits:{input:t=>!0,"update:modelValue":t=>!0,search:t=>!0},setup(t,{emit:n,slots:e}){let o=!1;const a=r.computed({get(){return r.isVue2?t.value:t.modelValue},set(i){r.isVue2?n("input",i):n("update:modelValue",i)}});return()=>d("div",{class:"tdt-search-box"},[d("input",{class:"tdt-search-box__input",attrs:{type:"text",placeholder:t.placeholder},domProps:{value:a.value},on:{compositionstart:()=>o=!0,compositionend:()=>o=!1,input:i=>setTimeout(()=>!o&&(a.value=i.target.value)),keyup:i=>i.code==="Enter"&&n("search",a.value)}}),d("i",{class:"tdt-search-box__close",style:{display:t.value||t.modelValue?"block":"none"},on:{click:()=>a.value=""}},[d(gt)]),Bt(e.default)])}});var yo="";const Fn=r.defineComponent({props:{
|