react-native-maps 1.21.0-alpha.6 → 1.21.0-alpha.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.
- package/ios/AirGoogleMaps/AIRGoogleMap.h +6 -1
- package/ios/AirGoogleMaps/AIRGoogleMap.m +90 -7
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.h +13 -0
- package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.m +10 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +7 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +13 -91
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapOverlay.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapPolygonManager.m +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +3 -2
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +2 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m +2 -2
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.h +3 -0
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +16 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +531 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +4 -4
- package/ios/AirMaps/AIRMap.m +14 -2
- package/ios/AirMaps/AIRMapManager.m +6 -21
- package/ios/AirMaps/RCTConvert+AirMap.h +4 -0
- package/ios/AirMaps/RCTConvert+AirMap.m +2 -0
- package/ios/AirMaps/RNMapsAirModule.h +3 -0
- package/ios/AirMaps/RNMapsMapView.h +3 -0
- package/ios/AirMaps/RNMapsMapView.mm +12 -25
- package/lib/MapOverlay.d.ts +1 -1
- package/lib/MapView.d.ts +2 -2
- package/lib/MapView.js +20 -18
- package/lib/{FabricMapView.d.ts → createFabricMap.d.ts} +7 -6
- package/lib/createFabricMap.js +175 -0
- package/lib/specs/NativeComponentGoogleMapView.d.ts +713 -0
- package/lib/specs/NativeComponentGoogleMapView.js +21 -0
- package/lib/specs/NativeComponentMapView.d.ts +4 -11
- package/package.json +7 -7
- package/lib/FabricMapView.js +0 -175
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Commands = void 0;
|
|
7
|
+
const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
const codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
|
|
9
|
+
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
10
|
+
supportedCommands: [
|
|
11
|
+
'animateToRegion',
|
|
12
|
+
'setCamera',
|
|
13
|
+
'animateCamera',
|
|
14
|
+
'fitToElements',
|
|
15
|
+
'fitToSuppliedMarkers',
|
|
16
|
+
'fitToCoordinates',
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
exports.default = (0, codegenNativeComponent_1.default)('RNMapsGoogleMapView', {
|
|
20
|
+
excludedPlatforms: ['android'],
|
|
21
|
+
});
|
|
@@ -270,7 +270,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
270
270
|
* If `true` map will be cached and displayed as an image instead of being interactable, for performance usage.
|
|
271
271
|
*
|
|
272
272
|
* @default false
|
|
273
|
-
* @platform iOS: Apple
|
|
273
|
+
* @platform iOS: Apple Maps only
|
|
274
274
|
* @platform Android: Supported
|
|
275
275
|
*/
|
|
276
276
|
cacheEnabled?: boolean;
|
|
@@ -343,7 +343,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
343
343
|
*/
|
|
344
344
|
kmlSrc?: string;
|
|
345
345
|
/**
|
|
346
|
-
* If set, changes the position of the "Legal" label link in Apple
|
|
346
|
+
* If set, changes the position of the "Legal" label link in Apple Maps.
|
|
347
347
|
*
|
|
348
348
|
* @platform iOS: Apple Maps only
|
|
349
349
|
* @platform Android: Not supported
|
|
@@ -423,7 +423,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
423
423
|
* @platform Android: Supported
|
|
424
424
|
* @deprecated on Apple Maps, use `cameraZoomRange` instead
|
|
425
425
|
*/
|
|
426
|
-
|
|
426
|
+
maxZoom?: Float;
|
|
427
427
|
/**
|
|
428
428
|
* TODO: Add documentation
|
|
429
429
|
*
|
|
@@ -439,7 +439,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
439
439
|
* @platform Android: Supported
|
|
440
440
|
* @deprecated on Apple Maps, use `cameraZoomRange` instead
|
|
441
441
|
*/
|
|
442
|
-
|
|
442
|
+
minZoom?: Float;
|
|
443
443
|
/**
|
|
444
444
|
* If `false` the map won't move to the marker when pressed.
|
|
445
445
|
*
|
|
@@ -625,13 +625,6 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
625
625
|
* @platform Android: Supported
|
|
626
626
|
*/
|
|
627
627
|
pitchEnabled?: boolean;
|
|
628
|
-
/**
|
|
629
|
-
* The map framework to use.
|
|
630
|
-
* Either `"google"` for GoogleMaps, otherwise `undefined` to use the native map framework (`MapKit` in iOS and `GoogleMaps` in android).
|
|
631
|
-
*
|
|
632
|
-
* @platform iOS: Supported
|
|
633
|
-
* @platform Android: Supported
|
|
634
|
-
*/
|
|
635
628
|
/**
|
|
636
629
|
* The region to be displayed by the map.
|
|
637
630
|
* The region is defined by the center coordinates and the span of coordinates to display.
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "lib/index.js",
|
|
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.21.0-alpha.
|
|
8
|
+
"version": "1.21.0-alpha.8",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"@babel/core": "^7.25.2",
|
|
65
65
|
"@babel/preset-env": "^7.25.3",
|
|
66
66
|
"@babel/runtime": "^7.25.0",
|
|
67
|
-
"react-native": "^0.76.
|
|
67
|
+
"react-native": "^0.76.5",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
|
-
"@react-native/babel-preset": "0.76.
|
|
70
|
-
"@react-native/eslint-config": "0.76.
|
|
71
|
-
"@react-native/metro-config": "0.76.
|
|
72
|
-
"@react-native/typescript-config": "0.76.
|
|
69
|
+
"@react-native/babel-preset": "0.76.5",
|
|
70
|
+
"@react-native/eslint-config": "0.76.5",
|
|
71
|
+
"@react-native/metro-config": "0.76.5",
|
|
72
|
+
"@react-native/typescript-config": "0.76.5",
|
|
73
73
|
"@types/react": "^18.2.6",
|
|
74
74
|
"@types/react-test-renderer": "^18.0.0",
|
|
75
75
|
"babel-jest": "^29.6.3",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"codegenConfig": {
|
|
94
94
|
"name": "RNMapsSpecs",
|
|
95
95
|
"type": "all",
|
|
96
|
-
"jsSrcsDir": "./
|
|
96
|
+
"jsSrcsDir": "./src/specs",
|
|
97
97
|
"android": {
|
|
98
98
|
"javaPackageName": "com.rnmaps.fabric"
|
|
99
99
|
}
|
package/lib/FabricMapView.js
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.FabricMap = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const NativeAirMapsModule_1 = __importDefault(require("./specs/NativeAirMapsModule"));
|
|
32
|
-
const NativeComponentMapView_1 = __importStar(require("./specs/NativeComponentMapView"));
|
|
33
|
-
const react_native_1 = require("react-native");
|
|
34
|
-
exports.FabricMap = (0, react_1.forwardRef)((props, ref) => {
|
|
35
|
-
const fabricRef = (0, react_1.useRef)(null);
|
|
36
|
-
// Use Imperative Handle to expose commands
|
|
37
|
-
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
38
|
-
async getMarkersFrames(onlyVisible) {
|
|
39
|
-
if (fabricRef.current) {
|
|
40
|
-
return NativeAirMapsModule_1.default.getMarkersFrames((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, onlyVisible);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
throw new Error('getMarkersFrames is only supported on iOS with Fabric.');
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
async getCoordinateForPoint(point) {
|
|
47
|
-
if (fabricRef.current) {
|
|
48
|
-
return NativeAirMapsModule_1.default.getCoordinateForPoint((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, point);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
throw new Error('getCoordinateForPoint is only supported on iOS with Fabric.');
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
async getPointForCoordinate(coordinate) {
|
|
55
|
-
if (fabricRef.current) {
|
|
56
|
-
return NativeAirMapsModule_1.default.getPointForCoordinate((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
throw new Error('getPointForCoordinate is only supported on iOS with Fabric.');
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
async getAddressFromCoordinates(coordinate) {
|
|
63
|
-
if (fabricRef.current) {
|
|
64
|
-
return NativeAirMapsModule_1.default.getAddressFromCoordinates((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
throw new Error('getAddressFromCoordinates is only supported on iOS with Fabric.');
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
async takeSnapshot(config) {
|
|
71
|
-
if (fabricRef.current) {
|
|
72
|
-
return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, config);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
throw new Error('takeSnapshot is only supported on iOS with Fabric.');
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
async getCamera() {
|
|
79
|
-
if (fabricRef.current) {
|
|
80
|
-
return NativeAirMapsModule_1.default.getCamera((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
throw new Error('getCamera is only supported on iOS with Fabric.');
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
async getMapBoundaries() {
|
|
87
|
-
if (fabricRef.current) {
|
|
88
|
-
return NativeAirMapsModule_1.default.getMapBoundaries((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
throw new Error('getMapBoundaries is only supported on iOS with Fabric.');
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
animateToRegion(region, duration) {
|
|
95
|
-
if (fabricRef.current) {
|
|
96
|
-
try {
|
|
97
|
-
NativeComponentMapView_1.Commands.animateToRegion(fabricRef.current, JSON.stringify(region), duration);
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
throw new Error('Failed to animateToRegion');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
throw new Error('animateToRegion is only supported on iOS with Fabric.');
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
fitToElements(edgePadding, animated) {
|
|
108
|
-
if (fabricRef.current) {
|
|
109
|
-
try {
|
|
110
|
-
NativeComponentMapView_1.Commands.fitToElements(fabricRef.current, JSON.stringify(edgePadding), animated);
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
throw new Error('Failed to fitToElements');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
throw new Error('fitToElements is only supported on iOS with Fabric.');
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
fitToSuppliedMarkers(markers, edgePadding, animated) {
|
|
121
|
-
if (fabricRef.current) {
|
|
122
|
-
try {
|
|
123
|
-
NativeComponentMapView_1.Commands.fitToSuppliedMarkers(fabricRef.current, JSON.stringify(markers), JSON.stringify(edgePadding), animated);
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
throw new Error('Failed to fitToSuppliedMarkers');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
throw new Error('fitToSuppliedMarkers is only supported on iOS with Fabric.');
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
animateCamera(camera, duration) {
|
|
134
|
-
if (fabricRef.current) {
|
|
135
|
-
try {
|
|
136
|
-
NativeComponentMapView_1.Commands.animateCamera(fabricRef.current, JSON.stringify(camera), duration);
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
throw new Error('Failed to animateCamera');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
throw new Error('animateCamera is only supported on iOS with Fabric.');
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
fitToCoordinates(coordinates, edgePadding, animated) {
|
|
147
|
-
if (fabricRef.current) {
|
|
148
|
-
try {
|
|
149
|
-
NativeComponentMapView_1.Commands.fitToCoordinates(fabricRef.current, JSON.stringify(coordinates), JSON.stringify(edgePadding), animated);
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
throw new Error('Failed to fitToCoordinates');
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
throw new Error('fitToCoordinates is only supported on iOS with Fabric.');
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
setCamera(camera) {
|
|
160
|
-
if (fabricRef.current) {
|
|
161
|
-
try {
|
|
162
|
-
NativeComponentMapView_1.Commands.setCamera(fabricRef.current, JSON.stringify(camera));
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
console.error('Failed to set camera:', error);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
console.warn('setCamera is only supported on iOS with Fabric.');
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
}));
|
|
173
|
-
return <NativeComponentMapView_1.default {...props} ref={fabricRef}/>;
|
|
174
|
-
});
|
|
175
|
-
exports.default = exports.FabricMap;
|