@heycar/heycars-map 0.10.1 → 0.10.2

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/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./v2"
1
+ export * from "./v3"
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./v2"
1
+ export * from "./v3"
package/dist/v2/App.js CHANGED
@@ -2,11 +2,11 @@ import { h } from "vue";
2
2
  import { defineComponent } from "vue-demi";
3
3
  import { DemoBusinessQuoting } from "./Demo/DemoBusinessQuoting.js";
4
4
  import { MapProvider } from "./components/MapProvider/MapProvider.js";
5
- const gmapApiKey = "AIzaSyCRtkaNSWMOhOXDOUpJK4OVbm5RIstYj-I";
5
+ const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
6
6
  const gmapId = "d0af0c05331af64a";
7
7
  const gmapRasterId = "e02db3cb62a7b46";
8
- const amapApiKey = "81ed1d2b5b77187683717a5f2f19591a";
9
- const amapApiSecret = "1dfe626553258a9f91d7c4552c0816d2";
8
+ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
9
+ const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
10
10
  const App = defineComponent({
11
11
  setup() {
12
12
  return () => h(MapProvider, {
@@ -1481,9 +1481,9 @@ const chinaSeaBounds = [
1481
1481
  21.500669
1482
1482
  ]
1483
1483
  ];
1484
- const gmapApiKey = "AIzaSyCRtkaNSWMOhOXDOUpJK4OVbm5RIstYj-I";
1485
- const amapApiKey = "81ed1d2b5b77187683717a5f2f19591a";
1486
- const amapApiSecret = "1dfe626553258a9f91d7c4552c0816d2";
1484
+ const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
1485
+ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
1486
+ const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
1487
1487
  const DemoGmap = defineSetup("DemoGmap", function() {
1488
1488
  const latRef = ref(0);
1489
1489
  const visibleRef = ref(false);
@@ -1,9 +1,8 @@
1
1
  import type { SetMap } from "../../hooks/useHeycarMap";
2
2
  import type { AmapMap } from "../../types/interface";
3
3
  import type { MapEventHandler } from "../../types/mapHelper";
4
- import { type VectorMapForeign } from "../../utils/transform";
5
- export interface AmapProps extends Omit<AMap.MapOptions, "vectorMapForeign"> {
6
- vectorMapForeign?: VectorMapForeign;
4
+ export interface AmapProps extends Omit<AMap.MapOptions, "viewMode"> {
5
+ viewMode?: "2D" | "3D";
7
6
  mapRef?: SetMap<AmapMap>;
8
7
  dragEnable?: boolean;
9
8
  zoomEnable?: boolean;
@@ -14,15 +14,7 @@ import { SafeAmap } from "./SafeAmap.js";
14
14
  const Amap_css_ts_vanilla = "";
15
15
  var amap = "_1d8ur7t0";
16
16
  const Amap = defineSetup("Amap", function(props, { slots, emit, attrs }) {
17
- const {
18
- onDragStart,
19
- onDragEnd,
20
- onZoomEnd,
21
- onResize,
22
- mapRef: setMap,
23
- vectorMapForeign = "style_zh_cn",
24
- ...defaultOptions
25
- } = props;
17
+ const { onDragStart, onDragEnd, onZoomEnd, onResize, mapRef: setMap, ...defaultOptions } = props;
26
18
  const statusOptions = computed(() => {
27
19
  const {
28
20
  dragEnable = true,
@@ -65,8 +57,7 @@ const Amap = defineSetup("Amap", function(props, { slots, emit, attrs }) {
65
57
  const map = new SafeAmap(elementRef.value, {
66
58
  ...defaultOptions,
67
59
  scrollWheel: defaultOptions.touchZoomCenter ? false : defaultOptions.scrollWheel,
68
- doubleClickZoom: defaultOptions.touchZoomCenter ? false : defaultOptions.doubleClickZoom,
69
- vectorMapForeign
60
+ doubleClickZoom: defaultOptions.touchZoomCenter ? false : defaultOptions.doubleClickZoom
70
61
  });
71
62
  window.GlobalAmap = map;
72
63
  mapRef.value = map;
@@ -7,7 +7,7 @@ import { defineLagecySetup } from "../../types/helper.js";
7
7
  import "../../utils/alipayPolyfill.js";
8
8
  import { loadTraditionalChineseConvertOnce } from "../../utils/cn2tw.js";
9
9
  import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
10
- import { language2vectorMapForeign, vec2lnglat } from "../../utils/transform.js";
10
+ import { vec2lnglat } from "../../utils/transform.js";
11
11
  import { Amap } from "../Amap/Amap.js";
12
12
  import { Gmap } from "../Gmap/Gmap.js";
13
13
  const style_css_ts_vanilla = "";
@@ -136,7 +136,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
136
136
  }, [h(Amap, {
137
137
  "attrs": {
138
138
  "mapRef": setMap,
139
- "vectorMapForeign": language2vectorMapForeign(language),
139
+ "showOversea": true,
140
140
  "center": center,
141
141
  "zoom": zoom,
142
142
  "dragEnable": touchEnable,
@@ -3,6 +3,7 @@ export type * from "./driving";
3
3
  export type * from "./geocoder";
4
4
  export type * from "./graspRoad";
5
5
  export type * from "./marker";
6
+ export type * from "./options";
6
7
  export type * from "./place";
7
8
  export type * from "./plugin";
8
9
  export type * from "./walking";
@@ -0,0 +1,8 @@
1
+ export {};
2
+ declare global {
3
+ namespace AMap {
4
+ interface MapOptions {
5
+ showOversea?: boolean;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "0.10.1";
3
+ const pkgVersion = "0.10.2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
@@ -1,4 +1,4 @@
1
- import type { Language, Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
1
+ import type { Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
2
2
  import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
3
3
  import type { WxGetLocationSuccessResponse } from "../types/wx";
4
4
  import { BRWOSER_PLATFORM } from "./platform";
@@ -14,8 +14,6 @@ export interface AsteriskItem {
14
14
  export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
15
15
  export declare const property2emitEventName: (propertyName: string) => string;
16
16
  export declare const property2mapEventName: (propertyName: string) => string;
17
- export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
18
- export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
19
17
  export declare const place2point: (place: Place) => Point;
20
18
  export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
21
19
  export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
@@ -23,15 +23,6 @@ const property2emitEventName = (propertyName) => {
23
23
  const property2mapEventName = (propertyName) => {
24
24
  return propertyName.slice(2).toLowerCase();
25
25
  };
26
- const language2vectorMapForeign = (lang) => {
27
- switch (lang) {
28
- case "en":
29
- return "style_en";
30
- case "zh-TW":
31
- case "zh":
32
- return "style_zh_cn";
33
- }
34
- };
35
26
  const place2point = (place) => [Number(place.lng), Number(place.lat)];
36
27
  const combineHandler = (fn1, fn2) => {
37
28
  return (...args) => {
@@ -287,7 +278,6 @@ export {
287
278
  isPlaceEqual,
288
279
  isPointEqual,
289
280
  isZoneEqual,
290
- language2vectorMapForeign,
291
281
  lnglat2point,
292
282
  maybeFunctionToFunction,
293
283
  pipeAsync,
package/dist/v3/App.js CHANGED
@@ -2,11 +2,11 @@ import { createVNode } from "vue";
2
2
  import { defineComponent } from "vue-demi";
3
3
  import { DemoBusinessQuoting } from "./Demo/DemoBusinessQuoting.js";
4
4
  import { MapProvider } from "./components/MapProvider/MapProvider.js";
5
- const gmapApiKey = "AIzaSyCRtkaNSWMOhOXDOUpJK4OVbm5RIstYj-I";
5
+ const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
6
6
  const gmapId = "d0af0c05331af64a";
7
7
  const gmapRasterId = "e02db3cb62a7b46";
8
- const amapApiKey = "81ed1d2b5b77187683717a5f2f19591a";
9
- const amapApiSecret = "1dfe626553258a9f91d7c4552c0816d2";
8
+ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
9
+ const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
10
10
  const App = /* @__PURE__ */ defineComponent({
11
11
  setup() {
12
12
  return () => createVNode(MapProvider, {
@@ -1481,9 +1481,9 @@ const chinaSeaBounds = [
1481
1481
  21.500669
1482
1482
  ]
1483
1483
  ];
1484
- const gmapApiKey = "AIzaSyCRtkaNSWMOhOXDOUpJK4OVbm5RIstYj-I";
1485
- const amapApiKey = "81ed1d2b5b77187683717a5f2f19591a";
1486
- const amapApiSecret = "1dfe626553258a9f91d7c4552c0816d2";
1484
+ const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
1485
+ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
1486
+ const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
1487
1487
  const DemoGmap = defineSetup("DemoGmap", function() {
1488
1488
  const latRef = ref(0);
1489
1489
  const visibleRef = ref(false);
@@ -1,10 +1,9 @@
1
1
  import type { SetMap } from "../../hooks/useHeycarMap";
2
2
  import type { AmapMap } from "../../types/interface";
3
3
  import type { MapEventHandler } from "../../types/mapHelper";
4
- import { type VectorMapForeign } from "../../utils/transform";
5
4
  import { SafeAmap } from "./SafeAmap";
6
- export interface AmapProps extends Omit<AMap.MapOptions, "vectorMapForeign"> {
7
- vectorMapForeign?: VectorMapForeign;
5
+ export interface AmapProps extends Omit<AMap.MapOptions, "viewMode"> {
6
+ viewMode?: "2D" | "3D";
8
7
  mapRef?: SetMap<AmapMap>;
9
8
  dragEnable?: boolean;
10
9
  zoomEnable?: boolean;
@@ -14,15 +14,7 @@ import { SafeAmap } from "./SafeAmap.js";
14
14
  const Amap_css_ts_vanilla = "";
15
15
  var amap = "_1d8ur7t0";
16
16
  const Amap = defineSetup("Amap", function(props, { slots, emit, attrs }) {
17
- const {
18
- onDragStart,
19
- onDragEnd,
20
- onZoomEnd,
21
- onResize,
22
- mapRef: setMap,
23
- vectorMapForeign = "style_zh_cn",
24
- ...defaultOptions
25
- } = props;
17
+ const { onDragStart, onDragEnd, onZoomEnd, onResize, mapRef: setMap, ...defaultOptions } = props;
26
18
  const statusOptions = computed(() => {
27
19
  const {
28
20
  dragEnable = true,
@@ -65,8 +57,7 @@ const Amap = defineSetup("Amap", function(props, { slots, emit, attrs }) {
65
57
  const map = new SafeAmap(elementRef.value, {
66
58
  ...defaultOptions,
67
59
  scrollWheel: defaultOptions.touchZoomCenter ? false : defaultOptions.scrollWheel,
68
- doubleClickZoom: defaultOptions.touchZoomCenter ? false : defaultOptions.doubleClickZoom,
69
- vectorMapForeign
60
+ doubleClickZoom: defaultOptions.touchZoomCenter ? false : defaultOptions.doubleClickZoom
70
61
  });
71
62
  window.GlobalAmap = map;
72
63
  mapRef.value = map;
@@ -7,7 +7,7 @@ import { defineLagecySetup } from "../../types/helper.js";
7
7
  import "../../utils/alipayPolyfill.js";
8
8
  import { loadTraditionalChineseConvertOnce } from "../../utils/cn2tw.js";
9
9
  import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
10
- import { language2vectorMapForeign, vec2lnglat } from "../../utils/transform.js";
10
+ import { vec2lnglat } from "../../utils/transform.js";
11
11
  import { Amap } from "../Amap/Amap.js";
12
12
  import { Gmap } from "../Gmap/Gmap.js";
13
13
  const style_css_ts_vanilla = "";
@@ -130,7 +130,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
130
130
  "style": attrs.style
131
131
  }, [createVNode(Amap, {
132
132
  "mapRef": setMap,
133
- "vectorMapForeign": language2vectorMapForeign(language),
133
+ "showOversea": true,
134
134
  "center": center,
135
135
  "zoom": zoom,
136
136
  "dragEnable": touchEnable,
@@ -3,6 +3,7 @@ export type * from "./driving";
3
3
  export type * from "./geocoder";
4
4
  export type * from "./graspRoad";
5
5
  export type * from "./marker";
6
+ export type * from "./options";
6
7
  export type * from "./place";
7
8
  export type * from "./plugin";
8
9
  export type * from "./walking";
@@ -0,0 +1,8 @@
1
+ export {};
2
+ declare global {
3
+ namespace AMap {
4
+ interface MapOptions {
5
+ showOversea?: boolean;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "0.10.1";
3
+ const pkgVersion = "0.10.2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
@@ -1,4 +1,4 @@
1
- import type { Language, Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
1
+ import type { Place, Point, RecommendZonePlaces, TrackPoint, Zone } from "../types/interface";
2
2
  import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
3
3
  import type { WxGetLocationSuccessResponse } from "../types/wx";
4
4
  import { BRWOSER_PLATFORM } from "./platform";
@@ -14,8 +14,6 @@ export interface AsteriskItem {
14
14
  export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
15
15
  export declare const property2emitEventName: (propertyName: string) => string;
16
16
  export declare const property2mapEventName: (propertyName: string) => string;
17
- export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
18
- export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
19
17
  export declare const place2point: (place: Place) => Point;
20
18
  export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
21
19
  export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
@@ -23,15 +23,6 @@ const property2emitEventName = (propertyName) => {
23
23
  const property2mapEventName = (propertyName) => {
24
24
  return propertyName.slice(2).toLowerCase();
25
25
  };
26
- const language2vectorMapForeign = (lang) => {
27
- switch (lang) {
28
- case "en":
29
- return "style_en";
30
- case "zh-TW":
31
- case "zh":
32
- return "style_zh_cn";
33
- }
34
- };
35
26
  const place2point = (place) => [Number(place.lng), Number(place.lat)];
36
27
  const combineHandler = (fn1, fn2) => {
37
28
  return (...args) => {
@@ -287,7 +278,6 @@ export {
287
278
  isPlaceEqual,
288
279
  isPointEqual,
289
280
  isZoneEqual,
290
- language2vectorMapForeign,
291
281
  lnglat2point,
292
282
  maybeFunctionToFunction,
293
283
  pipeAsync,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",