react-native-maps 1.21.0-alpha.115 → 1.21.0-alpha.117

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 (151) hide show
  1. package/android/src/generated/RCTAppDependencyProvider.h +25 -0
  2. package/android/src/generated/RCTAppDependencyProvider.mm +55 -0
  3. package/android/src/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  4. package/android/src/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  5. package/android/src/generated/RCTThirdPartyComponentsProvider.h +16 -0
  6. package/android/src/generated/RCTThirdPartyComponentsProvider.mm +26 -0
  7. package/android/src/generated/ReactAppDependencyProvider.podspec +34 -0
  8. package/android/src/generated/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
  9. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
  10. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +17 -0
  11. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
  12. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +23 -0
  13. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
  14. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +23 -0
  15. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +206 -0
  16. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +73 -0
  17. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
  18. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
  19. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +46 -0
  20. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +23 -0
  21. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
  22. package/android/src/generated/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +26 -0
  23. package/android/src/generated/jni/CMakeLists.txt +36 -0
  24. package/android/src/generated/jni/RNMapsSpecs-generated.cpp +68 -0
  25. package/android/src/generated/jni/RNMapsSpecs.h +31 -0
  26. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
  27. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +31 -0
  28. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +977 -0
  29. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +846 -0
  30. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +193 -0
  31. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1223 -0
  32. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
  33. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
  34. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +24 -0
  35. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +109 -0
  36. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
  37. package/android/src/generated/jni/react/renderer/components/RNMapsSpecs/States.h +113 -0
  38. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +28 -0
  39. package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +68 -0
  40. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
  41. package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +43 -0
  42. package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +0 -12
  43. package/ios/generated/ReactAppDependencyProvider.podspec +1 -1
  44. package/package.json +16 -18
  45. package/react-native-google-maps.podspec +29 -0
  46. package/src/AnimatedRegion.ts +169 -0
  47. package/src/Geojson.tsx +541 -0
  48. package/src/MapCallout.tsx +77 -0
  49. package/src/MapCalloutSubview.tsx +64 -0
  50. package/src/MapCircle.tsx +162 -0
  51. package/src/MapHeatmap.tsx +125 -0
  52. package/src/MapLocalTile.tsx +60 -0
  53. package/src/MapMarker.tsx +531 -0
  54. package/src/MapMarkerNativeComponent.ts +51 -0
  55. package/src/MapOverlay.tsx +156 -0
  56. package/src/MapPolygon.tsx +188 -0
  57. package/src/MapPolygon.types.ts +25 -0
  58. package/src/MapPolyline.tsx +215 -0
  59. package/src/MapUrlTile.tsx +169 -0
  60. package/src/MapView.tsx +1223 -0
  61. package/src/MapView.types.ts +212 -0
  62. package/src/MapView.web.ts +2 -0
  63. package/src/MapViewNativeComponent.ts +86 -0
  64. package/src/MapWMSTile.tsx +148 -0
  65. package/src/ProviderConstants.ts +2 -0
  66. package/src/createFabricMap.tsx +253 -0
  67. package/src/decorateMapComponent.ts +219 -0
  68. package/src/fixImageProp.ts +17 -0
  69. package/src/index.ts +52 -0
  70. package/src/sharedTypes.ts +101 -0
  71. package/src/specs/NativeAirMapsModule.ts +36 -0
  72. package/src/specs/NativeComponentCallout.ts +63 -0
  73. package/src/specs/NativeComponentCircle.ts +93 -0
  74. package/src/specs/NativeComponentGoogleMapView.ts +913 -0
  75. package/src/specs/NativeComponentGooglePolygon.ts +94 -0
  76. package/src/specs/NativeComponentMapView.ts +1091 -0
  77. package/src/specs/NativeComponentMarker.ts +326 -0
  78. package/src/specs/NativeComponentOverlay.ts +89 -0
  79. package/src/specs/NativeComponentPolyline.ts +124 -0
  80. package/ios/AirMaps/NSObject+DynamicLoad.h +0 -16
  81. package/ios/AirMaps/NSObject+DynamicLoad.m +0 -28
  82. package/lib/AnimatedRegion.d.ts +0 -19
  83. package/lib/AnimatedRegion.js +0 -134
  84. package/lib/Geojson.d.ts +0 -204
  85. package/lib/Geojson.js +0 -166
  86. package/lib/MapCallout.d.ts +0 -40
  87. package/lib/MapCallout.js +0 -51
  88. package/lib/MapCalloutSubview.d.ts +0 -34
  89. package/lib/MapCalloutSubview.js +0 -48
  90. package/lib/MapCircle.d.ts +0 -117
  91. package/lib/MapCircle.js +0 -53
  92. package/lib/MapHeatmap.d.ts +0 -78
  93. package/lib/MapHeatmap.js +0 -59
  94. package/lib/MapLocalTile.d.ts +0 -35
  95. package/lib/MapLocalTile.js +0 -44
  96. package/lib/MapMarker.d.ts +0 -322
  97. package/lib/MapMarker.js +0 -158
  98. package/lib/MapMarkerNativeComponent.d.ts +0 -15
  99. package/lib/MapMarkerNativeComponent.js +0 -15
  100. package/lib/MapOverlay.d.ts +0 -88
  101. package/lib/MapOverlay.js +0 -65
  102. package/lib/MapPolygon.d.ts +0 -140
  103. package/lib/MapPolygon.js +0 -53
  104. package/lib/MapPolygon.types.d.ts +0 -18
  105. package/lib/MapPolygon.types.js +0 -2
  106. package/lib/MapPolyline.d.ts +0 -156
  107. package/lib/MapPolyline.js +0 -53
  108. package/lib/MapUrlTile.d.ts +0 -134
  109. package/lib/MapUrlTile.js +0 -44
  110. package/lib/MapView.d.ts +0 -703
  111. package/lib/MapView.js +0 -428
  112. package/lib/MapView.types.d.ts +0 -161
  113. package/lib/MapView.types.js +0 -2
  114. package/lib/MapView.web.d.ts +0 -1
  115. package/lib/MapView.web.js +0 -9
  116. package/lib/MapViewNativeComponent.d.ts +0 -18
  117. package/lib/MapViewNativeComponent.js +0 -19
  118. package/lib/MapWMSTile.d.ts +0 -116
  119. package/lib/MapWMSTile.js +0 -44
  120. package/lib/ProviderConstants.d.ts +0 -2
  121. package/lib/ProviderConstants.js +0 -5
  122. package/lib/createFabricMap.d.ts +0 -24
  123. package/lib/createFabricMap.js +0 -188
  124. package/lib/decorateMapComponent.d.ts +0 -36
  125. package/lib/decorateMapComponent.js +0 -120
  126. package/lib/fixImageProp.d.ts +0 -4
  127. package/lib/fixImageProp.js +0 -16
  128. package/lib/index.d.ts +0 -38
  129. package/lib/index.js +0 -81
  130. package/lib/sharedTypes.d.ts +0 -81
  131. package/lib/sharedTypes.js +0 -2
  132. package/lib/sharedTypesInternal.js +0 -2
  133. package/lib/specs/NativeAirMapsModule.d.ts +0 -31
  134. package/lib/specs/NativeAirMapsModule.js +0 -4
  135. package/lib/specs/NativeComponentCallout.d.ts +0 -46
  136. package/lib/specs/NativeComponentCallout.js +0 -9
  137. package/lib/specs/NativeComponentCircle.d.ts +0 -74
  138. package/lib/specs/NativeComponentCircle.js +0 -7
  139. package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -710
  140. package/lib/specs/NativeComponentGoogleMapView.js +0 -22
  141. package/lib/specs/NativeComponentGooglePolygon.d.ts +0 -75
  142. package/lib/specs/NativeComponentGooglePolygon.js +0 -7
  143. package/lib/specs/NativeComponentMapView.d.ts +0 -872
  144. package/lib/specs/NativeComponentMapView.js +0 -20
  145. package/lib/specs/NativeComponentMarker.d.ts +0 -258
  146. package/lib/specs/NativeComponentMarker.js +0 -19
  147. package/lib/specs/NativeComponentOverlay.d.ts +0 -67
  148. package/lib/specs/NativeComponentOverlay.js +0 -7
  149. package/lib/specs/NativeComponentPolyline.d.ts +0 -101
  150. package/lib/specs/NativeComponentPolyline.js +0 -7
  151. /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
@@ -1,322 +0,0 @@
1
- import * as React from 'react';
2
- import { Animated, ViewProps, ImageURISource, ImageRequireSource } from 'react-native';
3
- import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
4
- import { MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
5
- import type { AppleMarkerPriority } from './specs/NativeComponentMarker';
6
- import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
7
- import { Modify } from './sharedTypesInternal';
8
- type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
9
- export type MapMarkerProps = ViewProps & {
10
- /**
11
- * Sets the anchor point for the marker.
12
- * The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
13
- *
14
- * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
15
- * where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
16
- *
17
- * 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.
18
- * For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
19
- *
20
- * @default {x: 0.5, y: 1.0}
21
- * @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
22
- * @platform Android: Supported
23
- */
24
- anchor?: Point;
25
- /**
26
- * Specifies the point in the marker image at which to anchor the callout when it is displayed.
27
- * This is specified in the same coordinate system as the anchor.
28
- *
29
- * See the `anchor` prop for more details.
30
- *
31
- * @default {x: 0.5, y: 0.0}
32
- * @platform iOS: Google Maps only. For Apple Maps, see the `calloutOffset` prop
33
- * @platform Android: Supported
34
- */
35
- calloutAnchor?: Point;
36
- /**
37
- * The offset (in points) at which to place the callout bubble.
38
- * When this property is set to (0, 0),
39
- * the anchor point of the callout bubble is placed on the top-center point of the marker view’s frame.
40
- *
41
- * Specifying positive offset values moves the callout bubble down and to the right,
42
- * while specifying negative values moves it up and to the left
43
- *
44
- * @default {x: 0.0, y: 0.0}
45
- * @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
46
- * @platform Android: Not supported. see the `calloutAnchor` prop
47
- */
48
- calloutOffset?: Point;
49
- /**
50
- * The offset (in points) at which to display the annotation view.
51
- *
52
- * By default, the center point of an annotation view is placed at the coordinate point of the associated annotation.
53
- *
54
- * Positive offset values move the annotation view down and to the right, while negative values move it up and to the left.
55
- *
56
- * @default {x: 0.0, y: 0.0}
57
- * @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
58
- * @platform Android: Not supported. see the `anchor` prop
59
- */
60
- centerOffset?: Point;
61
- /**
62
- * The coordinate for the marker.
63
- *
64
- * @platform iOS: Supported
65
- * @platform Android: Supported
66
- */
67
- coordinate: LatLng;
68
- /**
69
- * The description of the marker.
70
- *
71
- * This is only used if the <Marker /> component has no children that are a `<Callout />`,
72
- * in which case the default callout behavior will be used,
73
- * which will show both the `title` and the `description`, if provided.
74
- *
75
- * @platform iOS: Supported
76
- * @platform Android: Supported
77
- */
78
- description?: string;
79
- /**
80
- * if `true` allows the marker to be draggable (re-positioned).
81
- *
82
- * @default false
83
- * @platform iOS: Supported
84
- * @platform Android: Supported
85
- */
86
- draggable?: boolean;
87
- /**
88
- * Sets whether this marker should be flat against the map true or a billboard facing the camera.
89
- *
90
- * @default false
91
- * @platform iOS: Google Maps only
92
- * @platform Android: Supported
93
- */
94
- flat?: boolean;
95
- /**
96
- * Marker icon to render (equivalent to `icon` property of GMSMarker Class).
97
- * Only local image resources are allowed to be used.
98
- *
99
- * @platform iOS: Google Maps only
100
- * @platform Android: Supported
101
- */
102
- icon?: ImageURISource | ImageRequireSource;
103
- /**
104
- * A string that can be used to identify this marker.
105
- *
106
- * @platform iOS: Supported
107
- * @platform Android: Supported
108
- */
109
- identifier?: string;
110
- /**
111
- * A custom image to be used as the marker's icon. Only local image resources are allowed to be used.
112
- *
113
- * @platform iOS: Supported
114
- * @platform Android: Supported
115
- */
116
- image?: ImageURISource | ImageRequireSource;
117
- /**
118
- * When true, the marker will be pre-selected.
119
- * Setting this to true allows the user to drag the marker without needing to tap on it first to focus it.
120
- *
121
- * @default false
122
- * @platform iOS: Apple Maps only
123
- * @platform Android: Not supported
124
- */
125
- isPreselected?: boolean;
126
- /**
127
- * Callback that is called when the user taps the callout view.
128
- *
129
- * @platform iOS: Apple Maps only
130
- * @platform Android: Supported
131
- */
132
- onCalloutPress?: (event: CalloutPressEvent) => void;
133
- /**
134
- * Callback that is called when the marker is deselected, before the callout is hidden.
135
- *
136
- * @platform iOS: Apple Maps only
137
- * @platform Android: Not supported
138
- */
139
- onDeselect?: (event: MarkerDeselectEvent) => void;
140
- /**
141
- * Callback called continuously as the marker is dragged
142
- *
143
- * @platform iOS: Apple Maps only
144
- * @platform Android: Supported
145
- */
146
- onDrag?: (event: MarkerDragEvent) => void;
147
- /**
148
- * Callback that is called when a drag on the marker finishes.
149
- * This is usually the point you will want to setState on the marker's coordinate again
150
- *
151
- * @platform iOS: Apple Maps only
152
- * @platform Android: Supported
153
- */
154
- onDragEnd?: (event: MarkerDragStartEndEvent) => void;
155
- /**
156
- * Callback that is called when the user initiates a drag on the marker (if it is draggable)
157
- *
158
- * @platform iOS: Apple Maps only
159
- * @platform Android: Supported
160
- */
161
- onDragStart?: (event: MarkerDragStartEndEvent) => void;
162
- /**
163
- * Callback that is called when the marker is tapped by the user.
164
- *
165
- * @platform iOS: Supported
166
- * @platform Android: Supported
167
- */
168
- onPress?: (event: MarkerPressEvent) => void;
169
- /**
170
- * Callback that is called when the marker becomes selected.
171
- * This will be called when the callout for that marker is about to be shown.
172
- *
173
- * @platform iOS: Supported.
174
- * @platform Android: Supported
175
- */
176
- onSelect?: (event: MarkerSelectEvent) => void;
177
- /**
178
- * The marker's opacity between 0.0 and 1.0.
179
- *
180
- * @default 1.0
181
- * @platform iOS: Supported
182
- * @platform Android: Supported
183
- */
184
- opacity?: number;
185
- /**
186
- * If no custom marker view or custom image is provided, the platform default pin will be used, which can be customized by this color.
187
- * Ignored if a custom marker is being used.<br/><br/>
188
- * For Android, the set of available colors is limited. Unsupported colors will fall back to red.
189
- * See [#887](https://github.com/react-community/react-native-maps/issues/887) for more information.
190
- *
191
- * @platform iOS: Supported
192
- * @platform Android: Supported
193
- */
194
- pinColor?: string;
195
- /**
196
- * A float number indicating marker's rotation angle, in degrees.
197
- *
198
- * @default 0
199
- * @platform iOS: Google Maps only
200
- * @platform Android: Supported
201
- */
202
- rotation?: number;
203
- /**
204
- * Sets whether this marker should propagate `onPress` events.
205
- * Enabling it will stop the parent `MapView`'s `onPress` from being called.
206
- *
207
- * Android does not propagate `onPress` events.
208
- *
209
- * See [#1132](https://github.com/react-community/react-native-maps/issues/1132) for more information.
210
- *
211
- * @default false
212
- * @platform iOS: Apple Maps only
213
- * @platform Android: Not supported
214
- */
215
- stopPropagation?: boolean;
216
- /**
217
- * Sets whether marker should be tappable.
218
- * If set to false, the marker will not have onPress events.
219
- *
220
- * @default true
221
- * @platform iOS: Google Maps only
222
- * @platform Android: Not supported
223
- */
224
- tappable?: boolean;
225
- /**
226
- * The title of the marker.
227
- * This is only used if the <Marker /> component has no `<Callout />` children.
228
- *
229
- * If the marker has <Callout /> children, default callout behavior will be used,
230
- * which will show both the `title` and the `description`, if provided.
231
- *
232
- * @platform iOS: Supported
233
- * @platform Android: Supported
234
- */
235
- title?: string;
236
- /**
237
- * Sets whether this marker should track view changes in info window.
238
- * Enabling it will let marker change content of info window after first render pass, but will lead to decreased performance,
239
- * so it's recommended to disable it whenever you don't need it.
240
- * **Note**: iOS Google Maps only.
241
- *
242
- * @default false
243
- * @platform iOS: Google Maps only
244
- * @platform Android: Not supported
245
- */
246
- tracksInfoWindowChanges?: boolean;
247
- /**
248
- * Sets whether this marker should track view changes.
249
- * It's recommended to turn it off whenever it's possible to improve custom marker performance.
250
- *
251
- * @default true
252
- * @platform iOS: Google Maps only
253
- * @platform Android: Supported
254
- */
255
- tracksViewChanges?: boolean;
256
- /**
257
- * The order in which this tile overlay is drawn with respect to other overlays.
258
- * An overlay with a larger z-index is drawn over overlays with smaller z-indices.
259
- * The order of overlays with the same z-index is arbitrary.
260
- *
261
- * @platform iOS: Supported
262
- * @platform Android: Supported
263
- */
264
- zIndex?: number;
265
- /**
266
- Constants that indicates the display priority for annotations.
267
- @default required
268
- @platform iOS: Apple Maps only.
269
- @platform Android: Not supported
270
-
271
- Required: A constant indicating that the item is required.
272
- High: A constant indicating that the item’s display priority is high.
273
- Low: A constant indicating that the item’s display priority is Low.
274
- */
275
- displayPriority?: AppleMarkerPriority;
276
- /**
277
- * Visibility of the title text rendered beneath Marker balloon
278
- * @platform iOS: Apple Maps only
279
- * @platform Android: Not supported
280
- */
281
- titleVisibility?: AppleMarkerVisibility;
282
- /**
283
- * Visibility of the subtitle text rendered beneath Marker balloon
284
- * @platform iOS: Apple Maps only
285
- * @platform Android: Not supported
286
- */
287
- subtitleVisibility?: AppleMarkerVisibility;
288
- /**
289
- * Indicate type of default markers if it's true MKPinAnnotationView will be used and MKMarkerAnnotationView if it's false
290
- * It doesn't change anything if you are using custom Markers
291
- * @platform iOS: Apple Maps only
292
- * @platform Android: Not supported
293
- */
294
- useLegacyPinView?: boolean;
295
- };
296
- type OmittedProps = Omit<MapMarkerProps, 'stopPropagation'>;
297
- export type NativeProps = Modify<OmittedProps, {
298
- icon?: string;
299
- image?: MapMarkerProps['image'] | string;
300
- }> & {
301
- ref: React.RefObject<MapMarkerNativeComponentType | null>;
302
- };
303
- export declare class MapMarker extends React.Component<MapMarkerProps> {
304
- context: React.ContextType<typeof ProviderContext>;
305
- getNativeComponent: () => NativeComponent<NativeProps>;
306
- getMapManagerCommand: (name: string) => MapManagerCommand;
307
- getUIManagerCommand: (name: string) => UIManagerCommand;
308
- static Animated: Animated.AnimatedComponent<typeof MapMarker>;
309
- private marker;
310
- private fabricMarker?;
311
- constructor(props: MapMarkerProps);
312
- setNativeProps(props: Partial<NativeProps>): void;
313
- showCallout(): void;
314
- hideCallout(): void;
315
- setCoordinates(coordinate: LatLng): void;
316
- redrawCallout(): void;
317
- animateMarkerToCoordinate(coordinate: LatLng, duration?: number): void;
318
- redraw(): void;
319
- render(): React.JSX.Element;
320
- }
321
- declare const _default: typeof MapMarker;
322
- export default _default;
package/lib/MapMarker.js DELETED
@@ -1,158 +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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MapMarker = void 0;
27
- const React = __importStar(require("react"));
28
- const react_native_1 = require("react-native");
29
- const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
30
- const MapMarkerNativeComponent_1 = require("./MapMarkerNativeComponent");
31
- const NativeComponentMarker_1 = require("./specs/NativeComponentMarker");
32
- const ProviderConstants_1 = require("./ProviderConstants");
33
- const fixImageProp_1 = require("./fixImageProp");
34
- class MapMarker extends React.Component {
35
- getNativeComponent;
36
- getMapManagerCommand;
37
- getUIManagerCommand;
38
- static Animated;
39
- marker;
40
- fabricMarker = undefined;
41
- constructor(props) {
42
- super(props);
43
- this.marker = React.createRef();
44
- this.showCallout = this.showCallout.bind(this);
45
- this.hideCallout = this.hideCallout.bind(this);
46
- this.setCoordinates = this.setCoordinates.bind(this);
47
- this.redrawCallout = this.redrawCallout.bind(this);
48
- this.animateMarkerToCoordinate = this.animateMarkerToCoordinate.bind(this);
49
- }
50
- setNativeProps(props) {
51
- // @ts-ignore
52
- this.marker.current?.setNativeProps(props);
53
- }
54
- showCallout() {
55
- if (this.marker.current) {
56
- if (this.fabricMarker) {
57
- // @ts-ignore
58
- NativeComponentMarker_1.Commands.showCallout(this.marker.current);
59
- }
60
- else {
61
- MapMarkerNativeComponent_1.Commands.showCallout(this.marker.current);
62
- }
63
- }
64
- }
65
- hideCallout() {
66
- if (this.marker.current) {
67
- if (this.fabricMarker) {
68
- // @ts-ignore
69
- NativeComponentMarker_1.Commands.hideCallout(this.marker.current);
70
- }
71
- else {
72
- MapMarkerNativeComponent_1.Commands.hideCallout(this.marker.current);
73
- }
74
- }
75
- }
76
- setCoordinates(coordinate) {
77
- if (this.marker.current) {
78
- if (this.fabricMarker) {
79
- NativeComponentMarker_1.Commands.setCoordinates(
80
- // @ts-ignore
81
- this.marker.current, coordinate.latitude, coordinate.longitude);
82
- }
83
- else {
84
- MapMarkerNativeComponent_1.Commands.setCoordinates(this.marker.current, coordinate);
85
- }
86
- }
87
- }
88
- redrawCallout() {
89
- if (this.marker.current) {
90
- if (this.fabricMarker) {
91
- // @ts-ignore
92
- NativeComponentMarker_1.Commands.redrawCallout(this.marker.current);
93
- }
94
- else {
95
- MapMarkerNativeComponent_1.Commands.redrawCallout(this.marker.current);
96
- }
97
- }
98
- }
99
- animateMarkerToCoordinate(coordinate, duration = 500) {
100
- if (this.marker.current) {
101
- if (this.fabricMarker) {
102
- NativeComponentMarker_1.Commands.animateToCoordinates(
103
- // @ts-ignore
104
- this.marker.current, coordinate.latitude, coordinate.longitude, duration);
105
- }
106
- else {
107
- MapMarkerNativeComponent_1.Commands.animateMarkerToCoordinate(this.marker.current, coordinate, duration);
108
- }
109
- }
110
- }
111
- redraw() {
112
- if (this.marker.current) {
113
- MapMarkerNativeComponent_1.Commands.redraw(this.marker.current);
114
- }
115
- }
116
- render() {
117
- const { stopPropagation = false } = this.props;
118
- if (this.fabricMarker === undefined) {
119
- const provider = this.context;
120
- this.fabricMarker = !(react_native_1.Platform.OS === 'ios' && provider === ProviderConstants_1.PROVIDER_GOOGLE);
121
- }
122
- let icon;
123
- if (this.props.icon && this.fabricMarker) {
124
- icon = (0, fixImageProp_1.fixImageProp)(this.props.icon);
125
- }
126
- let image;
127
- if (this.props.image && this.fabricMarker) {
128
- image = (0, fixImageProp_1.fixImageProp)(this.props.image);
129
- }
130
- const AIRMapMarker = this.getNativeComponent();
131
- return (<AIRMapMarker {...this.props} ref={this.marker}
132
- // @ts-ignore
133
- image={image}
134
- // @ts-ignore
135
- icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
136
- if (stopPropagation) {
137
- event.stopPropagation();
138
- }
139
- if (this.props.onPress) {
140
- this.props.onPress(event);
141
- }
142
- }}/>);
143
- }
144
- }
145
- exports.MapMarker = MapMarker;
146
- const styles = react_native_1.StyleSheet.create({
147
- marker: {
148
- position: 'absolute',
149
- backgroundColor: 'transparent',
150
- },
151
- });
152
- MapMarker.Animated = react_native_1.Animated.createAnimatedComponent(MapMarker);
153
- exports.default = (0, decorateMapComponent_1.default)(MapMarker, 'Marker', {
154
- google: {
155
- ios: decorateMapComponent_1.SUPPORTED,
156
- android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
157
- },
158
- });
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- import type { HostComponent } from 'react-native';
3
- import { NativeProps } from './MapMarker';
4
- import { LatLng } from './sharedTypes';
5
- export type MapMarkerNativeComponentType = HostComponent<NativeProps>;
6
- interface NativeCommands {
7
- showCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
8
- hideCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
9
- setCoordinates: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>, coordinate: LatLng) => void;
10
- redrawCallout: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
11
- animateMarkerToCoordinate: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>, coordinate: LatLng, duration: number) => void;
12
- redraw: (viewRef: NonNullable<React.RefObject<MapMarkerNativeComponentType>['current']>) => void;
13
- }
14
- export declare const Commands: NativeCommands;
15
- export {};
@@ -1,15 +0,0 @@
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 codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
8
- exports.Commands = (0, codegenNativeCommands_1.default)({
9
- supportedCommands: [
10
- 'showCallout',
11
- 'hideCallout',
12
- 'animateMarkerToCoordinate',
13
- 'setCoordinates',
14
- ],
15
- });
@@ -1,88 +0,0 @@
1
- import * as React from 'react';
2
- import { Animated, ViewProps, ImageURISource, ImageRequireSource, NativeSyntheticEvent } from 'react-native';
3
- import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
4
- import { LatLng, Point } from './sharedTypes';
5
- import { Modify } from './sharedTypesInternal';
6
- export type MapOverlayProps = ViewProps & {
7
- /**
8
- * The bearing in degrees clockwise from north. Values outside the range [0, 360) will be normalized.
9
- *
10
- * @default 0
11
- * @platform iOS: Google Maps only
12
- * @platform Android: Supported
13
- */
14
- bearing?: number;
15
- /**
16
- * The coordinates for the image (left-top corner, right-bottom corner). ie.```[[lat, long], [lat, long]]```
17
- *
18
- * @platform iOS: Supported
19
- * @platform Android: Supported
20
- */
21
- bounds: [Coordinate, Coordinate];
22
- /**
23
- * A custom image to be used as the overlay.
24
- * Only required local image resources and uri (as for images located in the net) are allowed to be used.
25
- *
26
- * @platform iOS: Supported
27
- * @platform Android: Supported
28
- */
29
- image: ImageURISource | ImageRequireSource;
30
- /**
31
- * Callback that is called when the user presses on the overlay
32
- *
33
- * @platform iOS: Apple Maps only
34
- * @platform Android: Supported
35
- */
36
- onPress?: (event: OverlayPressEvent) => void;
37
- /**
38
- * The opacity of the overlay.
39
- *
40
- * @default 1
41
- * @platform iOS: Google Maps only
42
- * @platform Android: Supported
43
- */
44
- opacity?: number;
45
- /**
46
- * Boolean to allow an overlay to be tappable and use the onPress function.
47
- *
48
- * @default false
49
- * @platform iOS: Not supported
50
- * @platform Android: Supported
51
- */
52
- tappable?: boolean;
53
- };
54
- type NativeProps = Modify<MapOverlayProps, {
55
- image?: string;
56
- }>;
57
- export declare class MapOverlay extends React.Component<MapOverlayProps> {
58
- context: React.ContextType<typeof ProviderContext>;
59
- getNativeComponent: () => NativeComponent<NativeProps>;
60
- getMapManagerCommand: (name: string) => MapManagerCommand;
61
- getUIManagerCommand: (name: string) => UIManagerCommand;
62
- static Animated: Animated.AnimatedComponent<typeof MapOverlay>;
63
- private fabricOverlay?;
64
- render(): React.JSX.Element;
65
- }
66
- type Coordinate = [number, number];
67
- type OverlayPressEvent = NativeSyntheticEvent<{
68
- /**
69
- * @platform iOS: Apple Maps: `image-overlay-press`
70
- * @platform Android: `overlay-press`
71
- */
72
- action: 'overlay-press' | 'image-overlay-press';
73
- /**
74
- * @platform iOS: Apple Maps
75
- */
76
- name?: string;
77
- /**
78
- * @platform iOS: Apple Maps
79
- * @platform Android
80
- */
81
- coordinate?: LatLng;
82
- /**
83
- * @platform Android
84
- */
85
- position?: Point;
86
- }>;
87
- declare const _default: typeof MapOverlay;
88
- export default _default;
package/lib/MapOverlay.js DELETED
@@ -1,65 +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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.MapOverlay = void 0;
27
- const React = __importStar(require("react"));
28
- const react_native_1 = require("react-native");
29
- const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
30
- const fixImageProp_1 = require("./fixImageProp");
31
- class MapOverlay extends React.Component {
32
- getNativeComponent;
33
- getMapManagerCommand;
34
- getUIManagerCommand;
35
- static Animated;
36
- fabricOverlay = undefined;
37
- render() {
38
- const { opacity = 1.0 } = this.props;
39
- if (this.fabricOverlay === undefined) {
40
- this.fabricOverlay = react_native_1.Platform.OS === 'android';
41
- }
42
- const AIRMapOverlay = this.getNativeComponent();
43
- let image = this.props.image;
44
- if (this.props.image && this.fabricOverlay) {
45
- image = (0, fixImageProp_1.fixImageProp)(this.props.image);
46
- }
47
- return (<AIRMapOverlay {...this.props} opacity={opacity}
48
- // @ts-ignore
49
- image={image} style={[styles.overlay, this.props.style]}/>);
50
- }
51
- }
52
- exports.MapOverlay = MapOverlay;
53
- const styles = react_native_1.StyleSheet.create({
54
- overlay: {
55
- position: 'absolute',
56
- backgroundColor: 'transparent',
57
- },
58
- });
59
- MapOverlay.Animated = react_native_1.Animated.createAnimatedComponent(MapOverlay);
60
- exports.default = (0, decorateMapComponent_1.default)(MapOverlay, 'Overlay', {
61
- google: {
62
- ios: decorateMapComponent_1.SUPPORTED,
63
- android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
64
- },
65
- });