react-native-maps 1.21.0-alpha.99 → 1.21.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/README.md +9 -4
- package/android/build.gradle +65 -72
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/RCTAppDependencyProvider.h +25 -0
- package/android/src/main/RCTAppDependencyProvider.mm +55 -0
- package/android/src/main/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/src/main/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/src/main/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/src/main/RCTThirdPartyComponentsProvider.mm +28 -0
- package/android/src/main/ReactAppDependencyProvider.podspec +34 -0
- package/android/src/main/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +17 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +23 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +23 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +209 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +45 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +22 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +26 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerDelegate.java +62 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerInterface.java +27 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerDelegate.java +56 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerInterface.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +5 -1
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +1 -1
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +9 -3
- package/android/src/main/java/com/rnmaps/fabric/UrlTileManager.java +124 -0
- package/android/src/main/java/com/rnmaps/fabric/WMSTileManager.java +114 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +19 -3
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +608 -603
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +2 -22
- package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +23 -1
- package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +18 -18
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +10 -14
- package/android/src/main/java/com/rnmaps/maps/MapView.java +58 -49
- package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +10 -10
- package/android/src/main/jni/CMakeLists.txt +36 -0
- package/android/src/main/jni/RNMapsSpecs-generated.cpp +68 -0
- package/android/src/main/jni/RNMapsSpecs.h +31 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +31 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +33 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +979 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +860 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +227 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +1297 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +26 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +131 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +137 -0
- package/ios/AirGoogleMaps/AIRGoogleMap.h +13 -13
- package/ios/AirGoogleMaps/{AIRGoogleMap.m → AIRGoogleMap.mm} +32 -34
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.mm +543 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +5 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +41 -33
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +23 -14
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +1 -0
- package/ios/AirMaps/AIRMap.h +8 -9
- package/ios/AirMaps/{AIRMap.m → AIRMap.mm} +18 -14
- package/ios/AirMaps/AIRMapManager.m +8 -19
- package/ios/AirMaps/AIRMapMarker.m +57 -44
- package/ios/AirMaps/AIRMapOverlay.m +2 -2
- package/ios/AirMaps/AIRMapWMSTile.m +8 -8
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +77 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +51 -0
- package/ios/AirMaps/RNMapsAirModule.h +2 -3
- package/ios/AirMaps/RNMapsAirModule.mm +14 -0
- package/ios/AirMaps/RNMapsDefines.h +1 -0
- package/ios/AirMaps/RNMapsMapView.h +5 -2
- package/ios/AirMaps/RNMapsMapView.mm +16 -6
- package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
- package/ios/AirMaps/RNMapsMarkerView.mm +12 -4
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +7 -0
- package/ios/AirMaps/module.modulemap +6 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +15 -55
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +26 -0
- package/ios/{AirMaps → generated}/RNMapsAirModuleDelegate.h +1 -1
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +977 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +846 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +194 -0
- package/ios/generated/RNMapsSpecs/Props.h +1224 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +591 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +24 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +109 -0
- package/ios/generated/RNMapsSpecs/States.cpp +16 -0
- package/ios/generated/RNMapsSpecs/States.h +113 -0
- package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
- package/ios/generated/RNMapsSpecsJSI.h +268 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/ios/generated/module.modulemap +15 -0
- package/package.json +30 -26
- package/react-native-google-maps.podspec +27 -0
- package/react-native-maps-generated.podspec +31 -0
- package/react-native-maps.podspec +52 -46
- package/react-native.config.js +16 -0
- package/src/AnimatedRegion.ts +169 -0
- package/src/Geojson.tsx +541 -0
- package/src/MapCallout.tsx +77 -0
- package/src/MapCalloutSubview.tsx +64 -0
- package/src/MapCircle.tsx +162 -0
- package/src/MapHeatmap.tsx +125 -0
- package/src/MapLocalTile.tsx +60 -0
- package/src/MapMarker.tsx +531 -0
- package/src/MapMarkerNativeComponent.ts +51 -0
- package/src/MapOverlay.tsx +178 -0
- package/src/MapPolygon.tsx +188 -0
- package/src/MapPolygon.types.ts +25 -0
- package/src/MapPolyline.tsx +215 -0
- package/src/MapUrlTile.tsx +169 -0
- package/src/MapView.tsx +1230 -0
- package/src/MapView.types.ts +212 -0
- package/src/MapView.web.ts +2 -0
- package/src/MapViewNativeComponent.ts +86 -0
- package/src/MapWMSTile.tsx +148 -0
- package/src/ProviderConstants.ts +2 -0
- package/src/createFabricMap.tsx +253 -0
- package/src/decorateMapComponent.ts +227 -0
- package/src/fixImageProp.ts +17 -0
- package/src/index.ts +52 -0
- package/src/sharedTypes.ts +101 -0
- package/{specs → src/specs}/NativeComponentCircle.ts +3 -4
- package/{specs → src/specs}/NativeComponentGoogleMapView.ts +15 -9
- package/{specs → src/specs}/NativeComponentMapView.ts +61 -32
- package/{specs → src/specs}/NativeComponentOverlay.ts +11 -2
- package/{specs → src/specs}/NativeComponentPolyline.ts +1 -1
- package/src/specs/NativeComponentUrlTile.ts +128 -0
- package/src/specs/NativeComponentWMSTile.ts +107 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -533
- package/lib/AnimatedRegion.d.ts +0 -19
- package/lib/AnimatedRegion.js +0 -134
- package/lib/Geojson.d.ts +0 -204
- package/lib/Geojson.js +0 -166
- package/lib/MapCallout.d.ts +0 -40
- package/lib/MapCallout.js +0 -51
- package/lib/MapCalloutSubview.d.ts +0 -34
- package/lib/MapCalloutSubview.js +0 -48
- package/lib/MapCircle.d.ts +0 -117
- package/lib/MapCircle.js +0 -53
- package/lib/MapHeatmap.d.ts +0 -78
- package/lib/MapHeatmap.js +0 -59
- package/lib/MapLocalTile.d.ts +0 -35
- package/lib/MapLocalTile.js +0 -44
- package/lib/MapMarker.d.ts +0 -322
- package/lib/MapMarker.js +0 -158
- package/lib/MapMarkerNativeComponent.d.ts +0 -15
- package/lib/MapMarkerNativeComponent.js +0 -15
- package/lib/MapOverlay.d.ts +0 -88
- package/lib/MapOverlay.js +0 -65
- package/lib/MapPolygon.d.ts +0 -140
- package/lib/MapPolygon.js +0 -53
- package/lib/MapPolygon.types.d.ts +0 -18
- package/lib/MapPolygon.types.js +0 -2
- package/lib/MapPolyline.d.ts +0 -156
- package/lib/MapPolyline.js +0 -53
- package/lib/MapUrlTile.d.ts +0 -134
- package/lib/MapUrlTile.js +0 -44
- package/lib/MapView.d.ts +0 -703
- package/lib/MapView.js +0 -427
- package/lib/MapView.types.d.ts +0 -161
- package/lib/MapView.types.js +0 -2
- package/lib/MapView.web.d.ts +0 -1
- package/lib/MapView.web.js +0 -9
- package/lib/MapViewNativeComponent.d.ts +0 -18
- package/lib/MapViewNativeComponent.js +0 -19
- package/lib/MapWMSTile.d.ts +0 -116
- package/lib/MapWMSTile.js +0 -44
- package/lib/ProviderConstants.d.ts +0 -2
- package/lib/ProviderConstants.js +0 -5
- package/lib/createFabricMap.d.ts +0 -24
- package/lib/createFabricMap.js +0 -188
- package/lib/decorateMapComponent.d.ts +0 -36
- package/lib/decorateMapComponent.js +0 -120
- package/lib/fixImageProp.d.ts +0 -4
- package/lib/fixImageProp.js +0 -16
- package/lib/index.d.ts +0 -38
- package/lib/index.js +0 -81
- package/lib/sharedTypes.d.ts +0 -81
- package/lib/sharedTypes.js +0 -2
- package/lib/sharedTypesInternal.js +0 -2
- package/lib/specs/NativeAirMapsModule.d.ts +0 -31
- package/lib/specs/NativeAirMapsModule.js +0 -4
- package/lib/specs/NativeComponentCallout.d.ts +0 -46
- package/lib/specs/NativeComponentCallout.js +0 -9
- package/lib/specs/NativeComponentCircle.d.ts +0 -74
- package/lib/specs/NativeComponentCircle.js +0 -7
- package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -713
- package/lib/specs/NativeComponentGoogleMapView.js +0 -22
- package/lib/specs/NativeComponentGooglePolygon.d.ts +0 -75
- package/lib/specs/NativeComponentGooglePolygon.js +0 -7
- package/lib/specs/NativeComponentMapView.d.ts +0 -847
- package/lib/specs/NativeComponentMapView.js +0 -20
- package/lib/specs/NativeComponentMarker.d.ts +0 -258
- package/lib/specs/NativeComponentMarker.js +0 -19
- package/lib/specs/NativeComponentOverlay.d.ts +0 -67
- package/lib/specs/NativeComponentOverlay.js +0 -7
- package/lib/specs/NativeComponentPolyline.d.ts +0 -101
- package/lib/specs/NativeComponentPolyline.js +0 -7
- /package/ios/AirMaps/{UIView +AirMap.m → UIView+AirMap.m} +0 -0
- /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
- /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
- /package/{specs → src/specs}/NativeAirMapsModule.ts +0 -0
- /package/{specs → src/specs}/NativeComponentCallout.ts +0 -0
- /package/{specs → src/specs}/NativeComponentGooglePolygon.ts +0 -0
- /package/{specs → src/specs}/NativeComponentMarker.ts +0 -0
|
@@ -10,17 +10,33 @@
|
|
|
10
10
|
#import "RNMapsGoogleMapView.h"
|
|
11
11
|
#import "RNMapsGooglePolygonView.h"
|
|
12
12
|
#import "AIRGoogleMap.h"
|
|
13
|
-
#import "AIRMapMarker.h"
|
|
14
13
|
#import "AIRGoogleMapManager.h"
|
|
15
|
-
#
|
|
16
|
-
#import <
|
|
17
|
-
#import <
|
|
18
|
-
#import <
|
|
14
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
15
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
18
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
19
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
20
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
21
|
+
#else
|
|
22
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
23
|
+
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
24
|
+
#import <react-native-maps-generated/EventEmitters.h>
|
|
25
|
+
#import <react-native-maps-generated/Props.h>
|
|
26
|
+
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
27
|
+
#endif
|
|
19
28
|
#import "RCTFabricComponentsPlugins.h"
|
|
20
29
|
#import <React/RCTConversions.h>
|
|
30
|
+
#import <React/RCTUtils.h>
|
|
21
31
|
#import "RCTConvert+GMSMapViewType.h"
|
|
32
|
+
#if __has_include(<ReactNativeMaps/RCTConvert+AirMap.h>)
|
|
33
|
+
#import <ReactNativeMaps/RCTConvert+AirMap.h>
|
|
34
|
+
#import <ReactNativeMaps/UIView+AirMap.h>
|
|
35
|
+
#else
|
|
22
36
|
#import "RCTConvert+AirMap.h"
|
|
23
37
|
#import "UIView+AirMap.h"
|
|
38
|
+
#endif
|
|
39
|
+
|
|
24
40
|
|
|
25
41
|
using namespace facebook::react;
|
|
26
42
|
|
|
@@ -36,7 +52,7 @@ using namespace facebook::react;
|
|
|
36
52
|
|
|
37
53
|
|
|
38
54
|
- (id<RNMapsAirModuleDelegate>) mapView {
|
|
39
|
-
return _view;
|
|
55
|
+
return (id<RNMapsAirModuleDelegate>)_view;
|
|
40
56
|
}
|
|
41
57
|
|
|
42
58
|
#pragma mark - JS Commands
|
|
@@ -195,17 +211,14 @@ using namespace facebook::react;
|
|
|
195
211
|
|
|
196
212
|
_view.onIndoorLevelActivated = [self](NSDictionary* dictionary) {
|
|
197
213
|
if (_eventEmitter) {
|
|
214
|
+
|
|
198
215
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
199
216
|
|
|
200
|
-
facebook::react::RNMapsGoogleMapViewEventEmitter::
|
|
217
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
|
|
201
218
|
.activeLevelIndex= (int) [dictionary[@"activeLevelIndex"] integerValue],
|
|
202
219
|
.name = [dictionary[@"name"] UTF8String],
|
|
203
220
|
.shortName = [dictionary[@"shortName"] UTF8String],
|
|
204
221
|
};
|
|
205
|
-
|
|
206
|
-
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
|
|
207
|
-
.indoorLevel = level,
|
|
208
|
-
};
|
|
209
222
|
mapViewEventEmitter->onIndoorLevelActivated(data);
|
|
210
223
|
}
|
|
211
224
|
};
|
|
@@ -214,13 +227,13 @@ using namespace facebook::react;
|
|
|
214
227
|
if (_eventEmitter) {
|
|
215
228
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
216
229
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
.activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue]
|
|
220
|
-
};
|
|
230
|
+
NSError *jsError = nil;
|
|
231
|
+
NSString *levelsStr = RCTJSONStringify(dictionary[@"levels"], &jsError);
|
|
221
232
|
|
|
222
233
|
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocused data = {
|
|
223
|
-
.
|
|
234
|
+
.underground = [dictionary[@"underground"] boolValue],
|
|
235
|
+
.activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue],
|
|
236
|
+
.levels = [levelsStr UTF8String]
|
|
224
237
|
};
|
|
225
238
|
mapViewEventEmitter->onIndoorBuildingFocused(data);
|
|
226
239
|
}
|
|
@@ -242,7 +255,7 @@ using namespace facebook::react;
|
|
|
242
255
|
mapViewEventEmitter->onKmlReady(data);
|
|
243
256
|
}
|
|
244
257
|
};
|
|
245
|
-
_view.
|
|
258
|
+
_view.onRegionChange = [self](NSDictionary* dictionary) {
|
|
246
259
|
if (_eventEmitter) {
|
|
247
260
|
|
|
248
261
|
NSDictionary* regionDict = dictionary[@"region"];
|
|
@@ -363,22 +376,6 @@ using namespace facebook::react;
|
|
|
363
376
|
}
|
|
364
377
|
};
|
|
365
378
|
|
|
366
|
-
_view.onRegionChange = [self](NSDictionary* dictionary) {
|
|
367
|
-
if (_eventEmitter) {
|
|
368
|
-
|
|
369
|
-
NSDictionary* regionDict = dictionary[@"region"];
|
|
370
|
-
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
371
|
-
facebook::react::RNMapsGoogleMapViewEventEmitter::OnRegionChange data = {
|
|
372
|
-
.region.latitude = [regionDict[@"latitude"] doubleValue],
|
|
373
|
-
.region.longitude = [regionDict[@"longitude"] doubleValue],
|
|
374
|
-
.region.latitudeDelta = [regionDict[@"latitudeDelta"] doubleValue],
|
|
375
|
-
.region.longitudeDelta = [regionDict[@"longitudeDelta"] doubleValue],
|
|
376
|
-
.continuous = [dictionary[@"continuous"] boolValue],
|
|
377
|
-
};
|
|
378
|
-
mapViewEventEmitter->onRegionChange(data);
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
|
|
382
379
|
_view.onRegionChangeComplete = [self](NSDictionary* dictionary) {
|
|
383
380
|
if (_eventEmitter) {
|
|
384
381
|
|
|
@@ -515,6 +512,12 @@ using namespace facebook::react;
|
|
|
515
512
|
_legacyMapManager.googleMapId = mapID;
|
|
516
513
|
}
|
|
517
514
|
}
|
|
515
|
+
if (oldViewProps.customMapStyleString != newViewProps.customMapStyleString) {
|
|
516
|
+
NSString* customStyle = RCTNSStringFromString(newViewProps.customMapStyleString);
|
|
517
|
+
if (customStyle && [customStyle length]){
|
|
518
|
+
_legacyMapManager.customMapStyle = customStyle;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
518
521
|
if (!newViewProps.zoomTapEnabled) {
|
|
519
522
|
_legacyMapManager.zoomTapEnabled = newViewProps.zoomTapEnabled;
|
|
520
523
|
} else {
|
|
@@ -591,6 +594,8 @@ using namespace facebook::react;
|
|
|
591
594
|
REMAP_MAPVIEW_PROP(scrollEnabled)
|
|
592
595
|
|
|
593
596
|
REMAP_MAPVIEW_STRING_PROP(kmlSrc)
|
|
597
|
+
REMAP_MAPVIEW_STRING_PROP(customMapStyleString)
|
|
598
|
+
|
|
594
599
|
|
|
595
600
|
if (newViewProps.minZoom != oldViewProps.minZoom || newViewProps.maxZoom != oldViewProps.maxZoom){
|
|
596
601
|
[_view setMinZoom:newViewProps.minZoom maxZoom:newViewProps.maxZoom];
|
|
@@ -636,6 +641,9 @@ using namespace facebook::react;
|
|
|
636
641
|
case RNMapsGoogleMapViewMapType::Hybrid:
|
|
637
642
|
_view.mapType = kGMSTypeHybrid;
|
|
638
643
|
break;
|
|
644
|
+
case RNMapsGoogleMapViewMapType::None:
|
|
645
|
+
_view.mapType = kGMSTypeNone;
|
|
646
|
+
break;
|
|
639
647
|
default:
|
|
640
648
|
_view.mapType = kGMSTypeNormal;
|
|
641
649
|
break;
|
|
@@ -18,7 +18,22 @@
|
|
|
18
18
|
|
|
19
19
|
RCT_EXPORT_MODULE(RNMapsGoogleMapViewManager)
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapLoaded, RCTDirectEventBlock)
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(onKmlReady, RCTDirectEventBlock)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
25
|
+
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
|
|
26
|
+
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
|
|
27
|
+
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
|
|
28
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
|
|
29
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
|
|
30
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
|
|
31
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
|
|
32
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
|
|
33
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeComplete, RCTDirectEventBlock)
|
|
34
|
+
RCT_EXPORT_VIEW_PROPERTY(onPoiClick, RCTDirectEventBlock)
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(onIndoorLevelActivated, RCTDirectEventBlock)
|
|
36
|
+
RCT_EXPORT_VIEW_PROPERTY(onIndoorBuildingFocused, RCTDirectEventBlock)
|
|
22
37
|
|
|
23
38
|
@end
|
|
24
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// RNMapsGoogleMapView.mm
|
|
3
|
-
//
|
|
3
|
+
//
|
|
4
4
|
//
|
|
5
5
|
// Created by Salah Ghanim on 23.11.24.
|
|
6
6
|
// Copyright © 2024 react-native-maps. All rights reserved.
|
|
@@ -10,11 +10,20 @@
|
|
|
10
10
|
#import "RNMapsGooglePolygonView.h"
|
|
11
11
|
#import "AIRGMSPolygon.h"
|
|
12
12
|
#import "AIRGoogleMap.h"
|
|
13
|
-
|
|
14
|
-
#import <
|
|
15
|
-
#import <
|
|
16
|
-
#import <
|
|
17
|
-
#import <
|
|
13
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
14
|
+
#import <ReactNativeMapsGenerated/RNMapsSpecs.h>
|
|
15
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
18
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
19
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
20
|
+
#else
|
|
21
|
+
#import <react-native-maps-generated/RNMapsSpecs.h>
|
|
22
|
+
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
23
|
+
#import <react-native-maps-generated/EventEmitters.h>
|
|
24
|
+
#import <react-native-maps-generated/Props.h>
|
|
25
|
+
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
26
|
+
#endif
|
|
18
27
|
|
|
19
28
|
#import "RCTFabricComponentsPlugins.h"
|
|
20
29
|
#import <React/RCTConversions.h>
|
|
@@ -39,7 +48,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
39
48
|
if (newHole.size() != oldHole.size()) {
|
|
40
49
|
return false;
|
|
41
50
|
}
|
|
42
|
-
|
|
51
|
+
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
return true;
|
|
@@ -74,7 +83,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
- (void) prepareContentView {
|
|
77
|
-
|
|
86
|
+
|
|
78
87
|
_view = [AIRGMSPolygon new];
|
|
79
88
|
_view.onPress = [self](NSDictionary* dictionary) {
|
|
80
89
|
if (_eventEmitter) {
|
|
@@ -169,7 +178,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
169
178
|
}
|
|
170
179
|
_view.path = path;
|
|
171
180
|
}
|
|
172
|
-
|
|
181
|
+
|
|
173
182
|
if (!areHolesEqual(newViewProps.holes, oldViewProps.holes)){
|
|
174
183
|
NSMutableArray<GMSMutablePath *> *interiorPolygons = [NSMutableArray array];
|
|
175
184
|
for(int h = 0; h < newViewProps.holes.size(); h++)
|
|
@@ -186,19 +195,19 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
186
195
|
}
|
|
187
196
|
_view.holes = interiorPolygons;
|
|
188
197
|
}
|
|
189
|
-
|
|
190
|
-
|
|
198
|
+
|
|
199
|
+
|
|
191
200
|
REMAP_MAPVIEW_PROP(tappable)
|
|
192
201
|
|
|
193
202
|
if (newViewProps.fillColor){
|
|
194
203
|
_view.fillColor = RCTUIColorFromSharedColor(newViewProps.fillColor);
|
|
195
204
|
}
|
|
196
|
-
|
|
205
|
+
|
|
197
206
|
if (newViewProps.strokeColor){
|
|
198
207
|
_view.strokeColor = RCTUIColorFromSharedColor(newViewProps.strokeColor);
|
|
199
208
|
}
|
|
200
|
-
|
|
201
|
-
|
|
209
|
+
|
|
210
|
+
|
|
202
211
|
|
|
203
212
|
|
|
204
213
|
[super updateProps:props oldProps:oldProps];
|
package/ios/AirMaps/AIRMap.h
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#import "SMCalloutView.h"
|
|
15
15
|
#import "RCTConvert+AirMap.h"
|
|
16
16
|
#import "AIRMapCalloutSubview.h"
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
|
|
19
19
|
@class AIRMapCoordinate;
|
|
20
20
|
@class AIRMapMarker;
|
|
@@ -23,7 +23,7 @@ extern const NSTimeInterval AIRMapRegionChangeObserveInterval;
|
|
|
23
23
|
extern const CGFloat AIRMapZoomBoundBuffer;
|
|
24
24
|
extern const NSInteger AIRMapMaxZoomLevel;
|
|
25
25
|
|
|
26
|
-
@interface AIRMap: MKMapView<SMCalloutViewDelegate
|
|
26
|
+
@interface AIRMap: MKMapView<SMCalloutViewDelegate>
|
|
27
27
|
|
|
28
28
|
@property (nonatomic, strong) SMCalloutView *calloutView;
|
|
29
29
|
@property (nonatomic, strong) UIImageView *cacheImageView;
|
|
@@ -56,12 +56,12 @@ extern const NSInteger AIRMapMaxZoomLevel;
|
|
|
56
56
|
|
|
57
57
|
@property (nonatomic, assign) BOOL ignoreRegionChanges;
|
|
58
58
|
|
|
59
|
-
@property (nonatomic, copy)
|
|
60
|
-
@property (nonatomic, copy)
|
|
59
|
+
@property (nonatomic, copy) RCTDirectEventBlock onMapReady;
|
|
60
|
+
@property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
|
|
61
61
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
62
|
-
@property (nonatomic, copy) RCTBubblingEventBlock onPanDrag;
|
|
63
|
-
@property (nonatomic, copy) RCTBubblingEventBlock onDoublePress;
|
|
64
62
|
@property (nonatomic, copy) RCTBubblingEventBlock onLongPress;
|
|
63
|
+
@property (nonatomic, copy) RCTDirectEventBlock onPanDrag;
|
|
64
|
+
@property (nonatomic, copy) RCTDirectEventBlock onDoublePress;
|
|
65
65
|
@property (nonatomic, copy) RCTDirectEventBlock onMarkerPress;
|
|
66
66
|
@property (nonatomic, copy) RCTDirectEventBlock onMarkerSelect;
|
|
67
67
|
@property (nonatomic, copy) RCTDirectEventBlock onMarkerDeselect;
|
|
@@ -71,14 +71,13 @@ extern const NSInteger AIRMapMaxZoomLevel;
|
|
|
71
71
|
|
|
72
72
|
@property (nonatomic, copy) RCTDirectEventBlock onCalloutPress;
|
|
73
73
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChangeStart;
|
|
74
|
-
@property (nonatomic, copy) RCTDirectEventBlock
|
|
75
|
-
@property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;
|
|
74
|
+
@property (nonatomic, copy) RCTDirectEventBlock onUserLocationChange;
|
|
76
75
|
|
|
77
76
|
- (void)cacheViewIfNeeded;
|
|
78
77
|
- (void)beginLoading;
|
|
79
78
|
- (void)finishLoading;
|
|
80
79
|
- (double)getZoomLevel;
|
|
81
|
-
- (
|
|
80
|
+
- (NSDictionary *)getMapBoundaries;
|
|
82
81
|
|
|
83
82
|
- (AIRMapMarker*) markerAtPoint:(CGPoint)point;
|
|
84
83
|
- (NSDictionary*) getMarkersFramesWithOnlyVisible:(BOOL)onlyVisible;
|
|
@@ -26,8 +26,12 @@ const NSTimeInterval AIRMapRegionChangeObserveInterval = 0.1;
|
|
|
26
26
|
const CGFloat AIRMapZoomBoundBuffer = 0.01;
|
|
27
27
|
const NSInteger AIRMapMaxZoomLevel = 20;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
30
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
31
|
+
#else
|
|
32
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
33
|
+
#endif
|
|
34
|
+
@interface MKMapView (UIGestureRecognizer)<RNMapsAirModuleDelegate>
|
|
31
35
|
|
|
32
36
|
// this tells the compiler that MKMapView actually implements this method
|
|
33
37
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
|
|
@@ -320,23 +324,23 @@ const NSInteger AIRMapMaxZoomLevel = 20;
|
|
|
320
324
|
|
|
321
325
|
#pragma mark RNMapsAirModuleDelegate.h
|
|
322
326
|
|
|
323
|
-
- (
|
|
327
|
+
- (NSDictionary *)getMapBoundaries
|
|
324
328
|
{
|
|
325
329
|
MKMapRect mapRect = self.visibleMapRect;
|
|
326
330
|
|
|
327
331
|
CLLocationCoordinate2D northEast = MKCoordinateForMapPoint(MKMapPointMake(MKMapRectGetMaxX(mapRect), mapRect.origin.y));
|
|
328
332
|
CLLocationCoordinate2D southWest = MKCoordinateForMapPoint(MKMapPointMake(mapRect.origin.x, MKMapRectGetMaxY(mapRect)));
|
|
329
333
|
|
|
330
|
-
return @
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
334
|
+
return @{
|
|
335
|
+
@"northEast": @{
|
|
336
|
+
@"latitude": [NSNumber numberWithDouble:northEast.latitude],
|
|
337
|
+
@"longitude": [NSNumber numberWithDouble:northEast.longitude],
|
|
338
|
+
},
|
|
339
|
+
@"southWest": @{
|
|
340
|
+
@"latitude": [NSNumber numberWithDouble:southWest.latitude],
|
|
341
|
+
@"longitude": [NSNumber numberWithDouble:southWest.longitude],
|
|
342
|
+
},
|
|
343
|
+
};
|
|
340
344
|
}
|
|
341
345
|
- (NSDictionary *) getPointForCoordinates:(CLLocationCoordinate2D) location
|
|
342
346
|
{
|
|
@@ -749,7 +753,7 @@ const NSInteger AIRMapMaxZoomLevel = 20;
|
|
|
749
753
|
|
|
750
754
|
- (void) listenToMemoryWarnings
|
|
751
755
|
{
|
|
752
|
-
__weak
|
|
756
|
+
__weak __typeof(self) weakSelf = self;
|
|
753
757
|
static dispatch_once_t onceToken;
|
|
754
758
|
static dispatch_source_t source;
|
|
755
759
|
dispatch_once(&onceToken, ^{
|
|
@@ -111,13 +111,13 @@ RCT_EXPORT_VIEW_PROPERTY(legalLabelInsets, UIEdgeInsets)
|
|
|
111
111
|
RCT_EXPORT_VIEW_PROPERTY(mapPadding, UIEdgeInsets)
|
|
112
112
|
RCT_EXPORT_VIEW_PROPERTY(mapType, MKMapType)
|
|
113
113
|
RCT_EXPORT_VIEW_PROPERTY(cameraZoomRange, NSDictionary)
|
|
114
|
-
RCT_EXPORT_VIEW_PROPERTY(onMapReady,
|
|
115
|
-
RCT_EXPORT_VIEW_PROPERTY(
|
|
114
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
|
|
115
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
|
|
116
116
|
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
|
|
117
|
-
RCT_EXPORT_VIEW_PROPERTY(onPanDrag,
|
|
117
|
+
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
|
|
118
118
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
119
119
|
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
|
|
120
|
-
RCT_EXPORT_VIEW_PROPERTY(onDoublePress,
|
|
120
|
+
RCT_EXPORT_VIEW_PROPERTY(onDoublePress, RCTDirectEventBlock)
|
|
121
121
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
|
|
122
122
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
|
|
123
123
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
|
|
@@ -125,7 +125,7 @@ RCT_EXPORT_VIEW_PROPERTY(onMarkerDragStart, RCTDirectEventBlock)
|
|
|
125
125
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerDrag, RCTDirectEventBlock)
|
|
126
126
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerDragEnd, RCTDirectEventBlock)
|
|
127
127
|
RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
|
|
128
|
-
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange,
|
|
128
|
+
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
|
|
129
129
|
RCT_CUSTOM_VIEW_PROPERTY(initialRegion, MKCoordinateRegion, AIRMap)
|
|
130
130
|
{
|
|
131
131
|
if (json == nil) return;
|
|
@@ -186,18 +186,7 @@ RCT_EXPORT_METHOD(getMapBoundaries:(nonnull NSNumber *)reactTag
|
|
|
186
186
|
if (![view isKindOfClass:[AIRMap class]]) {
|
|
187
187
|
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
188
188
|
} else {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
resolve(@{
|
|
192
|
-
@"northEast" : @{
|
|
193
|
-
@"longitude" : boundingBox[0][0],
|
|
194
|
-
@"latitude" : boundingBox[0][1]
|
|
195
|
-
},
|
|
196
|
-
@"southWest" : @{
|
|
197
|
-
@"longitude" : boundingBox[1][0],
|
|
198
|
-
@"latitude" : boundingBox[1][1]
|
|
199
|
-
}
|
|
200
|
-
});
|
|
189
|
+
resolve([view getMapBoundaries]);
|
|
201
190
|
}
|
|
202
191
|
}];
|
|
203
192
|
}
|
|
@@ -1006,14 +995,14 @@ static int kDragCenterContext;
|
|
|
1006
995
|
|
|
1007
996
|
- (void)_emitRegionChangeEvent:(AIRMap *)mapView continuous:(BOOL)continuous
|
|
1008
997
|
{
|
|
1009
|
-
if (!mapView.ignoreRegionChanges && mapView.
|
|
998
|
+
if (!mapView.ignoreRegionChanges && mapView.onRegionChange) {
|
|
1010
999
|
MKCoordinateRegion region = mapView.region;
|
|
1011
1000
|
if (!CLLocationCoordinate2DIsValid(region.center)) {
|
|
1012
1001
|
return;
|
|
1013
1002
|
}
|
|
1014
1003
|
|
|
1015
1004
|
#define FLUSH_NAN(value) (isnan(value) ? 0 : value)
|
|
1016
|
-
mapView.
|
|
1005
|
+
mapView.onRegionChange(@{
|
|
1017
1006
|
@"continuous": @(continuous),
|
|
1018
1007
|
@"region": @{
|
|
1019
1008
|
@"latitude": @(FLUSH_NAN(region.center.latitude)),
|