expo-gaode-map 1.1.6 → 1.1.8

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.
Files changed (29) hide show
  1. package/README.md +1 -1
  2. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapView.kt +668 -627
  3. package/android/src/main/java/expo/modules/gaodemap/ExpoGaodeMapViewModule.kt +0 -2
  4. package/android/src/main/java/expo/modules/gaodemap/managers/OverlayManager.kt +3 -15
  5. package/android/src/main/java/expo/modules/gaodemap/managers/UIManager.kt +5 -56
  6. package/android/src/main/java/expo/modules/gaodemap/modules/SDKInitializer.kt +0 -1
  7. package/android/src/main/java/expo/modules/gaodemap/overlays/MarkerView.kt +139 -175
  8. package/build/ExpoGaodeMapView.d.ts.map +1 -1
  9. package/build/ExpoGaodeMapView.js +12 -0
  10. package/build/ExpoGaodeMapView.js.map +1 -1
  11. package/build/components/overlays/Circle.d.ts +1 -2
  12. package/build/components/overlays/Circle.d.ts.map +1 -1
  13. package/build/components/overlays/Circle.js +2 -31
  14. package/build/components/overlays/Circle.js.map +1 -1
  15. package/build/types/index.d.ts +1 -1
  16. package/build/types/index.d.ts.map +1 -1
  17. package/build/types/index.js.map +1 -1
  18. package/build/types/map-view.types.d.ts +36 -22
  19. package/build/types/map-view.types.d.ts.map +1 -1
  20. package/build/types/map-view.types.js.map +1 -1
  21. package/build/types/overlays.types.d.ts +2 -7
  22. package/build/types/overlays.types.d.ts.map +1 -1
  23. package/build/types/overlays.types.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/ExpoGaodeMapView.tsx +14 -3
  26. package/src/components/overlays/Circle.tsx +3 -39
  27. package/src/types/index.ts +1 -1
  28. package/src/types/map-view.types.ts +39 -23
  29. package/src/types/overlays.types.ts +2 -7
@@ -2,55 +2,19 @@
2
2
  * @Author : 尚博信_王强 wangqiang03@sunboxsoft.com
3
3
  * @Date : 2025-11-13 15:02:04
4
4
  * @LastEditors : 尚博信_王强 wangqiang03@sunboxsoft.com
5
- * @LastEditTime : 2025-11-21 10:36:10
5
+ * @LastEditTime : 2025-11-24 18:51:17
6
6
  * @FilePath : /expo-gaode-map/src/components/overlays/Circle.tsx
7
7
  * @Description :
8
8
  *
9
9
  * Copyright (c) 2025 by 尚博信_王强, All Rights Reserved.
10
10
  */
11
11
  import * as React from 'react';
12
- import { requireNativeViewManager } from 'expo-modules-core';
12
+
13
13
  import type { CircleProps } from '../../types';
14
14
  import { MapContext, CircleEventContext } from '../../ExpoGaodeMapView';
15
15
 
16
- const NativeCircleView = requireNativeViewManager('CircleView');
17
-
18
- export default function Circle(props: CircleProps) {
19
- // 如果有 children,使用声明式 API
20
- if (props.children) {
21
- return <CircleDeclarative {...props} />;
22
- }
23
- // 否则使用命令式 API
24
- return <CircleImperative {...props} />;
25
- }
26
-
27
- function CircleDeclarative(props: CircleProps) {
28
- const eventManager = React.useContext(CircleEventContext);
29
- const circleIdRef = React.useRef(`circle_${Date.now()}_${Math.random()}`);
30
-
31
- React.useEffect(() => {
32
- if (eventManager) {
33
- eventManager.register(circleIdRef.current, {
34
- onPress: props.onPress,
35
- });
36
- }
37
- return () => {
38
- if (eventManager) {
39
- eventManager.unregister(circleIdRef.current);
40
- }
41
- };
42
- }, [props.onPress]);
43
-
44
- return (
45
- <NativeCircleView
46
- {...props}
47
- >
48
- {props.children}
49
- </NativeCircleView>
50
- );
51
- }
52
16
 
53
- function CircleImperative(props: CircleProps) {
17
+ export default function CircleImperative(props: CircleProps) {
54
18
  const mapRef = React.useContext(MapContext);
55
19
  const eventManager = React.useContext(CircleEventContext);
56
20
  const circleIdRef = React.useRef<string | null>(null);
@@ -23,7 +23,7 @@ export type {
23
23
  MapViewProps,
24
24
  MapViewMethods,
25
25
  MapViewRef,
26
- NativeMapViewRef,
26
+
27
27
  } from './map-view.types';
28
28
 
29
29
  // 定位类型
@@ -289,39 +289,55 @@ export interface MapViewRef {
289
289
  setCenter(center: LatLng, animated?: boolean): Promise<void>;
290
290
  setZoom(zoom: number, animated?: boolean): Promise<void>;
291
291
  getCameraPosition(): Promise<CameraPosition>;
292
+ /**
293
+ * @@deprecated 不推荐使用,请使用声明式添加
294
+ */
292
295
  addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;
296
+ /**
297
+ * @@deprecated 不推荐使用,请使用声明式添加
298
+ */
293
299
  removeCircle(id: string): Promise<void>;
300
+ /**
301
+ * @@deprecated 不推荐使用,请使用声明式添加
302
+ */
294
303
  updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;
304
+ /**
305
+ * @@deprecated 不推荐使用,请使用声明式添加
306
+ */
295
307
  addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;
308
+ /**
309
+ * @@deprecated 不推荐使用,请使用声明式添加
310
+ */
296
311
  removeMarker(id: string): Promise<void>;
312
+ /**
313
+ * @@deprecated 不推荐使用,请使用声明式添加
314
+ */
297
315
  updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;
316
+ /**
317
+ * @@deprecated 不推荐使用,请使用声明式添加
318
+ */
298
319
  addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;
320
+ /**
321
+ * @@deprecated 不推荐使用,请使用声明式添加
322
+ */
299
323
  removePolyline(id: string): Promise<void>;
300
- updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;
324
+ /**
325
+ * @@deprecated 不推荐使用,请使用声明式添加
326
+ */
327
+ updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;
328
+ /**
329
+ * @@deprecated 不推荐使用,请使用声明式添加
330
+ */
301
331
  addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;
332
+
333
+ /**
334
+ * @@deprecated 不推荐使用,请使用声明式添加
335
+ */
302
336
  removePolygon(id: string): Promise<void>;
337
+
338
+ /**
339
+ * @@deprecated 不推荐使用,请使用声明式添加
340
+ */
303
341
  updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;
304
342
  }
305
343
 
306
- /**
307
- * 原生 MapView Ref 接口(所有参数必需)
308
- */
309
- export interface NativeMapViewRef {
310
- moveCamera(position: CameraPosition, duration: number): Promise<void>;
311
- getLatLng(point: Point): Promise<LatLng>;
312
- setCenter(center: LatLng, animated: boolean): Promise<void>;
313
- setZoom(zoom: number, animated: boolean): Promise<void>;
314
- getCameraPosition(): Promise<CameraPosition>;
315
- addCircle(id: string, props: import('./overlays.types').CircleProps): Promise<void>;
316
- removeCircle(id: string): Promise<void>;
317
- updateCircle(id: string, props: Partial<import('./overlays.types').CircleProps>): Promise<void>;
318
- addMarker(id: string, props: import('./overlays.types').MarkerProps): Promise<void>;
319
- removeMarker(id: string): Promise<void>;
320
- updateMarker(id: string, props: Partial<import('./overlays.types').MarkerProps>): Promise<void>;
321
- addPolyline(id: string, props: import('./overlays.types').PolylineProps): Promise<void>;
322
- removePolyline(id: string): Promise<void>;
323
- updatePolyline(id: string, props: Partial<import('./overlays.types').PolylineProps>): Promise<void>;
324
- addPolygon(id: string, props: import('./overlays.types').PolygonProps): Promise<void>;
325
- removePolygon(id: string): Promise<void>;
326
- updatePolygon(id: string, props: Partial<import('./overlays.types').PolygonProps>): Promise<void>;
327
- }
@@ -89,9 +89,9 @@ export interface MarkerProps {
89
89
 
90
90
  /**
91
91
  * 大头针颜色
92
- * @platform ios
92
+ * Android 支持更多颜色,iOS 只支持 red, green, purple
93
93
  */
94
- pinColor?: 'red' | 'green' | 'purple';
94
+ pinColor?: 'red' | 'orange' | 'yellow' | 'green' | 'cyan' | 'blue' | 'violet' | 'magenta' | 'rose' | 'purple';
95
95
 
96
96
  /**
97
97
  * 自定义视图
@@ -270,11 +270,6 @@ export interface CircleProps {
270
270
  */
271
271
  onPress?: (event: NativeSyntheticEvent<{}>) => void;
272
272
 
273
- /**
274
- * 自定义子元素
275
- * 暂不支持
276
- */
277
- children?: React.ReactNode;
278
273
 
279
274
  }
280
275