tg-map-vue3 3.0.4 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tg-map.js CHANGED
@@ -1,3 +1,4 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.tg-map{height:100vh;position:relative}.tg-map__map{width:100%;height:100%}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
1
2
  var jt = Object.defineProperty;
2
3
  var Wt = (i, e, t) => e in i ? jt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
4
  var h = (i, e, t) => (Wt(i, typeof e != "symbol" ? e + "" : e, t), t);
@@ -1,3 +1,4 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.tg-map{height:100vh;position:relative}.tg-map__map{width:100%;height:100%}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
1
2
  (function(a,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(a=typeof globalThis<"u"?globalThis:a||self,d(a.TgMap={},a.Vue))})(this,function(a,d){"use strict";var pi=Object.defineProperty;var gi=(a,d,w)=>d in a?pi(a,d,{enumerable:!0,configurable:!0,writable:!0,value:w}):a[d]=w;var c=(a,d,w)=>(gi(a,typeof d!="symbol"?d+"":d,w),w);function w(i){throw new Error(i)}function dt(i){throw new Error(`Unsupported: ${i}`)}function qt(i){throw new Error(`todo: ${i}`)}function Xt(i){return i}function ee(...i){}function Jt(i){return i!=null}function z(i,e){return{type:String,default:e,validator:t=>Object.values(i).includes(t)}}function ut(i,e){return{type:String,default:e,validator:t=>i.includes(t)}}function I(i){return{type:i,required:!0}}function y(i,e){return{type:i,default:e}}function Qt(i){const e={};return Object.entries(i).forEach(([t,r])=>{const s=`__${t}`;e[t]={get(){const n=this[s];return n===void 0?r:n},set(n){this[s]=n}}}),e}const te={enumerable:!0,configurable:!0,get:ee,set:ee};function pt(i){return Object.keys(i).forEach(e=>{const t=i[e];let r=!1;typeof t=="function"?(te.get=t,te.set=ee,r=!0):typeof t=="object"&&typeof t.get=="function"&&(te.get=t.get,te.set=t.set,r=!0),r&&(i[e]=Object.defineProperty(i,e,te))}),i}function er(i){return pt(i)}function gt(){return d.createCommentVNode()}function re(i,e){const t=i.$options[e];if(t)for(const r of t)r.call(i)}function tr(i,e){for(const t of i)if(t.$options.name===e.name)return t}function rr(i,e){if(!i.default)return;const t=i.default();for(const r of t)if((r==null?void 0:r.type).name===e.name)return r}function N(i){const e={},t={};return Object.keys(i).forEach(r=>{r.startsWith("on")?e[r.substring(2).toLowerCase()]=i[r]:t[r]=i[r]}),{binds:t,listeners:e}}const ir={eventLog(i){console.log(i),this.$_prev_type=i&&i.type,this.$_prev_time=Date.now()},eventLogLess(i){((i&&i.type)!==this.$_prev_type||Date.now()-(this.$_prev_time??0)>1e3)&&this.eventLog(i)}};a.Strings=void 0,(i=>{function e(r,s){if(r!==void 0)return Object.values(s).includes(r)?r:void 0}i.toEnumOrNull=e;function t(r){return r.split(`
2
3
  `).map(s=>s.trim()).join(`
3
4
  `)}i.trimIndent=t})(a.Strings||(a.Strings={}));const De="$map",ce="onCreate",de="onDestroy",k=d.defineComponent({inject:[De],mounted(){re(this,ce)},beforeUnmount(){re(this,de)},methods:{recreate(){re(this,de),re(this,ce)}},render(){return gt()}});var mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Z={},sr={get exports(){return Z},set exports(i){Z=i}};(function(i){(function(e,t){i.exports?i.exports=t():e.coordtransform=t()})(mt,function(){var e=52.35987755982988,t=3.141592653589793,r=6378245,s=.006693421622965943;function n(g,v,M,E){this.west=Math.min(g,M),this.north=Math.max(v,E),this.east=Math.max(g,M),this.south=Math.min(v,E)}n.prototype.contain=function(g,v){return this.west<=g&&this.east>=g&&this.north>=v&&this.south<=v};var l=[new n(79.4462,49.2204,96.33,42.8899),new n(109.6872,54.1415,135.0002,39.3742),new n(73.1246,42.8899,124.143255,29.5297),new n(82.9684,29.5297,97.0352,26.7186),new n(97.0253,29.5297,124.367395,20.414096),new n(107.975793,20.414096,111.744104,17.871542)],f=[new n(119.921265,25.398623,122.497559,21.785006),new n(101.8652,22.284,106.665,20.0988),new n(106.4525,21.5422,108.051,20.4878),new n(109.0323,55.8175,119.127,50.3257),new n(127.4568,55.8175,137.0227,49.5574),new n(131.2662,44.8922,137.0227,42.5692),new n(73.1246,35.398637,77.948114,29.5297)];function o(g,v){for(var M=0;M<l.length;M++)if(l[M].contain(g,v)){for(var E=0;E<f.length;E++)if(f[E].contain(g,v))return!1;return!0}return!1}function h(g,v){var M=g-.0065,E=v-.006,U=Math.sqrt(M*M+E*E)-2e-5*Math.sin(E*e),$=Math.atan2(E,M)-3e-6*Math.cos(M*e),Re=U*Math.cos($),ct=U*Math.sin($);return[Re,ct]}function u(g,v){var M=Math.sqrt(g*g+v*v)+2e-5*Math.sin(v*e),E=Math.atan2(v,g)+3e-6*Math.cos(g*e),U=M*Math.cos(E)+.0065,$=M*Math.sin(E)+.006;return[U,$]}function m(g,v){return o(g,v)?C(g,v):[g,v]}function p(g,v){if(!o(g,v))return[g,v];var M=C(g,v);return[g*2-M[0],v*2-M[1]]}function C(g,v){var M=T(g-105,v-35),E=O(g-105,v-35),U=v/180*t,$=Math.sin(U);$=1-s*$*$;var Re=Math.sqrt($);M=M*180/(r*(1-s)/($*Re)*t),E=E*180/(r/Re*Math.cos(U)*t);var ct=v+M,ui=g+E;return[ui,ct]}function T(g,v){var M=-100+2*g+3*v+.2*v*v+.1*g*v+.2*Math.sqrt(Math.abs(g));return M+=(20*Math.sin(6*g*t)+20*Math.sin(2*g*t))*2/3,M+=(20*Math.sin(v*t)+40*Math.sin(v/3*t))*2/3,M+=(160*Math.sin(v/12*t)+320*Math.sin(v*t/30))*2/3,M}function O(g,v){var M=300+g+2*v+.1*g*g+.1*g*v+.1*Math.sqrt(Math.abs(g));return M+=(20*Math.sin(6*g*t)+20*Math.sin(2*g*t))*2/3,M+=(20*Math.sin(g*t)+40*Math.sin(g/3*t))*2/3,M+=(150*Math.sin(g/12*t)+300*Math.sin(g/30*t))*2/3,M}return{bd09togcj02:h,gcj02tobd09:u,wgs84togcj02:m,gcj02towgs84:p,bd09ToGcj02:h,gcj02ToBd09:u,wgs84ToGcj02:m,gcj02ToWgs84:p,bd09ToWgs84:function(g,v){if(!o(g,v))return[g,v];var M=h(g,v);return p(M[0],M[1])},wgs84ToBd09:function(g,v){if(!o(g,v))return[g,v];var M=m(g,v);return u(M[0],M[1])}}})})(sr);function ie(i,e){if(!i)throw new Error(`AssertionError: ${e}`)}function ft(i){throw new Error(`Unexpected object: ${i}`)}var j=(i=>(i.wgs84="wgs84",i.gcj02="gcj02",i.bd09="bd09",i))(j||{});const Ge="wgs84",A=class{constructor(e,t,r){this.lat=e,this.lng=t,this.coord=r}static fromBaidu(e,t){return new A(e.lat,e.lng,t)}static fromGoogle(e,t){return new A(e.lat(),e.lng(),t)}static fromHere(e,t){return new A(e.lat,e.lng,t)}static fromLiteral(e){return new A(e.lat,e.lng,e.coord||Ge)}static fromLngLat(e,t,r=Ge){return new A(t,e,r)}static create(e,t,r=Ge){return new A(e,t,r)}to(e){if(this.coord===e)return this;const[t,r]=this.convert(e);return new A(r,t,e)}toBaidu(e){let t=this.lat,r=this.lng;return this.coord!==e&&([r,t]=this.convert(e)),new BMap.Point(r,t)}toGoogle(e){let t=this.lat,r=this.lng;return this.coord!==e&&([r,t]=this.convert(e)),new google.maps.LatLng(t,r)}toHere(e){let t=this.lat,r=this.lng;return this.coord!==e&&([r,t]=this.convert(e)),new H.geo.Point(t,r)}convert(e){switch(this.coord){case"bd09":return e==="gcj02"?Z.bd09ToGcj02(this.lng,this.lat):Z.bd09ToWgs84(this.lng,this.lat);case"gcj02":return e==="wgs84"?Z.gcj02ToWgs84(this.lng,this.lat):Z.gcj02ToBd09(this.lng,this.lat);case"wgs84":return e==="bd09"?Z.wgs84ToBd09(this.lng,this.lat):Z.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${e}`)}equals(e){return this===e?!0:this.lat===e.lat&&this.lng===e.lng&&this.coord===e.coord}toString(){return JSON.stringify(this)}};let _=A;c(_,"ZERO",A.create(0,0));const F=class{constructor(e,t){c(this,"coord");this.sw=e,this.ne=t,ie(e.coord===t.coord,"sw和ne的coord应该相同"),ie(Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&Number.isFinite(t.lat)&&Number.isFinite(t.lng),`sw(${e})和ne(${t})不能包含NaN或Infinite`),ie(e.lat<=t.lat,`sw.lat(${e.lat})应该比ne.lat(${t.lat})小`),this.coord=e.coord}static isBetweenLng(e,t,r){return e<=t?e<=r&&r<=t:e<=r||r<=t}static fromArray(e){if(e.length===0)return;const t=new F.Builder(e[0]);for(let r=1;r<e.length;r++)t.include(e[r]);return t.build()}static from(...e){return this.fromArray(e)??w("positions中没有点")}static fromGoogle(e,t){return new F(_.fromGoogle(e.getSouthWest(),t),_.fromGoogle(e.getNorthEast(),t))}static fromBaidu(e,t){return new F(_.fromBaidu(e.getSouthWest(),t),_.fromBaidu(e.getNorthEast(),t))}static create(e,t){return this.from(e,t)}isEmpty(){return this.sw.equals(this.ne)}contains(e){const{lat:t,lng:r}=e.to(this.coord);return this.sw.lat<=t&&t<=this.ne.lat&&F.isBetweenLng(this.sw.lng,this.ne.lng,r)}getCenter(){const e=(this.sw.lat+this.ne.lat)/2,t=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return _.create(e,t,this.coord)}toString(){return JSON.stringify(this)}equals(e){return this.sw.equals(e.sw)&&this.ne.equals(e.ne)}toGoogle(e){return new google.maps.LatLngBounds(this.sw.toGoogle(e),this.ne.toGoogle(e))}toBaidu(e){return new BMap.Bounds(this.sw.toBaidu(e),this.ne.toBaidu(e))}toBaiduArray(e){return[this.sw.toBaidu(e),this.ne.toBaidu(e)]}};let R=F;c(R,"EMPTY",new F(_.ZERO,_.ZERO)),(i=>{class e{constructor(r){c(this,"coord");c(this,"minLat");c(this,"minLng");c(this,"maxLat");c(this,"maxLng");this.coord=r.coord,this.minLat=this.maxLat=r.lat,this.minLng=this.maxLng=r.lng}build(){return new i(_.create(this.minLat,this.minLng,this.coord),_.create(this.maxLat,this.maxLng,this.coord))}include(r){const{lat:s,lng:n}=r.to(this.coord);return this.minLat=Math.min(this.minLat,s),this.maxLat=Math.max(this.maxLat,s),i.isBetweenLng(this.minLng,this.maxLng,n)||(this.delta(this.minLng,n)<this.delta(n,this.maxLng)?this.minLng=n:this.maxLng=n),this}delta(r,s){return(r-s+360)%360}}i.Builder=e})(R||(R={}));function nr(){}function Ze(i){return i}function or(i,e){return i instanceof e}function ar(i,e){if(i instanceof e)return i}function Y(i,e){if((i==null?void 0:i.$options.name)===e.name)return i}class ue{constructor(e){c(this,"latestInfoWindow");c(this,"delegate",void 0);this.element=e,{}.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(e){this.delegate=e.setTarget(this)}addEventListener(e,t){this.delegate.addEventListener(e,t)}removeEventListener(e,t){this.delegate.removeEventListener(e,t)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(e){this.latestInfoWindow=e}addOverlayMapType(e){this.addLayer(e)}removeOverlayMapType(e){this.removeLayer(e)}addControl(e){e.addTo(this)}removeControl(e){e.removeFrom(this)}getZoom(){return this.innerMap.getZoom()}setZoom(e){this.innerMap.setZoom(e)}}var lr=function(e){return hr(e)&&!cr(e)};function hr(i){return!!i&&typeof i=="object"}function cr(i){var e=Object.prototype.toString.call(i);return e==="[object RegExp]"||e==="[object Date]"||pr(i)}var dr=typeof Symbol=="function"&&Symbol.for,ur=dr?Symbol.for("react.element"):60103;function pr(i){return i.$$typeof===ur}function gr(i){return Array.isArray(i)?[]:{}}function se(i,e){return e.clone!==!1&&e.isMergeableObject(i)?K(gr(i),i,e):i}function mr(i,e,t){return i.concat(e).map(function(r){return se(r,t)})}function fr(i,e){if(!e.customMerge)return K;var t=e.customMerge(i);return typeof t=="function"?t:K}function yr(i){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(i).filter(function(e){return Object.propertyIsEnumerable.call(i,e)}):[]}function yt(i){return Object.keys(i).concat(yr(i))}function vt(i,e){try{return e in i}catch{return!1}}function vr(i,e){return vt(i,e)&&!(Object.hasOwnProperty.call(i,e)&&Object.propertyIsEnumerable.call(i,e))}function _r(i,e,t){var r={};return t.isMergeableObject(i)&&yt(i).forEach(function(s){r[s]=se(i[s],t)}),yt(e).forEach(function(s){vr(i,s)||(vt(i,s)&&t.isMergeableObject(e[s])?r[s]=fr(s,t)(i[s],e[s],t):r[s]=se(e[s],t))}),r}function K(i,e,t){t=t||{},t.arrayMerge=t.arrayMerge||mr,t.isMergeableObject=t.isMergeableObject||lr,t.cloneUnlessOtherwiseSpecified=se;var r=Array.isArray(e),s=Array.isArray(i),n=r===s;return n?r?t.arrayMerge(i,e,t):_r(i,e,t):se(e,t)}K.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,s){return K(r,s,t)},{})};var Mr=K,_t=Mr;/*!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-map-vue3",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "author": "ipcjs",
5
5
  "description": "封装 百度地图, Google地图, Here地图(未完成) 的Vue3组件库",
6
6
  "keywords": [
@@ -13,6 +13,7 @@
13
13
  "type": "git",
14
14
  "url": "https://github.com/TranscodeGroup/tg-map"
15
15
  },
16
+ "homepage": "https://github.com/TranscodeGroup/tg-map-vue3/issues",
16
17
  "license": "MIT",
17
18
  "type": "module",
18
19
  "main": "./dist/tg-map.umd.cjs",
@@ -44,6 +45,7 @@
44
45
  "@types/node": "^18.14.2",
45
46
  "@vitejs/plugin-vue": "^4.0.0",
46
47
  "@vitejs/plugin-vue-jsx": "^3.0.0",
48
+ "vite-plugin-css-injected-by-js": "3.1.0",
47
49
  "vite-plugin-dts": "^2.1.0",
48
50
  "@vue/eslint-config-typescript": "^11.0.2",
49
51
  "@vue/tsconfig": "^0.1.3",
@@ -62,7 +64,6 @@
62
64
  "build-only": "vite build",
63
65
  "type-check": "vue-tsc --noEmit",
64
66
  "type-gen": "vue-tsc --project tsconfig.types.json",
65
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
66
- "prepublish": "run-s build"
67
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
67
68
  }
68
69
  }
package/dist/style.css DELETED
@@ -1 +0,0 @@
1
- .baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0px;top:0px;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.tg-map{height:100vh;position:relative}.tg-map__map{width:100%;height:100%}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.element-overlay{position:absolute}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}