react-native-maps 1.28.2 → 1.29.0
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/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +2 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +175 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +157 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +183 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +431 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +2 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +22 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +4 -0
- package/dist/src/specs/NativeComponentGoogleMarker.d.ts +250 -0
- package/dist/src/specs/NativeComponentPolygon.d.ts +108 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +3 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +8 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMarkerView.h +28 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMarkerView.mm +357 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMarkerView.h +24 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMarkerView.mm +64 -0
- package/ios/AirMaps/RNMapsMapView.mm +8 -0
- package/ios/AirMaps/RNMapsPolygonView.h +26 -0
- package/ios/AirMaps/RNMapsPolygonView.mm +240 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +2 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +2 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +2 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +175 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +157 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +178 -0
- package/ios/generated/RNMapsSpecs/Props.h +379 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +143 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +2 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +22 -0
- package/ios/generated/RNMapsSpecs/States.h +4 -0
- package/package.json +4 -2
- package/src/MapMarker.tsx +4 -3
- package/src/decorateMapComponent.ts +29 -15
- package/src/specs/NativeComponentGoogleMarker.ts +327 -0
- package/src/specs/NativeComponentPolygon.ts +137 -0
|
@@ -51,6 +51,17 @@ using RNMapsGoogleMapViewShadowNode = ConcreteViewShadowNode<
|
|
|
51
51
|
RNMapsGoogleMapViewEventEmitter,
|
|
52
52
|
RNMapsGoogleMapViewState>;
|
|
53
53
|
|
|
54
|
+
JSI_EXPORT extern const char RNMapsGoogleMarkerComponentName[];
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* `ShadowNode` for <RNMapsGoogleMarker> component.
|
|
58
|
+
*/
|
|
59
|
+
using RNMapsGoogleMarkerShadowNode = ConcreteViewShadowNode<
|
|
60
|
+
RNMapsGoogleMarkerComponentName,
|
|
61
|
+
RNMapsGoogleMarkerProps,
|
|
62
|
+
RNMapsGoogleMarkerEventEmitter,
|
|
63
|
+
RNMapsGoogleMarkerState>;
|
|
64
|
+
|
|
54
65
|
JSI_EXPORT extern const char RNMapsGooglePolygonComponentName[];
|
|
55
66
|
|
|
56
67
|
/*
|
|
@@ -95,6 +106,17 @@ using RNMapsOverlayShadowNode = ConcreteViewShadowNode<
|
|
|
95
106
|
RNMapsOverlayEventEmitter,
|
|
96
107
|
RNMapsOverlayState>;
|
|
97
108
|
|
|
109
|
+
JSI_EXPORT extern const char RNMapsPolygonComponentName[];
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
* `ShadowNode` for <RNMapsPolygon> component.
|
|
113
|
+
*/
|
|
114
|
+
using RNMapsPolygonShadowNode = ConcreteViewShadowNode<
|
|
115
|
+
RNMapsPolygonComponentName,
|
|
116
|
+
RNMapsPolygonProps,
|
|
117
|
+
RNMapsPolygonEventEmitter,
|
|
118
|
+
RNMapsPolygonState>;
|
|
119
|
+
|
|
98
120
|
JSI_EXPORT extern const char RNMapsPolylineComponentName[];
|
|
99
121
|
|
|
100
122
|
/*
|
|
@@ -21,6 +21,8 @@ using RNMapsCircleState = StateData;
|
|
|
21
21
|
|
|
22
22
|
using RNMapsGoogleMapViewState = StateData;
|
|
23
23
|
|
|
24
|
+
using RNMapsGoogleMarkerState = StateData;
|
|
25
|
+
|
|
24
26
|
using RNMapsGooglePolygonState = StateData;
|
|
25
27
|
|
|
26
28
|
using RNMapsMapViewState = StateData;
|
|
@@ -29,6 +31,8 @@ using RNMapsMarkerState = StateData;
|
|
|
29
31
|
|
|
30
32
|
using RNMapsOverlayState = StateData;
|
|
31
33
|
|
|
34
|
+
using RNMapsPolygonState = StateData;
|
|
35
|
+
|
|
32
36
|
using RNMapsPolylineState = StateData;
|
|
33
37
|
|
|
34
38
|
using RNMapsUrlTileState = StateData;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { ViewProps, ColorValue, ImageSourcePropType as ImageSource } from 'react-native';
|
|
3
|
+
import type { Int32, Double, Float, BubblingEventHandler, DirectEventHandler, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
export type LatLng = Readonly<{
|
|
5
|
+
latitude: Double;
|
|
6
|
+
longitude: Double;
|
|
7
|
+
}>;
|
|
8
|
+
export type MarkerPressEventHandler = BubblingEventHandler<Readonly<{
|
|
9
|
+
action: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
coordinate?: {
|
|
12
|
+
latitude: Double;
|
|
13
|
+
longitude: Double;
|
|
14
|
+
};
|
|
15
|
+
position?: {
|
|
16
|
+
x: Double;
|
|
17
|
+
y: Double;
|
|
18
|
+
};
|
|
19
|
+
}>>;
|
|
20
|
+
export type MarkerDragEventHandler = DirectEventHandler<Readonly<{
|
|
21
|
+
id?: string;
|
|
22
|
+
coordinate?: {
|
|
23
|
+
latitude: Double;
|
|
24
|
+
longitude: Double;
|
|
25
|
+
};
|
|
26
|
+
position?: {
|
|
27
|
+
x: Double;
|
|
28
|
+
y: Double;
|
|
29
|
+
};
|
|
30
|
+
}>>;
|
|
31
|
+
export type MarkerSelectEventHandler = DirectEventHandler<Readonly<{
|
|
32
|
+
action?: string;
|
|
33
|
+
id?: string;
|
|
34
|
+
coordinate?: {
|
|
35
|
+
latitude: Double;
|
|
36
|
+
longitude: Double;
|
|
37
|
+
};
|
|
38
|
+
position?: {
|
|
39
|
+
x: Double;
|
|
40
|
+
y: Double;
|
|
41
|
+
};
|
|
42
|
+
}>>;
|
|
43
|
+
export type CalloutPressEventHandler = BubblingEventHandler<Readonly<{
|
|
44
|
+
action: string;
|
|
45
|
+
id?: string;
|
|
46
|
+
frame?: {
|
|
47
|
+
x: Double;
|
|
48
|
+
y: Double;
|
|
49
|
+
width: Double;
|
|
50
|
+
height: Double;
|
|
51
|
+
};
|
|
52
|
+
point?: {
|
|
53
|
+
x: Double;
|
|
54
|
+
y: Double;
|
|
55
|
+
};
|
|
56
|
+
}>>;
|
|
57
|
+
export type Point = Readonly<{
|
|
58
|
+
x: Double;
|
|
59
|
+
y: Double;
|
|
60
|
+
}>;
|
|
61
|
+
export interface GoogleMarkerFabricNativeProps extends ViewProps {
|
|
62
|
+
/**
|
|
63
|
+
* Sets the anchor point for the marker.
|
|
64
|
+
* The anchor specifies the point in the icon image that is anchored to the
|
|
65
|
+
* marker's position on the Earth's surface.
|
|
66
|
+
*
|
|
67
|
+
* @default {x: 0.5, y: 1.0}
|
|
68
|
+
* @platform iOS: Google Maps only
|
|
69
|
+
* @platform Android: Supported
|
|
70
|
+
*/
|
|
71
|
+
anchor?: Point;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies the point in the marker image at which to anchor the callout when
|
|
74
|
+
* it is displayed.
|
|
75
|
+
*
|
|
76
|
+
* @default {x: 0.5, y: 0.0}
|
|
77
|
+
* @platform iOS: Google Maps only
|
|
78
|
+
* @platform Android: Supported
|
|
79
|
+
*/
|
|
80
|
+
calloutAnchor?: Point;
|
|
81
|
+
/**
|
|
82
|
+
* A custom image to be used as the marker's icon. Only local image resources
|
|
83
|
+
* are allowed to be used.
|
|
84
|
+
*
|
|
85
|
+
* @platform iOS: Supported
|
|
86
|
+
* @platform Android: Supported
|
|
87
|
+
*/
|
|
88
|
+
image?: ImageSource | null;
|
|
89
|
+
/**
|
|
90
|
+
* A custom image to be used as the marker's icon (Google Maps icon source).
|
|
91
|
+
*
|
|
92
|
+
* @platform iOS: Google Maps only
|
|
93
|
+
* @platform Android: Supported
|
|
94
|
+
*/
|
|
95
|
+
icon?: ImageSource | null;
|
|
96
|
+
/**
|
|
97
|
+
* The coordinate for the marker.
|
|
98
|
+
*
|
|
99
|
+
* @platform iOS: Supported
|
|
100
|
+
* @platform Android: Supported
|
|
101
|
+
*/
|
|
102
|
+
coordinate: LatLng;
|
|
103
|
+
/**
|
|
104
|
+
* The description of the marker, shown in the default callout.
|
|
105
|
+
*
|
|
106
|
+
* @platform iOS: Supported
|
|
107
|
+
* @platform Android: Supported
|
|
108
|
+
*/
|
|
109
|
+
description?: string;
|
|
110
|
+
/**
|
|
111
|
+
* if `true` allows the marker to be draggable (re-positioned).
|
|
112
|
+
*
|
|
113
|
+
* @default false
|
|
114
|
+
* @platform iOS: Supported
|
|
115
|
+
* @platform Android: Supported
|
|
116
|
+
*/
|
|
117
|
+
draggable?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The title of the marker, shown in the default callout.
|
|
120
|
+
*
|
|
121
|
+
* @platform iOS: Supported
|
|
122
|
+
* @platform Android: Supported
|
|
123
|
+
*/
|
|
124
|
+
title?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Sets whether this marker should track view changes.
|
|
127
|
+
* Turn it off whenever possible to improve custom marker performance.
|
|
128
|
+
*
|
|
129
|
+
* @default true
|
|
130
|
+
* @platform iOS: Google Maps only
|
|
131
|
+
* @platform Android: Supported
|
|
132
|
+
*/
|
|
133
|
+
tracksViewChanges?: WithDefault<boolean, true>;
|
|
134
|
+
/**
|
|
135
|
+
* Sets whether this marker's info window should track view changes.
|
|
136
|
+
*
|
|
137
|
+
* @default false
|
|
138
|
+
* @platform iOS: Google Maps only
|
|
139
|
+
* @platform Android: Not supported
|
|
140
|
+
*/
|
|
141
|
+
tracksInfoWindowChanges?: WithDefault<boolean, false>;
|
|
142
|
+
/**
|
|
143
|
+
* Sets whether this marker should be flat against the map (true) or a
|
|
144
|
+
* billboard facing the camera (false).
|
|
145
|
+
*
|
|
146
|
+
* @default false
|
|
147
|
+
* @platform iOS: Google Maps only
|
|
148
|
+
* @platform Android: Supported
|
|
149
|
+
*/
|
|
150
|
+
flat?: WithDefault<boolean, false>;
|
|
151
|
+
/**
|
|
152
|
+
* The rotation of the marker in degrees clockwise from the default position.
|
|
153
|
+
*
|
|
154
|
+
* @default 0
|
|
155
|
+
* @platform iOS: Google Maps only
|
|
156
|
+
* @platform Android: Supported
|
|
157
|
+
*/
|
|
158
|
+
rotation?: WithDefault<Float, 0>;
|
|
159
|
+
/**
|
|
160
|
+
* A string that can be used to identify this marker.
|
|
161
|
+
*
|
|
162
|
+
* @platform iOS: Supported
|
|
163
|
+
* @platform Android: Supported
|
|
164
|
+
*/
|
|
165
|
+
identifier?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the marker is tappable.
|
|
168
|
+
*
|
|
169
|
+
* @default true
|
|
170
|
+
* @platform iOS: Google Maps only
|
|
171
|
+
* @platform Android: Supported
|
|
172
|
+
*/
|
|
173
|
+
tappable?: WithDefault<boolean, true>;
|
|
174
|
+
/**
|
|
175
|
+
* Callback that is called when the user taps the callout view.
|
|
176
|
+
*
|
|
177
|
+
* @platform iOS: Google Maps only
|
|
178
|
+
* @platform Android: Supported
|
|
179
|
+
*/
|
|
180
|
+
onCalloutPress?: CalloutPressEventHandler;
|
|
181
|
+
/**
|
|
182
|
+
* Callback called continuously as the marker is dragged.
|
|
183
|
+
*
|
|
184
|
+
* @platform iOS: Google Maps only
|
|
185
|
+
* @platform Android: Supported
|
|
186
|
+
*/
|
|
187
|
+
onDrag?: MarkerDragEventHandler;
|
|
188
|
+
/**
|
|
189
|
+
* Callback that is called when a drag on the marker finishes.
|
|
190
|
+
*
|
|
191
|
+
* @platform iOS: Google Maps only
|
|
192
|
+
* @platform Android: Supported
|
|
193
|
+
*/
|
|
194
|
+
onDragEnd?: MarkerDragEventHandler;
|
|
195
|
+
/**
|
|
196
|
+
* Callback that is called when the user initiates a drag on the marker.
|
|
197
|
+
*
|
|
198
|
+
* @platform iOS: Google Maps only
|
|
199
|
+
* @platform Android: Supported
|
|
200
|
+
*/
|
|
201
|
+
onDragStart?: MarkerDragEventHandler;
|
|
202
|
+
/**
|
|
203
|
+
* Callback that is called when the marker is tapped by the user.
|
|
204
|
+
*
|
|
205
|
+
* @platform iOS: Supported
|
|
206
|
+
* @platform Android: Supported
|
|
207
|
+
*/
|
|
208
|
+
onPress?: MarkerPressEventHandler;
|
|
209
|
+
/**
|
|
210
|
+
* Callback that is called when the marker becomes selected.
|
|
211
|
+
*
|
|
212
|
+
* @platform iOS: Google Maps only
|
|
213
|
+
* @platform Android: Supported
|
|
214
|
+
*/
|
|
215
|
+
onSelect?: MarkerSelectEventHandler;
|
|
216
|
+
/**
|
|
217
|
+
* Callback that is called when the marker is deselected.
|
|
218
|
+
*
|
|
219
|
+
* @platform iOS: Google Maps only
|
|
220
|
+
* @platform Android: Supported
|
|
221
|
+
*/
|
|
222
|
+
onDeselect?: MarkerSelectEventHandler;
|
|
223
|
+
/**
|
|
224
|
+
* The marker's opacity between 0.0 and 1.0.
|
|
225
|
+
*
|
|
226
|
+
* @default 1.0
|
|
227
|
+
* @platform iOS: Supported
|
|
228
|
+
* @platform Android: Supported
|
|
229
|
+
*/
|
|
230
|
+
opacity?: WithDefault<Double, 1.0>;
|
|
231
|
+
/**
|
|
232
|
+
* If no custom marker view or custom image is provided, the platform default
|
|
233
|
+
* pin will be used, which can be customized by this color.
|
|
234
|
+
*
|
|
235
|
+
* @platform iOS: Supported
|
|
236
|
+
* @platform Android: Supported
|
|
237
|
+
*/
|
|
238
|
+
pinColor?: ColorValue;
|
|
239
|
+
}
|
|
240
|
+
export interface NativeCommands {
|
|
241
|
+
animateToCoordinates: (viewRef: React.ElementRef<React.ComponentType>, latitude: Double, longitude: Double, duration: Int32) => void;
|
|
242
|
+
setCoordinates: (viewRef: React.ElementRef<React.ComponentType>, latitude: Double, longitude: Double) => void;
|
|
243
|
+
showCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
244
|
+
hideCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
245
|
+
redrawCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
246
|
+
redraw: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
247
|
+
}
|
|
248
|
+
export declare const Commands: NativeCommands;
|
|
249
|
+
declare const _default: HostComponent<GoogleMarkerFabricNativeProps>;
|
|
250
|
+
export default _default;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps, ColorValue } from 'react-native';
|
|
2
|
+
import type { Double, BubblingEventHandler, Float, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export type LatLng = Readonly<{
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}>;
|
|
7
|
+
export type PolygonPressEventHandler = BubblingEventHandler<Readonly<{
|
|
8
|
+
action?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
coordinate: {
|
|
11
|
+
latitude: Double;
|
|
12
|
+
longitude: Double;
|
|
13
|
+
};
|
|
14
|
+
position?: {
|
|
15
|
+
x: Double;
|
|
16
|
+
y: Double;
|
|
17
|
+
};
|
|
18
|
+
}>>;
|
|
19
|
+
type LineCapType = 'butt' | 'round' | 'square';
|
|
20
|
+
type LineJoinType = 'miter' | 'round' | 'bevel';
|
|
21
|
+
export interface ApplePolygonFabricNativeProps extends ViewProps {
|
|
22
|
+
/**
|
|
23
|
+
* An array of coordinates to describe the polygon
|
|
24
|
+
*
|
|
25
|
+
* @platform iOS: Supported
|
|
26
|
+
* @platform Android: Supported
|
|
27
|
+
*/
|
|
28
|
+
coordinates: ReadonlyArray<LatLng>;
|
|
29
|
+
/**
|
|
30
|
+
* The fill color to use for the path.
|
|
31
|
+
*
|
|
32
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
33
|
+
* @platform iOS: Supported
|
|
34
|
+
* @platform Android: Supported
|
|
35
|
+
*/
|
|
36
|
+
fillColor?: ColorValue;
|
|
37
|
+
/**
|
|
38
|
+
* The stroke color to use for the path.
|
|
39
|
+
*
|
|
40
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
41
|
+
* @platform iOS: Supported
|
|
42
|
+
* @platform Android: Supported
|
|
43
|
+
*/
|
|
44
|
+
strokeColor?: ColorValue;
|
|
45
|
+
/**
|
|
46
|
+
* The stroke width to use for the path.
|
|
47
|
+
*
|
|
48
|
+
* @default 1
|
|
49
|
+
* @platform iOS: Supported
|
|
50
|
+
* @platform Android: Supported
|
|
51
|
+
*/
|
|
52
|
+
strokeWidth?: WithDefault<Float, 1.0>;
|
|
53
|
+
/**
|
|
54
|
+
* A 2d array of coordinates to describe holes of the polygon where each hole
|
|
55
|
+
* has at least 3 points.
|
|
56
|
+
*
|
|
57
|
+
* @platform iOS: Supported
|
|
58
|
+
* @platform Android: Supported
|
|
59
|
+
*/
|
|
60
|
+
holes?: ReadonlyArray<ReadonlyArray<LatLng>>;
|
|
61
|
+
/**
|
|
62
|
+
* The line cap style to use for the open ends of the stroke path.
|
|
63
|
+
*
|
|
64
|
+
* @default round
|
|
65
|
+
* @platform iOS: Apple Maps only
|
|
66
|
+
* @platform Android: Not supported
|
|
67
|
+
*/
|
|
68
|
+
lineCap?: WithDefault<LineCapType, 'round'>;
|
|
69
|
+
/**
|
|
70
|
+
* The line join style to use for the corners of the stroke path.
|
|
71
|
+
*
|
|
72
|
+
* @default round
|
|
73
|
+
* @platform iOS: Apple Maps only
|
|
74
|
+
* @platform Android: Not supported
|
|
75
|
+
*/
|
|
76
|
+
lineJoin?: WithDefault<LineJoinType, 'round'>;
|
|
77
|
+
/**
|
|
78
|
+
* The limiting value that helps avoid spikes at junctions between connected
|
|
79
|
+
* line segments.
|
|
80
|
+
*
|
|
81
|
+
* @platform iOS: Apple Maps only
|
|
82
|
+
* @platform Android: Not supported
|
|
83
|
+
*/
|
|
84
|
+
miterLimit?: WithDefault<Float, 10.0>;
|
|
85
|
+
/**
|
|
86
|
+
* The phase at which to start the line dash pattern.
|
|
87
|
+
*
|
|
88
|
+
* @platform iOS: Apple Maps only
|
|
89
|
+
* @platform Android: Not supported
|
|
90
|
+
*/
|
|
91
|
+
lineDashPhase?: WithDefault<Float, 0.0>;
|
|
92
|
+
/**
|
|
93
|
+
* An array of numbers specifying the dash pattern to use for the path.
|
|
94
|
+
*
|
|
95
|
+
* @platform iOS: Apple Maps only
|
|
96
|
+
* @platform Android: Supported
|
|
97
|
+
*/
|
|
98
|
+
lineDashPattern?: ReadonlyArray<Float>;
|
|
99
|
+
/**
|
|
100
|
+
* Callback that is called when the user taps the polygon.
|
|
101
|
+
*
|
|
102
|
+
* @platform iOS: Supported
|
|
103
|
+
* @platform Android: Supported
|
|
104
|
+
*/
|
|
105
|
+
onPress?: PolygonPressEventHandler;
|
|
106
|
+
}
|
|
107
|
+
declare const _default: HostComponent<ApplePolygonFabricNativeProps>;
|
|
108
|
+
export default _default;
|