@heycar/heycars-map 2.6.0 → 2.6.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
@@ -4,8 +4,8 @@ import { DemoBusinessRecomendPlace } from "./Demo/DemoBusinessRecomendPlace.js";
4
4
  import { MapProvider } from "./components/MapProvider/MapProvider.js";
5
5
  const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
6
6
  const gmapId = "d0af0c05331af64a";
7
- const amapApiKey = "81ed1d2b5b77187683717a5f2f19591a";
8
- const amapApiSecret = "1dfe626553258a9f91d7c4552c0816d2";
7
+ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
8
+ const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
9
9
  const App = defineComponent({
10
10
  setup() {
11
11
  const supplierRef = ref("amap");
@@ -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
- export interface AmapProps extends Omit<AMap.MapOptions, "vectorMapForeign"> {
6
- vectorMapForeign?: VectorMapForeign;
4
+ export interface AmapProps extends Omit<AMap.MapOptions, "viewMode"> {
7
5
  mapRef?: SetMap<AmapMap>;
6
+ viewMode?: "2D" | "3D";
8
7
  dragEnable?: boolean;
9
8
  zoomEnable?: boolean;
10
9
  rotateEnable?: 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;
@@ -25,6 +25,7 @@ const Gmap = defineSetup("Gmap", function(props, { slots, emit, attrs }) {
25
25
  gestureHandling,
26
26
  center,
27
27
  zoom,
28
+ renderingType,
28
29
  ...options2
29
30
  } = props;
30
31
  return {
@@ -34,7 +35,12 @@ const Gmap = defineSetup("Gmap", function(props, { slots, emit, attrs }) {
34
35
  isFractionalZoomEnabled: true
35
36
  };
36
37
  });
37
- const defaultOptions = { ...options.value, center: props.center, zoom: props.zoom };
38
+ const defaultOptions = {
39
+ ...options.value,
40
+ renderingType: props.renderingType,
41
+ center: props.center,
42
+ zoom: props.zoom
43
+ };
38
44
  const enableRef = computed(() => !!props.touchZoomCenter);
39
45
  const elementRef = shallowRef();
40
46
  const mapRef = shallowRef();
@@ -8,7 +8,7 @@ import { defineLagecySetup } from "../../types/helper.js";
8
8
  import "../../utils/alipayPolyfill.js";
9
9
  import { loadTraditionalChineseConvertOnce } from "../../utils/cn2tw.js";
10
10
  import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
11
- import { language2vectorMapForeign, vec2lnglat } from "../../utils/transform.js";
11
+ import { vec2lnglat } from "../../utils/transform.js";
12
12
  import { Amap } from "../Amap/Amap.js";
13
13
  import { Gmap } from "../Gmap/Gmap.js";
14
14
  import { t as throttle } from "../../chunks/throttle.8bdd8d3b.js";
@@ -162,7 +162,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
162
162
  }, [h(Amap, {
163
163
  "attrs": {
164
164
  "mapRef": setMap,
165
- "vectorMapForeign": language2vectorMapForeign(language),
165
+ "showOversea": true,
166
166
  "center": center,
167
167
  "zoom": zoom,
168
168
  "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 = "2.6.0";
3
+ const pkgVersion = "2.6.2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="google.maps" />
2
- import type { Language, LngLatLiterial, Place, Point, TrackPoint, Zone } from "../types/interface";
2
+ import type { LngLatLiterial, Place, Point, TrackPoint, Zone } from "../types/interface";
3
3
  import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
4
4
  import type { WxGetLocationSuccessResponse } from "../types/wx";
5
5
  import { BRWOSER_PLATFORM } from "./platform";
@@ -16,8 +16,6 @@ export interface AsteriskItem {
16
16
  export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
17
17
  export declare const property2emitEventName: (propertyName: string) => string;
18
18
  export declare const property2mapEventName: (propertyName: string) => string;
19
- export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
20
- export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
21
19
  export declare const place2point: (place: Place) => Point;
22
20
  export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
23
21
  export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
@@ -58,15 +58,6 @@ const property2emitEventName = (propertyName) => {
58
58
  const property2mapEventName = (propertyName) => {
59
59
  return propertyName.slice(2).toLowerCase();
60
60
  };
61
- const language2vectorMapForeign = (lang) => {
62
- switch (lang) {
63
- case "en":
64
- return "style_en";
65
- case "zh-TW":
66
- case "zh":
67
- return "style_zh_cn";
68
- }
69
- };
70
61
  const place2point = (place) => [Number(place.lng), Number(place.lat)];
71
62
  const combineHandler = (fn1, fn2) => {
72
63
  return (...args) => {
@@ -304,7 +295,6 @@ export {
304
295
  isPlaceEqual,
305
296
  isPointEqual,
306
297
  isZoneEqual,
307
- language2vectorMapForeign,
308
298
  lnglat2point,
309
299
  maybeFunctionToFunction,
310
300
  pipeAsync,
package/dist/v3/App.js CHANGED
@@ -4,8 +4,8 @@ import { DemoBusinessRecomendPlace } from "./Demo/DemoBusinessRecomendPlace.js";
4
4
  import { MapProvider } from "./components/MapProvider/MapProvider.js";
5
5
  const gmapApiKey = "AIzaSyCCOe8MAeS3EYvSraKsBX6ztVyLxj69z94";
6
6
  const gmapId = "d0af0c05331af64a";
7
- const amapApiKey = "81ed1d2b5b77187683717a5f2f19591a";
8
- const amapApiSecret = "1dfe626553258a9f91d7c4552c0816d2";
7
+ const amapApiKey = "fcb7b14c930354a248e21f4031dfa179";
8
+ const amapApiSecret = "11ad0e3d585b80d18b1ada5b0d947c4a";
9
9
  const App = /* @__PURE__ */ defineComponent({
10
10
  setup() {
11
11
  const supplierRef = ref("amap");
@@ -1,11 +1,10 @@
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"> {
8
6
  mapRef?: SetMap<AmapMap>;
7
+ viewMode?: "2D" | "3D";
9
8
  dragEnable?: boolean;
10
9
  zoomEnable?: boolean;
11
10
  rotateEnable?: 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;
@@ -25,6 +25,7 @@ const Gmap = defineSetup("Gmap", function(props, { slots, emit, attrs }) {
25
25
  gestureHandling,
26
26
  center,
27
27
  zoom,
28
+ renderingType,
28
29
  ...options2
29
30
  } = props;
30
31
  return {
@@ -34,7 +35,12 @@ const Gmap = defineSetup("Gmap", function(props, { slots, emit, attrs }) {
34
35
  isFractionalZoomEnabled: true
35
36
  };
36
37
  });
37
- const defaultOptions = { ...options.value, center: props.center, zoom: props.zoom };
38
+ const defaultOptions = {
39
+ ...options.value,
40
+ renderingType: props.renderingType,
41
+ center: props.center,
42
+ zoom: props.zoom
43
+ };
38
44
  const enableRef = computed(() => !!props.touchZoomCenter);
39
45
  const elementRef = shallowRef();
40
46
  const mapRef = shallowRef();
@@ -8,7 +8,7 @@ import { defineLagecySetup } from "../../types/helper.js";
8
8
  import "../../utils/alipayPolyfill.js";
9
9
  import { loadTraditionalChineseConvertOnce } from "../../utils/cn2tw.js";
10
10
  import { detectWebGL, WEBGL_STATUS, detectBrowserPlatform, OS_PLATFORM, BRWOSER_PLATFORM, detectOSPlatform } from "../../utils/platform.js";
11
- import { language2vectorMapForeign, vec2lnglat } from "../../utils/transform.js";
11
+ import { vec2lnglat } from "../../utils/transform.js";
12
12
  import { Amap } from "../Amap/Amap.js";
13
13
  import { Gmap } from "../Gmap/Gmap.js";
14
14
  import { t as throttle } from "../../chunks/throttle.8bdd8d3b.js";
@@ -154,7 +154,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
154
154
  "style": attrs.style
155
155
  }, [createVNode(Amap, {
156
156
  "mapRef": setMap,
157
- "vectorMapForeign": language2vectorMapForeign(language),
157
+ "showOversea": true,
158
158
  "center": center,
159
159
  "zoom": zoom,
160
160
  "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 = "2.6.0";
3
+ const pkgVersion = "2.6.2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="google.maps" />
2
- import type { Language, LngLatLiterial, Place, Point, TrackPoint, Zone } from "../types/interface";
2
+ import type { LngLatLiterial, Place, Point, TrackPoint, Zone } from "../types/interface";
3
3
  import type { AlipayMyGetLocationSuccessResponse } from "../types/my";
4
4
  import type { WxGetLocationSuccessResponse } from "../types/wx";
5
5
  import { BRWOSER_PLATFORM } from "./platform";
@@ -16,8 +16,6 @@ export interface AsteriskItem {
16
16
  export declare const decodeAsterisk: (encodedValue: string) => AsteriskItem[];
17
17
  export declare const property2emitEventName: (propertyName: string) => string;
18
18
  export declare const property2mapEventName: (propertyName: string) => string;
19
- export type VectorMapForeign = "style_en" | "style_local" | "style_zh_cn";
20
- export declare const language2vectorMapForeign: (lang: Language) => VectorMapForeign;
21
19
  export declare const place2point: (place: Place) => Point;
22
20
  export declare const combineHandler: <P extends any[], R>(fn1: ((...args: P) => any) | undefined, fn2: (...args: P) => R) => (...args: P) => R;
23
21
  export declare const pipeAsync: <P extends any[]>(fn?: ((...args: P) => any) | undefined) => (...args: P) => void;
@@ -58,15 +58,6 @@ const property2emitEventName = (propertyName) => {
58
58
  const property2mapEventName = (propertyName) => {
59
59
  return propertyName.slice(2).toLowerCase();
60
60
  };
61
- const language2vectorMapForeign = (lang) => {
62
- switch (lang) {
63
- case "en":
64
- return "style_en";
65
- case "zh-TW":
66
- case "zh":
67
- return "style_zh_cn";
68
- }
69
- };
70
61
  const place2point = (place) => [Number(place.lng), Number(place.lat)];
71
62
  const combineHandler = (fn1, fn2) => {
72
63
  return (...args) => {
@@ -304,7 +295,6 @@ export {
304
295
  isPlaceEqual,
305
296
  isPointEqual,
306
297
  isZoneEqual,
307
- language2vectorMapForeign,
308
298
  lnglat2point,
309
299
  maybeFunctionToFunction,
310
300
  pipeAsync,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",