react-native-google-maps-plus 1.10.2-dev.1 → 1.10.2-dev.2

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 (98) hide show
  1. package/README.md +12 -114
  2. package/ios/GoogleMapViewImpl.swift +3 -0
  3. package/lib/module/GoogleMapsPlus.js +10 -1
  4. package/lib/module/GoogleMapsPlus.js.map +1 -1
  5. package/lib/module/index.js +90 -1
  6. package/lib/module/index.js.map +1 -1
  7. package/lib/module/types.js +145 -39
  8. package/lib/module/types.js.map +1 -1
  9. package/lib/typescript/src/GoogleMapsPlus.d.ts +8 -0
  10. package/lib/typescript/src/GoogleMapsPlus.d.ts.map +1 -1
  11. package/lib/typescript/src/RNGoogleMapsPlusModule.nitro.d.ts +17 -1
  12. package/lib/typescript/src/RNGoogleMapsPlusModule.nitro.d.ts.map +1 -1
  13. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +87 -3
  14. package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
  15. package/lib/typescript/src/index.d.ts +89 -1
  16. package/lib/typescript/src/index.d.ts.map +1 -1
  17. package/lib/typescript/src/types.d.ts +340 -17
  18. package/lib/typescript/src/types.d.ts.map +1 -1
  19. package/nitrogen/generated/android/c++/JFunc_void_RNIndoorBuilding.hpp +12 -11
  20. package/nitrogen/generated/android/c++/JFunc_void_RNIndoorLevel.hpp +12 -11
  21. package/nitrogen/generated/android/c++/JFunc_void_RNLatLng.hpp +2 -1
  22. package/nitrogen/generated/android/c++/JFunc_void_RNLocation.hpp +2 -1
  23. package/nitrogen/generated/android/c++/JFunc_void_RNLocationErrorCode.hpp +2 -1
  24. package/nitrogen/generated/android/c++/JFunc_void_RNMapErrorCode.hpp +2 -1
  25. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera.hpp +2 -1
  26. package/nitrogen/generated/android/c++/JFunc_void_RNRegion_RNCamera_bool.hpp +2 -1
  27. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +2 -1
  28. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +2 -1
  29. package/nitrogen/generated/android/c++/JFunc_void_std__string_RNLatLng.hpp +2 -1
  30. package/nitrogen/generated/android/c++/JFunc_void_std__string_std__string_RNLatLng.hpp +2 -1
  31. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +32 -81
  32. package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +4 -4
  33. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNIndoorBuilding.kt +9 -9
  34. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/Func_void_RNIndoorLevel.kt +9 -9
  35. package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +2 -2
  36. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.cpp +7 -6
  37. package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +28 -28
  38. package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +4 -4
  39. package/nitrogen/generated/ios/swift/Func_void_RNIndoorBuilding.swift +6 -6
  40. package/nitrogen/generated/ios/swift/Func_void_RNIndoorLevel.swift +6 -6
  41. package/nitrogen/generated/ios/swift/Func_void_RNLatLng.swift +1 -1
  42. package/nitrogen/generated/ios/swift/Func_void_RNLocation.swift +1 -1
  43. package/nitrogen/generated/ios/swift/Func_void_RNLocationErrorCode.swift +1 -1
  44. package/nitrogen/generated/ios/swift/Func_void_RNLocationPermissionResult.swift +1 -1
  45. package/nitrogen/generated/ios/swift/Func_void_RNMapErrorCode.swift +1 -1
  46. package/nitrogen/generated/ios/swift/Func_void_RNRegion_RNCamera.swift +1 -1
  47. package/nitrogen/generated/ios/swift/Func_void_RNRegion_RNCamera_bool.swift +1 -1
  48. package/nitrogen/generated/ios/swift/Func_void_bool.swift +1 -1
  49. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +1 -1
  50. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +1 -1
  51. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +1 -1
  52. package/nitrogen/generated/ios/swift/Func_void_std__string_RNLatLng.swift +1 -1
  53. package/nitrogen/generated/ios/swift/Func_void_std__string_std__string_RNLatLng.swift +1 -1
  54. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec.swift +0 -1
  55. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusModuleSpec_cxx.swift +0 -1
  56. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +2 -3
  57. package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +16 -17
  58. package/nitrogen/generated/ios/swift/RNAndroidLocationConfig.swift +1 -0
  59. package/nitrogen/generated/ios/swift/RNCamera.swift +1 -0
  60. package/nitrogen/generated/ios/swift/RNCameraUpdate.swift +1 -0
  61. package/nitrogen/generated/ios/swift/RNCircle.swift +1 -0
  62. package/nitrogen/generated/ios/swift/RNHeatmap.swift +1 -0
  63. package/nitrogen/generated/ios/swift/RNHeatmapGradient.swift +1 -0
  64. package/nitrogen/generated/ios/swift/RNHeatmapPoint.swift +1 -0
  65. package/nitrogen/generated/ios/swift/RNIOSLocationConfig.swift +1 -0
  66. package/nitrogen/generated/ios/swift/RNIndoorBuilding.swift +1 -0
  67. package/nitrogen/generated/ios/swift/RNIndoorLevel.swift +1 -0
  68. package/nitrogen/generated/ios/swift/RNInitialProps.swift +1 -0
  69. package/nitrogen/generated/ios/swift/RNKMLayer.swift +1 -0
  70. package/nitrogen/generated/ios/swift/RNLatLng.swift +1 -0
  71. package/nitrogen/generated/ios/swift/RNLatLngBounds.swift +1 -0
  72. package/nitrogen/generated/ios/swift/RNLocation.swift +1 -0
  73. package/nitrogen/generated/ios/swift/RNLocationAndroid.swift +1 -0
  74. package/nitrogen/generated/ios/swift/RNLocationConfig.swift +1 -0
  75. package/nitrogen/generated/ios/swift/RNLocationIOS.swift +1 -0
  76. package/nitrogen/generated/ios/swift/RNLocationPermissionResult.swift +1 -0
  77. package/nitrogen/generated/ios/swift/RNMapPadding.swift +1 -0
  78. package/nitrogen/generated/ios/swift/RNMapUiSettings.swift +1 -0
  79. package/nitrogen/generated/ios/swift/RNMapZoomConfig.swift +1 -0
  80. package/nitrogen/generated/ios/swift/RNMarker.swift +1 -0
  81. package/nitrogen/generated/ios/swift/RNMarkerSvg.swift +1 -0
  82. package/nitrogen/generated/ios/swift/RNPolygon.swift +1 -0
  83. package/nitrogen/generated/ios/swift/RNPolygonHole.swift +1 -0
  84. package/nitrogen/generated/ios/swift/RNPolyline.swift +1 -0
  85. package/nitrogen/generated/ios/swift/RNPosition.swift +1 -0
  86. package/nitrogen/generated/ios/swift/RNRegion.swift +1 -0
  87. package/nitrogen/generated/ios/swift/RNSize.swift +1 -0
  88. package/nitrogen/generated/ios/swift/RNSnapshotOptions.swift +1 -0
  89. package/nitrogen/generated/ios/swift/RNUrlTileOverlay.swift +1 -0
  90. package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +4 -4
  91. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +4 -4
  92. package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +2 -2
  93. package/package.json +11 -7
  94. package/src/GoogleMapsPlus.tsx +9 -1
  95. package/src/RNGoogleMapsPlusModule.nitro.ts +21 -4
  96. package/src/RNGoogleMapsPlusView.nitro.ts +143 -18
  97. package/src/index.tsx +90 -1
  98. package/src/types.ts +475 -67
@@ -1,30 +1,30 @@
1
1
  import type {
2
2
  RNCamera,
3
3
  RNCameraUpdate,
4
+ RNCircle,
5
+ RNHeatmap,
6
+ RNIndoorBuilding,
7
+ RNIndoorLevel,
8
+ RNInitialProps,
9
+ RNKMLayer,
4
10
  RNLatLng,
5
- RNMapPadding,
6
- RNPolygon,
7
- RNPolyline,
8
- RNUserInterfaceStyle,
11
+ RNLatLngBounds,
12
+ RNLocation,
13
+ RNLocationConfig,
9
14
  RNLocationErrorCode,
10
- RNMarker,
11
15
  RNLocationPermissionResult,
12
- RNRegion,
13
- RNLocation,
14
16
  RNMapErrorCode,
17
+ RNMapPadding,
15
18
  RNMapType,
16
- RNInitialProps,
17
- RNCircle,
18
19
  RNMapUiSettings,
19
- RNLocationConfig,
20
20
  RNMapZoomConfig,
21
- RNHeatmap,
22
- RNKMLayer,
23
- RNIndoorBuilding,
24
- RNIndoorLevel,
25
- RNLatLngBounds,
21
+ RNMarker,
22
+ RNPolygon,
23
+ RNPolyline,
24
+ RNRegion,
26
25
  RNSnapshotOptions,
27
26
  RNUrlTileOverlay,
27
+ RNUserInterfaceStyle,
28
28
  } from './types';
29
29
  import type {
30
30
  HybridView,
@@ -32,58 +32,150 @@ import type {
32
32
  HybridViewProps,
33
33
  } from 'react-native-nitro-modules';
34
34
 
35
+ /**
36
+ * Native Google Maps view props.
37
+ * Direct mapping to Google Maps SDK for Android/iOS.
38
+ * Platform differences remain unless explicitly aligned.
39
+ */
35
40
  export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
36
41
  initialProps?: RNInitialProps;
37
42
  uiSettings?: RNMapUiSettings;
43
+
44
+ /** Enables "My Location" blue dot. */
38
45
  myLocationEnabled?: boolean;
46
+
47
+ /** Enables 3D buildings. */
39
48
  buildingEnabled?: boolean;
49
+
50
+ /** Enables traffic layer. */
40
51
  trafficEnabled?: boolean;
52
+
53
+ /** Enables indoor maps. */
41
54
  indoorEnabled?: boolean;
55
+
56
+ /**
57
+ * JSON map style string.
58
+ * Must be a Google Maps StyleSpec JSON.
59
+ */
42
60
  customMapStyle?: string;
61
+
62
+ /** Overrides OS UI mode. See {@link RNUserInterfaceStyle}. */
43
63
  userInterfaceStyle?: RNUserInterfaceStyle;
64
+
65
+ /** Zoom range. See {@link RNMapZoomConfig}. */
44
66
  mapZoomConfig?: RNMapZoomConfig;
67
+
68
+ /** Map padding. See {@link RNMapPadding}. */
45
69
  mapPadding?: RNMapPadding;
70
+
71
+ /** Base map type. See {@link RNMapType}. */
46
72
  mapType?: RNMapType;
73
+
74
+ /** Markers. See {@link RNMarker}. */
47
75
  markers?: RNMarker[];
76
+
77
+ /** Polygons. See {@link RNPolygon}. */
48
78
  polygons?: RNPolygon[];
79
+
80
+ /** Polylines. See {@link RNPolyline}. */
49
81
  polylines?: RNPolyline[];
82
+
83
+ /** Circles. See {@link RNCircle}. */
50
84
  circles?: RNCircle[];
85
+
86
+ /** Heatmaps. See {@link RNHeatmap}. */
51
87
  heatmaps?: RNHeatmap[];
88
+
89
+ /** KML layers. See {@link RNKMLayer}. */
52
90
  kmlLayers?: RNKMLayer[];
91
+
92
+ /** URL tile overlays. See {@link RNUrlTileOverlay}. */
53
93
  urlTileOverlays?: RNUrlTileOverlay[];
94
+
95
+ /** Location subsystem config. See {@link RNLocationConfig}. */
54
96
  locationConfig?: RNLocationConfig;
97
+
98
+ /** Map SDK error. */
55
99
  onMapError?: (error: RNMapErrorCode) => void;
100
+
101
+ /** Native map instance created. */
56
102
  onMapReady?: (ready: boolean) => void;
103
+
104
+ /** First frame rendered. */
57
105
  onMapLoaded?: (region: RNRegion, camera: RNCamera) => void;
106
+
107
+ /** Location update. */
58
108
  onLocationUpdate?: (location: RNLocation) => void;
109
+
110
+ /** Location subsystem error. */
59
111
  onLocationError?: (error: RNLocationErrorCode) => void;
112
+
113
+ /** Tap on map. */
60
114
  onMapPress?: (coordinate: RNLatLng) => void;
115
+
116
+ /** Long-press on map. */
61
117
  onMapLongPress?: (coordinate: RNLatLng) => void;
118
+
119
+ /** Tap on POI. */
62
120
  onPoiPress?: (placeId: string, name: string, coordinate: RNLatLng) => void;
121
+
122
+ /** Tap on marker. */
63
123
  onMarkerPress?: (id: string) => void;
124
+
125
+ /** Tap on polyline. */
64
126
  onPolylinePress?: (id: string) => void;
127
+
128
+ /** Tap on polygon. */
65
129
  onPolygonPress?: (id: string) => void;
130
+
131
+ /** Tap on circle. */
66
132
  onCirclePress?: (id: string) => void;
133
+
134
+ /** Marker drag start. */
67
135
  onMarkerDragStart?: (id: string, location: RNLatLng) => void;
136
+
137
+ /** Marker drag update. */
68
138
  onMarkerDrag?: (id: string, location: RNLatLng) => void;
139
+
140
+ /** Marker drag end. */
69
141
  onMarkerDragEnd?: (id: string, location: RNLatLng) => void;
70
- onIndoorBuildingFocused?: (indoorBuilding: RNIndoorBuilding) => void;
71
- onIndoorLevelActivated?: (indoorLevel: RNIndoorLevel) => void;
142
+
143
+ /** Indoor building focused. */
144
+ onIndoorBuildingFocused?: (building: RNIndoorBuilding) => void;
145
+
146
+ /** Indoor level activated. */
147
+ onIndoorLevelActivated?: (level: RNIndoorLevel) => void;
148
+
149
+ /** Info window tap. */
72
150
  onInfoWindowPress?: (id: string) => void;
151
+
152
+ /** Info window closed. */
73
153
  onInfoWindowClose?: (id: string) => void;
154
+
155
+ /** Info window long-press. */
74
156
  onInfoWindowLongPress?: (id: string) => void;
157
+
158
+ /** Tap on the blue My-Location indicator. */
75
159
  onMyLocationPress?: (location: RNLocation) => void;
160
+
161
+ /** Tap on the My-Location button. */
76
162
  onMyLocationButtonPress?: (pressed: boolean) => void;
163
+
164
+ /** Camera move started. */
77
165
  onCameraChangeStart?: (
78
166
  region: RNRegion,
79
167
  camera: RNCamera,
80
168
  isGesture: boolean
81
169
  ) => void;
170
+
171
+ /** Camera moving. */
82
172
  onCameraChange?: (
83
173
  region: RNRegion,
84
174
  camera: RNCamera,
85
175
  isGesture: boolean
86
176
  ) => void;
177
+
178
+ /** Camera idle. */
87
179
  onCameraChangeComplete?: (
88
180
  region: RNRegion,
89
181
  camera: RNCamera,
@@ -91,17 +183,30 @@ export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
91
183
  ) => void;
92
184
  }
93
185
 
186
+ /**
187
+ * Imperative Google Maps methods.
188
+ * Direct calls into native Google Maps SDK.
189
+ */
94
190
  export interface RNGoogleMapsPlusViewMethods extends HybridViewMethods {
95
191
  showMarkerInfoWindow(id: string): void;
96
-
97
192
  hideMarkerInfoWindow(id: string): void;
98
193
 
194
+ /**
195
+ * Sets the camera.
196
+ * iOS: adds an explicit animation phase for parity.
197
+ * Android: uses native timing.
198
+ */
99
199
  setCamera(
100
200
  camera: RNCameraUpdate,
101
201
  animated?: boolean,
102
202
  durationMs?: number
103
203
  ): void;
104
204
 
205
+ /**
206
+ * Fits the camera to the given coordinates.
207
+ * iOS: adds an explicit animation phase for parity.
208
+ * Android: uses native timing.
209
+ */
105
210
  setCameraToCoordinates(
106
211
  coordinates: RNLatLng[],
107
212
  padding?: RNMapPadding,
@@ -109,8 +214,14 @@ export interface RNGoogleMapsPlusViewMethods extends HybridViewMethods {
109
214
  durationMs?: number
110
215
  ): void;
111
216
 
217
+ /** Restricts camera target bounds. */
112
218
  setCameraBounds(bounds?: RNLatLngBounds): void;
113
219
 
220
+ /**
221
+ * Animates camera to bounds.
222
+ * iOS: adds an explicit animation phase for parity.
223
+ * Android: uses native timing.
224
+ */
114
225
  animateToBounds(
115
226
  bounds: RNLatLngBounds,
116
227
  padding?: number,
@@ -118,17 +229,31 @@ export interface RNGoogleMapsPlusViewMethods extends HybridViewMethods {
118
229
  lockBounds?: boolean
119
230
  ): void;
120
231
 
232
+ /** Snapshot of current frame. */
121
233
  snapshot(options: RNSnapshotOptions): Promise<string | undefined>;
122
234
 
235
+ /** Native location-settings dialog. */
123
236
  showLocationDialog(): void;
124
237
 
238
+ /**
239
+ * Opens the OS location settings.
240
+ * iOS: opens the app settings.
241
+ * Android: opens system location settings.
242
+ */
125
243
  openLocationSettings(): void;
126
244
 
245
+ /** Requests runtime location permission. */
127
246
  requestLocationPermission(): Promise<RNLocationPermissionResult>;
128
247
 
248
+ /**
249
+ * Checks Google Play Services availability.
250
+ * iOS: always returns false.
251
+ * Android: performs a real system check.
252
+ */
129
253
  isGooglePlayServicesAvailable(): boolean;
130
254
  }
131
255
 
256
+ /** Typed hybrid Google Maps view. */
132
257
  export type RNGoogleMapsPlusView = HybridView<
133
258
  RNGoogleMapsPlusViewProps,
134
259
  RNGoogleMapsPlusViewMethods
package/src/index.tsx CHANGED
@@ -1,4 +1,93 @@
1
- import { GoogleMapsView, GoogleMapsModule } from './GoogleMapsPlus';
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * # Installation
5
+ *
6
+ * `react-native-nitro-modules` is required as this library relies on Nitro Modules.
7
+ *
8
+ * ```sh
9
+ * yarn add react-native-google-maps-plus react-native-nitro-modules
10
+ * ```
11
+ *
12
+ * ## iOS Setup (Bare RN only)
13
+ *
14
+ * Add this to your Podfile:
15
+ *
16
+ * ```ruby
17
+ * post_install do |installer|
18
+ * react_native_post_install(
19
+ * installer,
20
+ * config[:reactNativePath],
21
+ * :mac_catalyst_enabled => false,
22
+ * )
23
+ *
24
+ * require_relative '../node_modules/react-native-google-maps-plus/scripts/svgkit_patch'
25
+ * apply_svgkit_patch(installer)
26
+ * end
27
+ * ```
28
+ *
29
+ * ## Expo Setup
30
+ *
31
+ * Add your keys via the config plugin:
32
+ *
33
+ * ```json
34
+ * {
35
+ * "expo": {
36
+ * "plugins": [
37
+ * [
38
+ * "react-native-google-maps-plus",
39
+ * {
40
+ * "googleMapsAndroidApiKey": "YOUR_ANDROID_MAPS_API_KEY",
41
+ * "googleMapsIosApiKey": "YOUR_IOS_MAPS_API_KEY"
42
+ * }
43
+ * ]
44
+ * ]
45
+ * }
46
+ * }
47
+ * ```
48
+ *
49
+ * # API Keys
50
+ *
51
+ * You need a valid Google Maps API key.
52
+ *
53
+ * Android Guide:
54
+ * https://developers.google.com/maps/documentation/android-sdk/config
55
+ *
56
+ * iOS Guide:
57
+ * https://developers.google.com/maps/documentation/ios-sdk/config
58
+ *
59
+ *
60
+ * # Native Dependencies
61
+ *
62
+ * - iOS Google Maps SDK
63
+ * https://developers.google.com/maps/documentation/ios-sdk
64
+ *
65
+ * - Android Google Maps SDK
66
+ * https://developers.google.com/maps/documentation/android-sdk
67
+ *
68
+ * - SVG Rendering
69
+ * iOS: SVGKit
70
+ * Android: AndroidSVG
71
+ *
72
+ *
73
+ * # Usage Example
74
+ *
75
+ * ```tsx
76
+ * <GoogleMapsView
77
+ * style={{ flex: 1 }}
78
+ * initialProps={{
79
+ * camera: {
80
+ * center: { latitude: 37.7749, longitude: -122.4194 },
81
+ * zoom: 12,
82
+ * },
83
+ * }}
84
+ * />
85
+ * ```
86
+ *
87
+ * Check out the example app in the [example directory](https://github.com/pinpong/react-native-google-maps-plus/tree/main/example).
88
+ */
89
+
90
+ import { GoogleMapsModule, GoogleMapsView } from './GoogleMapsPlus';
2
91
 
3
92
  import type { RNGoogleMapsPlusModule } from './RNGoogleMapsPlusModule.nitro';
4
93
  import type {