react-native-maps 1.21.0-alpha.7 → 1.21.0-alpha.70
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/android/build.gradle +38 -13
- package/android/generated/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +200 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +71 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNMapsSpecs-generated.cpp +68 -0
- package/android/generated/jni/RNMapsSpecs.h +31 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +26 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +28 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +918 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +787 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +154 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1058 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +21 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +76 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +77 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
- package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +593 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +259 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +137 -4
- package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +22 -2
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +79 -3
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
- package/android/src/main/java/com/rnmaps/maps/MapView.java +1588 -1346
- package/ios/AirGoogleMaps/AIRGoogleMap.h +3 -2
- package/ios/AirGoogleMaps/AIRGoogleMap.m +153 -48
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +17 -28
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +2 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +30 -0
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.h +3 -0
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +2 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +3 -3
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +161 -61
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +6 -3
- package/ios/AirMaps/AIRMap.m +289 -145
- package/ios/AirMaps/AIRMapManager.m +8 -17
- package/ios/AirMaps/AIRMapMarker.h +1 -0
- package/ios/AirMaps/AIRMapMarker.m +165 -103
- package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
- package/ios/AirMaps/RCTConvert+AirMap.h +4 -0
- package/ios/AirMaps/RCTConvert+AirMap.m +2 -0
- package/ios/AirMaps/RNMapsAirModule.h +1 -1
- package/ios/AirMaps/RNMapsAirModule.mm +42 -172
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
- package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
- package/ios/AirMaps/RNMapsMapView.h +3 -3
- package/ios/AirMaps/RNMapsMapView.mm +344 -307
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +430 -0
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +21 -0
- package/ios/AirMaps/UIView +AirMap.m +20 -0
- package/ios/AirMaps/UIView+AirMap.h +11 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +60 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +26 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +28 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +918 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +787 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +154 -0
- package/ios/generated/RNMapsSpecs/Props.h +1058 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +549 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +21 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +76 -0
- package/ios/generated/RNMapsSpecs/States.cpp +16 -0
- package/ios/generated/RNMapsSpecs/States.h +77 -0
- package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
- package/ios/generated/RNMapsSpecsJSI.h +268 -0
- package/lib/MapCallout.js +1 -0
- package/lib/MapMarker.d.ts +15 -2
- package/lib/MapMarker.js +53 -9
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.js +2 -8
- package/lib/MapPolyline.d.ts +1 -1
- package/lib/MapView.d.ts +7 -22
- package/lib/MapView.js +80 -89
- package/lib/{FabricMapView.d.ts → createFabricMap.d.ts} +7 -11
- package/lib/createFabricMap.js +175 -0
- package/lib/decorateMapComponent.js +22 -0
- package/lib/specs/NativeAirMapsModule.d.ts +2 -2
- package/lib/specs/NativeComponentCallout.d.ts +46 -0
- package/lib/specs/NativeComponentCallout.js +9 -0
- package/lib/specs/NativeComponentGoogleMapView.d.ts +12 -12
- package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
- package/lib/specs/NativeComponentGooglePolygon.js +9 -0
- package/lib/specs/NativeComponentMapView.d.ts +19 -36
- package/lib/specs/NativeComponentMapView.js +1 -3
- package/lib/specs/NativeComponentMarker.d.ts +258 -0
- package/lib/specs/NativeComponentMarker.js +19 -0
- package/package.json +15 -10
- package/react-native-maps.podspec +2 -1
- package/lib/FabricMapView.js +0 -181
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HostComponent } from 'react-native';
|
|
3
|
+
import type { ViewProps, ColorValue, ImageSourcePropType as ImageSource } from 'react-native';
|
|
4
|
+
import { Int32, Double, BubblingEventHandler, DirectEventHandler, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
|
+
export type LatLng = Readonly<{
|
|
6
|
+
latitude: Double;
|
|
7
|
+
longitude: Double;
|
|
8
|
+
}>;
|
|
9
|
+
export type MarkerPressEventHandler = BubblingEventHandler<Readonly<{
|
|
10
|
+
action: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
coordinate?: {
|
|
13
|
+
latitude: Double;
|
|
14
|
+
longitude: Double;
|
|
15
|
+
};
|
|
16
|
+
position?: {
|
|
17
|
+
x: Double;
|
|
18
|
+
y: Double;
|
|
19
|
+
};
|
|
20
|
+
}>>;
|
|
21
|
+
export type MarkerDragEventHandler = DirectEventHandler<Readonly<{
|
|
22
|
+
id?: string;
|
|
23
|
+
coordinate?: {
|
|
24
|
+
latitude: Double;
|
|
25
|
+
longitude: Double;
|
|
26
|
+
};
|
|
27
|
+
}>>;
|
|
28
|
+
export type CalloutPressEventHandler = BubblingEventHandler<Readonly<{
|
|
29
|
+
action: string;
|
|
30
|
+
id?: string;
|
|
31
|
+
frame?: {
|
|
32
|
+
x: Double;
|
|
33
|
+
y: Double;
|
|
34
|
+
width: Double;
|
|
35
|
+
height: Double;
|
|
36
|
+
};
|
|
37
|
+
point?: {
|
|
38
|
+
x: Double;
|
|
39
|
+
y: Double;
|
|
40
|
+
};
|
|
41
|
+
}>>;
|
|
42
|
+
type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
|
|
43
|
+
export type AppleMarkerPriority = 'required' | 'high' | 'low';
|
|
44
|
+
export type Point = Readonly<{
|
|
45
|
+
x: Double;
|
|
46
|
+
y: Double;
|
|
47
|
+
}>;
|
|
48
|
+
export interface MarkerFabricNativeProps extends ViewProps {
|
|
49
|
+
/**
|
|
50
|
+
* Sets the anchor point for the marker.
|
|
51
|
+
* The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
|
|
52
|
+
*
|
|
53
|
+
* The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
|
|
54
|
+
* where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
|
|
55
|
+
*
|
|
56
|
+
* The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding.
|
|
57
|
+
* For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
|
|
58
|
+
*
|
|
59
|
+
* @default {x: 0.5, y: 1.0}
|
|
60
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
|
|
61
|
+
* @platform Android: Supported
|
|
62
|
+
*/
|
|
63
|
+
anchor?: Point;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the point in the marker image at which to anchor the callout when it is displayed.
|
|
66
|
+
* This is specified in the same coordinate system as the anchor.
|
|
67
|
+
*
|
|
68
|
+
* See the `anchor` prop for more details.
|
|
69
|
+
*
|
|
70
|
+
* @default {x: 0.5, y: 0.0}
|
|
71
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `calloutOffset` prop
|
|
72
|
+
* @platform Android: Supported
|
|
73
|
+
*/
|
|
74
|
+
calloutAnchor?: Point;
|
|
75
|
+
/**
|
|
76
|
+
* A custom image to be used as the marker's icon. Only local image resources are allowed to be used.
|
|
77
|
+
*
|
|
78
|
+
* @platform iOS: Supported
|
|
79
|
+
* @platform Android: Supported
|
|
80
|
+
*/
|
|
81
|
+
image?: ImageSource | null;
|
|
82
|
+
/**
|
|
83
|
+
* The offset (in points) at which to place the callout bubble.
|
|
84
|
+
* When this property is set to (0, 0),
|
|
85
|
+
* the anchor point of the callout bubble is placed on the top-center point of the marker view’s frame.
|
|
86
|
+
*
|
|
87
|
+
* Specifying positive offset values moves the callout bubble down and to the right,
|
|
88
|
+
* while specifying negative values moves it up and to the left
|
|
89
|
+
*
|
|
90
|
+
* @default {x: 0.0, y: 0.0}
|
|
91
|
+
* @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
|
|
92
|
+
* @platform Android: Not supported. See the `calloutAnchor` prop
|
|
93
|
+
*/
|
|
94
|
+
calloutOffset?: Point;
|
|
95
|
+
/**
|
|
96
|
+
Constants that indicates the display priority for annotations.
|
|
97
|
+
@default required
|
|
98
|
+
@platform iOS: Apple Maps only.
|
|
99
|
+
@platform Android: Not supported
|
|
100
|
+
|
|
101
|
+
Required: A constant indicating that the item is required.
|
|
102
|
+
High: A constant indicating that the item’s display priority is high.
|
|
103
|
+
Low: A constant indicating that the item’s display priority is Low.
|
|
104
|
+
*/
|
|
105
|
+
displayPriority?: WithDefault<AppleMarkerPriority, 'required'>;
|
|
106
|
+
/**
|
|
107
|
+
* The coordinate for the marker.
|
|
108
|
+
*
|
|
109
|
+
* @platform iOS: Supported
|
|
110
|
+
* @platform Android: Supported
|
|
111
|
+
*/
|
|
112
|
+
coordinate: LatLng;
|
|
113
|
+
/**
|
|
114
|
+
* The description of the marker.
|
|
115
|
+
*
|
|
116
|
+
* This is only used if the <Marker /> component has no children that are a `<Callout />`,
|
|
117
|
+
* in which case the default callout behavior will be used,
|
|
118
|
+
* which will show both the `title` and the `description`, if provided.
|
|
119
|
+
*
|
|
120
|
+
* @platform iOS: Supported
|
|
121
|
+
* @platform Android: Supported
|
|
122
|
+
*/
|
|
123
|
+
description?: string;
|
|
124
|
+
/**
|
|
125
|
+
* if `true` allows the marker to be draggable (re-positioned).
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
* @platform iOS: Supported
|
|
129
|
+
* @platform Android: Supported
|
|
130
|
+
*/
|
|
131
|
+
draggable?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The title of the marker.
|
|
134
|
+
* This is only used if the <Marker /> component has no `<Callout />` children.
|
|
135
|
+
*
|
|
136
|
+
* If the marker has <Callout /> children, default callout behavior will be used,
|
|
137
|
+
* which will show both the `title` and the `description`, if provided.
|
|
138
|
+
*
|
|
139
|
+
* @platform iOS: Supported
|
|
140
|
+
* @platform Android: Supported
|
|
141
|
+
*/
|
|
142
|
+
title?: string;
|
|
143
|
+
/**
|
|
144
|
+
* A string that can be used to identify this marker.
|
|
145
|
+
*
|
|
146
|
+
* @platform iOS: Supported
|
|
147
|
+
* @platform Android: Supported
|
|
148
|
+
*/
|
|
149
|
+
identifier?: string;
|
|
150
|
+
/**
|
|
151
|
+
* When true, the marker will be pre-selected.
|
|
152
|
+
* Setting this to true allows the user to drag the marker without needing to tap on it first to focus it.
|
|
153
|
+
*
|
|
154
|
+
* @default false
|
|
155
|
+
* @platform iOS: Apple Maps only
|
|
156
|
+
* @platform Android: Not supported
|
|
157
|
+
*/
|
|
158
|
+
isPreselected?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Callback that is called when the user taps the callout view.
|
|
161
|
+
*
|
|
162
|
+
* @platform iOS: Apple Maps only
|
|
163
|
+
* @platform Android: Supported
|
|
164
|
+
*/
|
|
165
|
+
onCalloutPress?: CalloutPressEventHandler;
|
|
166
|
+
/**
|
|
167
|
+
* Callback that is called when the marker is deselected, before the callout is hidden.
|
|
168
|
+
*
|
|
169
|
+
* @platform iOS: Apple Maps only
|
|
170
|
+
* @platform Android: supported
|
|
171
|
+
*/
|
|
172
|
+
onDeselect?: MarkerPressEventHandler;
|
|
173
|
+
/**
|
|
174
|
+
* Callback called continuously as the marker is dragged
|
|
175
|
+
*
|
|
176
|
+
* @platform iOS: Apple Maps only
|
|
177
|
+
* @platform Android: Supported
|
|
178
|
+
*/
|
|
179
|
+
onDrag?: MarkerDragEventHandler;
|
|
180
|
+
/**
|
|
181
|
+
* Callback that is called when a drag on the marker finishes.
|
|
182
|
+
* This is usually the point you will want to setState on the marker's coordinate again
|
|
183
|
+
*
|
|
184
|
+
* @platform iOS: Apple Maps only
|
|
185
|
+
* @platform Android: Supported
|
|
186
|
+
*/
|
|
187
|
+
onDragEnd?: MarkerDragEventHandler;
|
|
188
|
+
/**
|
|
189
|
+
* Callback that is called when the user initiates a drag on the marker (if it is draggable)
|
|
190
|
+
*
|
|
191
|
+
* @platform iOS: Apple Maps only
|
|
192
|
+
* @platform Android: Supported
|
|
193
|
+
*/
|
|
194
|
+
onDragStart?: MarkerDragEventHandler;
|
|
195
|
+
/**
|
|
196
|
+
* Callback that is called when the marker is tapped by the user.
|
|
197
|
+
*
|
|
198
|
+
* @platform iOS: Supported
|
|
199
|
+
* @platform Android: Supported
|
|
200
|
+
*/
|
|
201
|
+
onPress?: MarkerPressEventHandler;
|
|
202
|
+
/**
|
|
203
|
+
* Callback that is called when the marker becomes selected.
|
|
204
|
+
* This will be called when the callout for that marker is about to be shown.
|
|
205
|
+
*
|
|
206
|
+
* @platform iOS: Supported.
|
|
207
|
+
* @platform Android: Supported
|
|
208
|
+
*/
|
|
209
|
+
onSelect?: MarkerPressEventHandler;
|
|
210
|
+
/**
|
|
211
|
+
* The marker's opacity between 0.0 and 1.0.
|
|
212
|
+
*
|
|
213
|
+
* @default 1.0
|
|
214
|
+
* @platform iOS: Supported
|
|
215
|
+
* @platform Android: Supported
|
|
216
|
+
*/
|
|
217
|
+
opacity?: WithDefault<Double, 1.0>;
|
|
218
|
+
/**
|
|
219
|
+
* If no custom marker view or custom image is provided, the platform default pin will be used, which can be customized by this color.
|
|
220
|
+
* Ignored if a custom marker is being used.<br/><br/>
|
|
221
|
+
* For Android, the set of available colors is limited. Unsupported colors will fall back to red.
|
|
222
|
+
* See [#887](https://github.com/react-community/react-native-maps/issues/887) for more information.
|
|
223
|
+
*
|
|
224
|
+
* @platform iOS: Supported
|
|
225
|
+
* @platform Android: Supported
|
|
226
|
+
*/
|
|
227
|
+
pinColor?: ColorValue;
|
|
228
|
+
/**
|
|
229
|
+
* Visibility of the title text rendered beneath Marker balloon
|
|
230
|
+
* @platform iOS: Apple Maps only
|
|
231
|
+
* @platform Android: Not supported
|
|
232
|
+
*/
|
|
233
|
+
titleVisibility?: WithDefault<AppleMarkerVisibility, 'visible'>;
|
|
234
|
+
/**
|
|
235
|
+
* Visibility of the subtitle text rendered beneath Marker balloon
|
|
236
|
+
* @platform iOS: Apple Maps only
|
|
237
|
+
* @platform Android: Not supported
|
|
238
|
+
*/
|
|
239
|
+
subtitleVisibility?: WithDefault<AppleMarkerVisibility, 'adaptive'>;
|
|
240
|
+
/**
|
|
241
|
+
* Indicate type of default markers if it's true MKPinAnnotationView will be used and MKMarkerAnnotationView if it's false
|
|
242
|
+
* It doesn't change anything if you are using custom Markers
|
|
243
|
+
* @platform iOS: Apple Maps only
|
|
244
|
+
* @platform Android: Not supported
|
|
245
|
+
*/
|
|
246
|
+
useLegacyPinView?: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface NativeCommands {
|
|
249
|
+
animateToCoordinates: (viewRef: React.ElementRef<React.ComponentType>, latitude: Double, longitude: Double, duration: Int32) => void;
|
|
250
|
+
setCoordinates: (viewRef: React.ElementRef<React.ComponentType>, latitude: Double, longitude: Double) => void;
|
|
251
|
+
showCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
252
|
+
hideCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
253
|
+
redrawCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
254
|
+
redraw: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
255
|
+
}
|
|
256
|
+
export declare const Commands: NativeCommands;
|
|
257
|
+
declare const _default: HostComponent<MarkerFabricNativeProps>;
|
|
258
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
'setCoordinates',
|
|
12
|
+
'animateToCoordinates',
|
|
13
|
+
'showCallout',
|
|
14
|
+
'hideCallout',
|
|
15
|
+
'redrawCallout',
|
|
16
|
+
'redraw',
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
exports.default = (0, codegenNativeComponent_1.default)('RNMapsMarker', {});
|
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.70",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"mapkit"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"react": ">=
|
|
48
|
-
"react-native": ">= 0.
|
|
47
|
+
"react": ">= 18.2.0",
|
|
48
|
+
"react-native": ">= 0.74.0",
|
|
49
49
|
"react-native-web": ">= 0.11"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
@@ -64,17 +64,17 @@
|
|
|
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.
|
|
67
|
+
"react-native": "^0.77.1",
|
|
68
|
+
"@react-native-community/cli": "15.0.1",
|
|
68
69
|
"react": "^18.3.1",
|
|
69
|
-
"@react-native/babel-preset": "0.
|
|
70
|
-
"@react-native/eslint-config": "0.
|
|
71
|
-
"@react-native/metro-config": "0.
|
|
72
|
-
"@react-native/typescript-config": "0.
|
|
70
|
+
"@react-native/babel-preset": "0.77.1",
|
|
71
|
+
"@react-native/eslint-config": "0.77.1",
|
|
72
|
+
"@react-native/metro-config": "0.77.1",
|
|
73
|
+
"@react-native/typescript-config": "0.77.1",
|
|
73
74
|
"@types/react": "^18.2.6",
|
|
74
75
|
"@types/react-test-renderer": "^18.0.0",
|
|
75
|
-
"babel-jest": "^29.6.3",
|
|
76
76
|
"eslint": "^8.19.0",
|
|
77
|
-
"@types/jest": "29.5.
|
|
77
|
+
"@types/jest": "29.5.13",
|
|
78
78
|
"jest": "^29.6.3",
|
|
79
79
|
"prettier": "2.8.8",
|
|
80
80
|
"react-test-renderer": "18.3.1",
|
|
@@ -94,6 +94,11 @@
|
|
|
94
94
|
"name": "RNMapsSpecs",
|
|
95
95
|
"type": "all",
|
|
96
96
|
"jsSrcsDir": "./src/specs",
|
|
97
|
+
"outputDir": {
|
|
98
|
+
"ios": "ios/generated",
|
|
99
|
+
"android": "android/generated"
|
|
100
|
+
},
|
|
101
|
+
"includesGeneratedCode": true,
|
|
97
102
|
"android": {
|
|
98
103
|
"javaPackageName": "com.rnmaps.fabric"
|
|
99
104
|
}
|
|
@@ -9,13 +9,14 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.authors = package["author"]
|
|
10
10
|
s.homepage = package["homepage"]
|
|
11
11
|
s.license = package["license"]
|
|
12
|
-
s.platform = :ios, "
|
|
12
|
+
s.platform = :ios, "13.0"
|
|
13
13
|
|
|
14
14
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
15
15
|
s.source_files = "ios/AirMaps/**/*.{h,m,mm,swift}"
|
|
16
16
|
s.resource_bundles = {
|
|
17
17
|
'ReactNativeMapsPrivacy' => ['ios/PrivacyInfo.xcprivacy']
|
|
18
18
|
}
|
|
19
|
+
s.dependency 'react-native-maps-generated'
|
|
19
20
|
s.dependency 'React-Core'
|
|
20
21
|
|
|
21
22
|
install_modules_dependencies(s)
|
package/lib/FabricMapView.js
DELETED
|
@@ -1,181 +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 NativeComponentGoogleMapView_1 = __importDefault(require("./specs/NativeComponentGoogleMapView"));
|
|
34
|
-
const react_native_1 = require("react-native");
|
|
35
|
-
exports.FabricMap = (0, react_1.forwardRef)((props, ref) => {
|
|
36
|
-
const fabricRef = (0, react_1.useRef)(null);
|
|
37
|
-
// Use Imperative Handle to expose commands
|
|
38
|
-
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
39
|
-
async getMarkersFrames(onlyVisible) {
|
|
40
|
-
if (fabricRef.current) {
|
|
41
|
-
return NativeAirMapsModule_1.default.getMarkersFrames((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, onlyVisible);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw new Error('getMarkersFrames is only supported on iOS with Fabric.');
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
async getCoordinateForPoint(point) {
|
|
48
|
-
if (fabricRef.current) {
|
|
49
|
-
return NativeAirMapsModule_1.default.getCoordinateForPoint((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, point);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
throw new Error('getCoordinateForPoint is only supported on iOS with Fabric.');
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
async getPointForCoordinate(coordinate) {
|
|
56
|
-
if (fabricRef.current) {
|
|
57
|
-
return NativeAirMapsModule_1.default.getPointForCoordinate((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
throw new Error('getPointForCoordinate is only supported on iOS with Fabric.');
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
async getAddressFromCoordinates(coordinate) {
|
|
64
|
-
if (fabricRef.current) {
|
|
65
|
-
return NativeAirMapsModule_1.default.getAddressFromCoordinates((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
throw new Error('getAddressFromCoordinates is only supported on iOS with Fabric.');
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
async takeSnapshot(config) {
|
|
72
|
-
if (fabricRef.current) {
|
|
73
|
-
return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, config);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
throw new Error('takeSnapshot is only supported on iOS with Fabric.');
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
async getCamera() {
|
|
80
|
-
if (fabricRef.current) {
|
|
81
|
-
return NativeAirMapsModule_1.default.getCamera((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
throw new Error('getCamera is only supported on iOS with Fabric.');
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
async getMapBoundaries() {
|
|
88
|
-
if (fabricRef.current) {
|
|
89
|
-
return NativeAirMapsModule_1.default.getMapBoundaries((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
throw new Error('getMapBoundaries is only supported on iOS with Fabric.');
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
animateToRegion(region, duration) {
|
|
96
|
-
if (fabricRef.current) {
|
|
97
|
-
try {
|
|
98
|
-
NativeComponentMapView_1.Commands.animateToRegion(fabricRef.current, JSON.stringify(region), duration);
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
throw new Error('Failed to animateToRegion');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
throw new Error('animateToRegion is only supported on iOS with Fabric.');
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
fitToElements(edgePadding, animated) {
|
|
109
|
-
if (fabricRef.current) {
|
|
110
|
-
try {
|
|
111
|
-
NativeComponentMapView_1.Commands.fitToElements(fabricRef.current, JSON.stringify(edgePadding), animated);
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
throw new Error('Failed to fitToElements');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
throw new Error('fitToElements is only supported on iOS with Fabric.');
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
fitToSuppliedMarkers(markers, edgePadding, animated) {
|
|
122
|
-
if (fabricRef.current) {
|
|
123
|
-
try {
|
|
124
|
-
NativeComponentMapView_1.Commands.fitToSuppliedMarkers(fabricRef.current, JSON.stringify(markers), JSON.stringify(edgePadding), animated);
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
throw new Error('Failed to fitToSuppliedMarkers');
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
throw new Error('fitToSuppliedMarkers is only supported on iOS with Fabric.');
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
animateCamera(camera, duration) {
|
|
135
|
-
if (fabricRef.current) {
|
|
136
|
-
try {
|
|
137
|
-
NativeComponentMapView_1.Commands.animateCamera(fabricRef.current, JSON.stringify(camera), duration);
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
throw new Error('Failed to animateCamera');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
throw new Error('animateCamera is only supported on iOS with Fabric.');
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
fitToCoordinates(coordinates, edgePadding, animated) {
|
|
148
|
-
if (fabricRef.current) {
|
|
149
|
-
try {
|
|
150
|
-
NativeComponentMapView_1.Commands.fitToCoordinates(fabricRef.current, JSON.stringify(coordinates), JSON.stringify(edgePadding), animated);
|
|
151
|
-
}
|
|
152
|
-
catch (error) {
|
|
153
|
-
throw new Error('Failed to fitToCoordinates');
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
throw new Error('fitToCoordinates is only supported on iOS with Fabric.');
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
setCamera(camera) {
|
|
161
|
-
if (fabricRef.current) {
|
|
162
|
-
try {
|
|
163
|
-
NativeComponentMapView_1.Commands.setCamera(fabricRef.current, JSON.stringify(camera));
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
console.error('Failed to set camera:', error);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
console.warn('setCamera is only supported on iOS with Fabric.');
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
}));
|
|
174
|
-
if (props.provider === 'google') {
|
|
175
|
-
return <NativeComponentGoogleMapView_1.default {...props} ref={fabricRef}/>;
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
return <NativeComponentMapView_1.default {...props} ref={fabricRef}/>;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
exports.default = exports.FabricMap;
|