react-native-maps 1.24.6 → 1.24.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.
|
@@ -593,6 +593,8 @@ using namespace facebook::react;
|
|
|
593
593
|
|
|
594
594
|
REMAP_MAPVIEW_STRING_PROP(kmlSrc)
|
|
595
595
|
REMAP_MAPVIEW_STRING_PROP(customMapStyleString)
|
|
596
|
+
REMAP_MAPVIEW_PROP(showsBuildings)
|
|
597
|
+
REMAP_MAPVIEW_PROP(rotateEnabled)
|
|
596
598
|
|
|
597
599
|
|
|
598
600
|
if (newViewProps.minZoom != oldViewProps.minZoom || newViewProps.maxZoom != oldViewProps.maxZoom){
|
|
@@ -544,26 +544,25 @@ newViewProps.name.right); \
|
|
|
544
544
|
|
|
545
545
|
#define REMAP_MAPVIEW_MAPTYPE(rnMapType) MKMapType##rnMapType
|
|
546
546
|
|
|
547
|
-
|
|
548
547
|
REMAP_MAPVIEW_PROP(cacheEnabled)
|
|
549
|
-
|
|
550
548
|
REMAP_MAPVIEW_PROP(followsUserLocation)
|
|
551
549
|
REMAP_MAPVIEW_PROP(loadingEnabled)
|
|
552
|
-
|
|
553
550
|
REMAP_MAPVIEW_PROP(scrollEnabled)
|
|
554
551
|
REMAP_MAPVIEW_PROP(handlePanDrag)
|
|
555
|
-
|
|
556
552
|
REMAP_MAPVIEW_PROP(maxDelta)
|
|
557
553
|
REMAP_MAPVIEW_PROP(maxZoom)
|
|
558
554
|
REMAP_MAPVIEW_PROP(minDelta)
|
|
559
555
|
REMAP_MAPVIEW_PROP(minZoom)
|
|
560
|
-
|
|
561
556
|
REMAP_MAPVIEW_PROP(showsCompass)
|
|
562
557
|
REMAP_MAPVIEW_PROP(showsScale)
|
|
563
558
|
REMAP_MAPVIEW_PROP(showsUserLocation)
|
|
564
559
|
REMAP_MAPVIEW_PROP(userLocationCalloutEnabled)
|
|
565
560
|
REMAP_MAPVIEW_PROP(zoomEnabled)
|
|
566
|
-
|
|
561
|
+
REMAP_MAPVIEW_PROP(loadingEnabled)
|
|
562
|
+
REMAP_MAPVIEW_PROP(showsTraffic)
|
|
563
|
+
REMAP_MAPVIEW_PROP(pitchEnabled)
|
|
564
|
+
REMAP_MAPVIEW_PROP(showsBuildings)
|
|
565
|
+
REMAP_MAPVIEW_PROP(rotateEnabled)
|
|
567
566
|
|
|
568
567
|
REMAP_MAPVIEW_POINT_PROP(compassOffset)
|
|
569
568
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
8
|
-
"version": "1.24.
|
|
8
|
+
"version": "1.24.8",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
package/src/createFabricMap.tsx
CHANGED
|
@@ -42,16 +42,29 @@ export interface FabricMapHandle {
|
|
|
42
42
|
setIndoorActiveLevelIndex: (activeLevelIndex: number) => void;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// Helper to safely get a node handle for supported types
|
|
46
|
+
function getNodeHandle(ref: unknown): null | number {
|
|
47
|
+
if (
|
|
48
|
+
ref === null ||
|
|
49
|
+
typeof ref === 'number' ||
|
|
50
|
+
(typeof ref === 'object' && ref !== null && '_reactInternals' in ref)
|
|
51
|
+
) {
|
|
52
|
+
// @ts-expect-error: safe for findNodeHandle
|
|
53
|
+
return findNodeHandle(ref);
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
45
58
|
const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
46
59
|
return forwardRef<FabricMapHandle | null, FabricMapViewProps>(
|
|
47
60
|
(props, ref) => {
|
|
48
|
-
const fabricRef = useRef<React.
|
|
61
|
+
const fabricRef = useRef<React.ComponentRef<typeof ViewComponent>>(null);
|
|
49
62
|
|
|
50
63
|
useImperativeHandle(ref, () => ({
|
|
51
64
|
async getMarkersFrames(onlyVisible: boolean) {
|
|
52
65
|
if (fabricRef.current) {
|
|
53
66
|
return NativeAirMapsModule.getMarkersFrames(
|
|
54
|
-
|
|
67
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
55
68
|
onlyVisible,
|
|
56
69
|
);
|
|
57
70
|
} else {
|
|
@@ -63,7 +76,7 @@ const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
|
63
76
|
async getCoordinateForPoint(point: Point) {
|
|
64
77
|
if (fabricRef.current) {
|
|
65
78
|
return NativeAirMapsModule.getCoordinateForPoint(
|
|
66
|
-
|
|
79
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
67
80
|
point,
|
|
68
81
|
);
|
|
69
82
|
} else {
|
|
@@ -75,7 +88,7 @@ const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
|
75
88
|
async getPointForCoordinate(coordinate: LatLng) {
|
|
76
89
|
if (fabricRef.current) {
|
|
77
90
|
return NativeAirMapsModule.getPointForCoordinate(
|
|
78
|
-
|
|
91
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
79
92
|
coordinate,
|
|
80
93
|
);
|
|
81
94
|
} else {
|
|
@@ -87,7 +100,7 @@ const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
|
87
100
|
async getAddressFromCoordinates(coordinate: LatLng) {
|
|
88
101
|
if (fabricRef.current) {
|
|
89
102
|
return NativeAirMapsModule.getAddressFromCoordinates(
|
|
90
|
-
|
|
103
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
91
104
|
coordinate,
|
|
92
105
|
);
|
|
93
106
|
} else {
|
|
@@ -99,7 +112,7 @@ const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
|
99
112
|
async takeSnapshot(config: SnapshotOptions) {
|
|
100
113
|
if (fabricRef.current) {
|
|
101
114
|
return NativeAirMapsModule.takeSnapshot(
|
|
102
|
-
|
|
115
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
103
116
|
JSON.stringify(config),
|
|
104
117
|
);
|
|
105
118
|
} else {
|
|
@@ -111,7 +124,7 @@ const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
|
111
124
|
async getCamera() {
|
|
112
125
|
if (fabricRef.current) {
|
|
113
126
|
return NativeAirMapsModule.getCamera(
|
|
114
|
-
|
|
127
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
115
128
|
);
|
|
116
129
|
} else {
|
|
117
130
|
throw new Error('getCamera is only supported on iOS with Fabric.');
|
|
@@ -120,7 +133,7 @@ const createFabricMap = (ViewComponent: React.ComponentType, Commands: any) => {
|
|
|
120
133
|
async getMapBoundaries() {
|
|
121
134
|
if (fabricRef.current) {
|
|
122
135
|
return NativeAirMapsModule.getMapBoundaries(
|
|
123
|
-
|
|
136
|
+
getNodeHandle(fabricRef.current) ?? -1,
|
|
124
137
|
);
|
|
125
138
|
} else {
|
|
126
139
|
throw new Error(
|