react-native-maps 1.21.0-alpha.9 → 1.21.0-alpha.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +45 -14
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +26 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +18 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +206 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +40 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +46 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +27 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNMapsSpecs-generated.cpp +68 -0
- package/android/generated/jni/RNMapsSpecs.h +31 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +984 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +853 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +193 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1223 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +24 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +109 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +113 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +1 -2
- package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
- package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
- package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +619 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +258 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +235 -2
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +95 -0
- package/android/src/main/java/com/rnmaps/fabric/PolygonManager.java +89 -0
- package/android/src/main/java/com/rnmaps/fabric/PolylineManager.java +121 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnKmlReadyEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPanDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +38 -2
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
- package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +79 -3
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +267 -151
- package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +31 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +207 -141
- package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -16
- package/android/src/main/java/com/rnmaps/maps/MapView.java +1653 -1337
- package/ios/AirGoogleMaps/AIRGoogleMap.h +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMap.m +106 -58
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +3 -1
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +2 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +30 -0
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +2 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +197 -61
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +215 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +2 -1
- package/ios/AirMaps/AIRMap.m +227 -236
- package/ios/AirMaps/AIRMapManager.m +6 -0
- package/ios/AirMaps/AIRMapMarker.h +1 -0
- package/ios/AirMaps/AIRMapMarker.m +165 -103
- package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
- package/ios/AirMaps/RNMapsAirModule.h +1 -1
- package/ios/AirMaps/RNMapsAirModule.mm +4 -3
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
- package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
- package/ios/AirMaps/RNMapsMapView.mm +336 -307
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +427 -0
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +21 -0
- package/ios/AirMaps/UIView +AirMap.m +20 -0
- package/ios/AirMaps/UIView+AirMap.h +11 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +60 -0
- package/ios/generated/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/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +984 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +853 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +193 -0
- package/ios/generated/RNMapsSpecs/Props.h +1223 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +603 -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 +4 -0
- package/ios/generated/react-native-maps-generated-umbrella.h +14 -0
- package/lib/MapCircle.d.ts +1 -1
- package/lib/MapHeatmap.d.ts +2 -2
- package/lib/MapHeatmap.js +1 -1
- package/lib/MapMarker.d.ts +16 -3
- package/lib/MapMarker.js +58 -9
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.d.ts +1 -0
- package/lib/MapOverlay.js +21 -9
- package/lib/MapPolygon.d.ts +1 -1
- package/lib/MapPolyline.d.ts +7 -7
- package/lib/MapView.d.ts +15 -27
- package/lib/MapView.js +109 -124
- package/lib/MapView.types.d.ts +1 -1
- package/lib/createFabricMap.d.ts +1 -0
- package/lib/createFabricMap.js +17 -4
- package/lib/decorateMapComponent.js +40 -0
- package/lib/specs/NativeAirMapsModule.d.ts +2 -2
- package/lib/specs/NativeComponentCallout.d.ts +46 -0
- package/lib/specs/NativeComponentCallout.js +9 -0
- package/lib/specs/NativeComponentCircle.d.ts +74 -0
- package/lib/specs/NativeComponentCircle.js +7 -0
- package/lib/specs/NativeComponentGoogleMapView.d.ts +15 -15
- package/lib/specs/NativeComponentGoogleMapView.js +1 -0
- package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
- package/lib/specs/NativeComponentGooglePolygon.js +7 -0
- package/lib/specs/NativeComponentMapView.d.ts +28 -36
- package/lib/specs/NativeComponentMapView.js +2 -3
- package/lib/specs/NativeComponentMarker.d.ts +258 -0
- package/lib/specs/NativeComponentMarker.js +19 -0
- package/lib/specs/NativeComponentOverlay.d.ts +67 -0
- package/lib/specs/NativeComponentOverlay.js +7 -0
- package/lib/specs/NativeComponentPolyline.d.ts +101 -0
- package/lib/specs/NativeComponentPolyline.js +7 -0
- package/package.json +27 -21
- package/react-native-maps.podspec +61 -16
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
11
|
#import "AIRGMSPolygon.h"
|
|
12
12
|
#import "AIRGoogleMapCoordinate.h"
|
|
13
|
+
#import "AIRGoogleMap.h"
|
|
13
14
|
|
|
14
15
|
@interface AIRGoogleMapPolygon : UIView
|
|
15
16
|
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
@property (nonatomic, assign) BOOL geodesic;
|
|
27
28
|
@property (nonatomic, assign) int zIndex;
|
|
28
29
|
@property (nonatomic, assign) BOOL tappable;
|
|
29
|
-
|
|
30
|
+
- (void) didInsertInMap:(AIRGoogleMap *) map;
|
|
30
31
|
@end
|
|
31
32
|
|
|
32
33
|
#endif
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#import "AIRGoogleMapPolygon.h"
|
|
10
10
|
#import "AIRGMSPolygon.h"
|
|
11
11
|
#import <GoogleMaps/GoogleMaps.h>
|
|
12
|
+
#import "AIRGoogleMap.h"
|
|
12
13
|
|
|
13
14
|
@implementation AIRGoogleMapPolygon
|
|
14
15
|
{
|
|
@@ -41,6 +42,35 @@
|
|
|
41
42
|
_polygon.strokeWidth = _strokeWidth;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
- (void) didInsertInMap:(AIRGoogleMap *) map
|
|
46
|
+
{
|
|
47
|
+
_polygon = [AIRGMSPolygon new];
|
|
48
|
+
|
|
49
|
+
if (_identifier){
|
|
50
|
+
[_polygon setIdentifier:_identifier];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[_polygon setTappable:_tappable];
|
|
54
|
+
if (_strokeColor){
|
|
55
|
+
_polygon.strokeColor = _strokeColor;
|
|
56
|
+
}
|
|
57
|
+
if (_fillColor){
|
|
58
|
+
_polygon.fillColor = _fillColor;
|
|
59
|
+
}
|
|
60
|
+
if (_strokeWidth){
|
|
61
|
+
_polygon.strokeWidth = _strokeWidth;
|
|
62
|
+
}
|
|
63
|
+
if (_coordinates){
|
|
64
|
+
[self setCoordinates:_coordinates];
|
|
65
|
+
}
|
|
66
|
+
if (_holes){
|
|
67
|
+
[self setHoles:_holes];
|
|
68
|
+
}
|
|
69
|
+
if (_zIndex){
|
|
70
|
+
_polygon.zIndex = _zIndex;
|
|
71
|
+
}
|
|
72
|
+
[_polygon setMap:map];
|
|
73
|
+
}
|
|
44
74
|
|
|
45
75
|
- (void)setCoordinates:(NSArray<AIRGoogleMapCoordinate *> *)coordinates
|
|
46
76
|
{
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
@property (nonatomic, strong) UIColor *strokeColor;
|
|
26
26
|
@property (nonatomic, strong) NSArray<UIColor *> *strokeColors;
|
|
27
27
|
@property (nonatomic, assign) double strokeWidth;
|
|
28
|
-
@property (nonatomic, assign) UIColor *fillColor;
|
|
29
28
|
@property (nonatomic, strong) NSArray<NSNumber *> *lineDashPattern;
|
|
30
29
|
@property (nonatomic, assign) BOOL geodesic;
|
|
31
30
|
@property (nonatomic, assign) NSString *title;
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
{
|
|
20
20
|
if (self = [super init]) {
|
|
21
21
|
_polyline = [[AIRGMSPolyline alloc] init];
|
|
22
|
-
_polyline.spans = @[[GMSStyleSpan spanWithColor:_strokeColor]];
|
|
23
22
|
_polyline.strokeColor = _strokeColor;
|
|
24
23
|
}
|
|
25
24
|
return self;
|
|
@@ -79,12 +78,6 @@
|
|
|
79
78
|
_polyline.strokeWidth = strokeWidth;
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
-(void)setFillColor:(UIColor *)fillColor
|
|
83
|
-
{
|
|
84
|
-
_fillColor = fillColor;
|
|
85
|
-
_polyline.spans = @[[GMSStyleSpan spanWithColor:fillColor]];
|
|
86
|
-
}
|
|
87
|
-
|
|
88
81
|
- (void)setLineDashPattern:(NSArray<NSNumber *> *)lineDashPattern {
|
|
89
82
|
_lineDashPattern = lineDashPattern;
|
|
90
83
|
[self configureStyleSpansIfNeeded];
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
@interface WMSTileOverlay : GMSSyncTileLayer
|
|
15
15
|
@property (nonatomic) double MapX,MapY,FULL;
|
|
16
|
-
@property (nonatomic,
|
|
16
|
+
@property (nonatomic, assign) NSString *urlTemplate;
|
|
17
17
|
@property (nonatomic, assign) NSInteger maximumZ;
|
|
18
18
|
@property (nonatomic, assign) NSInteger minimumZ;
|
|
19
19
|
@end
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
{
|
|
63
63
|
_urlTemplate = urlTemplate;
|
|
64
64
|
WMSTileOverlay *tile = [[WMSTileOverlay alloc] init];
|
|
65
|
-
[tile
|
|
65
|
+
[tile setUrlTemplate:urlTemplate];
|
|
66
66
|
[tile setMaximumZ: _maximumZ];
|
|
67
67
|
[tile setMinimumZ: _minimumZ];
|
|
68
68
|
[tile setOpacity: _opacity];
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
return nil;
|
|
108
108
|
}
|
|
109
109
|
NSArray *bb = [self getBoundBox:x yAxis:y zoom:zoom];
|
|
110
|
-
NSMutableString *url = [self.
|
|
110
|
+
NSMutableString *url = [self.urlTemplate mutableCopy];
|
|
111
111
|
[url replaceOccurrencesOfString: @"{minX}" withString:[NSString stringWithFormat:@"%@", bb[0]] options:0 range:NSMakeRange(0, url.length)];
|
|
112
112
|
[url replaceOccurrencesOfString: @"{minY}" withString:[NSString stringWithFormat:@"%@", bb[1]] options:0 range:NSMakeRange(0, url.length)];
|
|
113
113
|
[url replaceOccurrencesOfString: @"{maxX}" withString:[NSString stringWithFormat:@"%@", bb[2]] options:0 range:NSMakeRange(0, url.length)];
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
|
|
34
34
|
+ (AIRGoogleMapCoordinate *)AIRGoogleMapCoordinate:(id)json
|
|
35
35
|
{
|
|
36
|
+
// empty coordinates
|
|
37
|
+
if ([json isKindOfClass:[NSArray class]] && [json count] == 0) return nil;
|
|
36
38
|
AIRGoogleMapCoordinate *coord = [AIRGoogleMapCoordinate new];
|
|
37
39
|
coord.coordinate = [self CLLocationCoordinate2D:json];
|
|
38
40
|
return coord;
|
|
@@ -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.
|
|
@@ -8,20 +8,16 @@
|
|
|
8
8
|
#ifdef HAVE_GOOGLE_MAPS
|
|
9
9
|
|
|
10
10
|
#import "RNMapsGoogleMapView.h"
|
|
11
|
-
#import "
|
|
11
|
+
#import "RNMapsGooglePolygonView.h"
|
|
12
|
+
#import "AIRGoogleMap.h"
|
|
12
13
|
#import "AIRMapMarker.h"
|
|
13
|
-
#import "
|
|
14
|
-
|
|
15
|
-
#import <react/renderer/components/RNMapsSpecs/ComponentDescriptors.h>
|
|
16
|
-
#import <react/renderer/components/RNMapsSpecs/EventEmitters.h>
|
|
17
|
-
#import <react/renderer/components/RNMapsSpecs/Props.h>
|
|
18
|
-
#import <react/renderer/components/RNMapsSpecs/RCTComponentViewHelpers.h>
|
|
19
|
-
|
|
14
|
+
#import "AIRGoogleMapManager.h"
|
|
15
|
+
#import "react-native-maps-generated-umbrella.h"
|
|
20
16
|
#import "RCTFabricComponentsPlugins.h"
|
|
21
17
|
#import <React/RCTConversions.h>
|
|
22
18
|
#import "RCTConvert+GMSMapViewType.h"
|
|
23
19
|
#import "RCTConvert+AirMap.h"
|
|
24
|
-
|
|
20
|
+
#import "UIView+AirMap.h"
|
|
25
21
|
|
|
26
22
|
using namespace facebook::react;
|
|
27
23
|
|
|
@@ -31,6 +27,8 @@ using namespace facebook::react;
|
|
|
31
27
|
@implementation RNMapsGoogleMapView {
|
|
32
28
|
AIRGoogleMap *_view;
|
|
33
29
|
AIRGoogleMapManager* _legacyMapManager;
|
|
30
|
+
NSMutableDictionary<NSNumber*, UIView*>* _pendingInsertsSubviews;
|
|
31
|
+
NSMutableArray *_polygons;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
|
|
@@ -42,11 +40,12 @@ using namespace facebook::react;
|
|
|
42
40
|
- (void)animateToRegion:(NSString *)regionJSON duration:(NSInteger)duration{
|
|
43
41
|
NSDictionary* regionDic = [RCTConvert dictonaryFromString:regionJSON];
|
|
44
42
|
MKCoordinateRegion region = [RCTConvert MKCoordinateRegion:regionDic];
|
|
45
|
-
[CATransaction begin];
|
|
46
|
-
[CATransaction setAnimationDuration:duration/1000];
|
|
47
43
|
GMSCameraPosition *camera = [AIRGoogleMap makeGMSCameraPositionFromMap:_view andMKCoordinateRegion:region];
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
if (duration == 0){
|
|
45
|
+
[_view setRegion:region];
|
|
46
|
+
} else {
|
|
47
|
+
[_view animateToCameraPosition:camera];
|
|
48
|
+
}
|
|
50
49
|
}
|
|
51
50
|
- (void)setCamera:(NSString *)cameraJSON{
|
|
52
51
|
NSDictionary* cameraDic = [RCTConvert dictonaryFromString:cameraJSON];
|
|
@@ -79,9 +78,19 @@ using namespace facebook::react;
|
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
NSDictionary* edgePadding = [RCTConvert dictonaryFromString:edgePaddingJSON];
|
|
82
|
-
|
|
81
|
+
|
|
83
82
|
[_view fitToCoordinates:coordinatesArray withEdgePadding:edgePadding animated:animated];
|
|
84
83
|
}
|
|
84
|
+
- (void) setIndoorActiveLevelIndex:(NSInteger)activeLevelIndex
|
|
85
|
+
{
|
|
86
|
+
if (!_view.indoorDisplay) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if ( activeLevelIndex < [_view.indoorDisplay.activeBuilding.levels count]) {
|
|
90
|
+
_view.indoorDisplay.activeLevel = _view.indoorDisplay.activeBuilding.levels[activeLevelIndex];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
}
|
|
85
94
|
|
|
86
95
|
#pragma mark - Native commands
|
|
87
96
|
|
|
@@ -95,11 +104,25 @@ using namespace facebook::react;
|
|
|
95
104
|
{
|
|
96
105
|
return concreteComponentDescriptorProvider<RNMapsGoogleMapViewComponentDescriptor>();
|
|
97
106
|
}
|
|
107
|
+
- (void) loadPendingInsertSubviews
|
|
108
|
+
{
|
|
109
|
+
if ([_pendingInsertsSubviews count] > 0){
|
|
110
|
+
NSArray<NSNumber *> *sortedKeys = [[_pendingInsertsSubviews allKeys] sortedArrayUsingSelector:@selector(compare:)];
|
|
111
|
+
for (NSNumber *key in sortedKeys) {
|
|
112
|
+
// Get the corresponding view
|
|
113
|
+
UIView *view = [_pendingInsertsSubviews objectForKey:key];
|
|
114
|
+
[_view insertReactSubview:view atIndex:[key integerValue]];
|
|
115
|
+
// Remove the entry from the dictionary
|
|
116
|
+
[_pendingInsertsSubviews removeObjectForKey:key];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
98
120
|
|
|
99
121
|
- (void) prepareContentView {
|
|
100
|
-
|
|
122
|
+
|
|
101
123
|
_view = (AIRGoogleMap *)[_legacyMapManager view];
|
|
102
|
-
|
|
124
|
+
_polygons = [NSMutableArray new];
|
|
125
|
+
|
|
103
126
|
self.contentView = _view;
|
|
104
127
|
|
|
105
128
|
_view.onPress = [self](NSDictionary* dictionary) {
|
|
@@ -130,14 +153,76 @@ using namespace facebook::react;
|
|
|
130
153
|
}
|
|
131
154
|
};
|
|
132
155
|
|
|
156
|
+
_view.onLongPress = [self](NSDictionary* dictionary) {
|
|
157
|
+
if (_eventEmitter) {
|
|
158
|
+
// Extract values from the NSDictionary
|
|
159
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
160
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
161
|
+
|
|
162
|
+
// Populate the OnMapPressCoordinate struct
|
|
163
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnLongPressCoordinate coordinate = {
|
|
164
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
165
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// Populate the OnMapPressPosition struct
|
|
169
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnLongPressPosition position = {
|
|
170
|
+
.x = [positionDict[@"x"] doubleValue],
|
|
171
|
+
.y = [positionDict[@"y"] doubleValue],
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
175
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnLongPress data = {
|
|
176
|
+
.action = std::string([@"press" UTF8String]),
|
|
177
|
+
.position = position,
|
|
178
|
+
.coordinate = coordinate
|
|
179
|
+
};
|
|
180
|
+
mapViewEventEmitter->onLongPress(data);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
133
184
|
_view.onMapReady = [self](NSDictionary* dictionary) {
|
|
185
|
+
[self loadPendingInsertSubviews];
|
|
134
186
|
if (_eventEmitter) {
|
|
135
187
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
136
188
|
facebook::react::RNMapsGoogleMapViewEventEmitter::OnMapReady data = {};
|
|
137
189
|
mapViewEventEmitter->onMapReady(data);
|
|
138
190
|
}
|
|
139
191
|
};
|
|
140
|
-
|
|
192
|
+
|
|
193
|
+
_view.onIndoorLevelActivated = [self](NSDictionary* dictionary) {
|
|
194
|
+
if (_eventEmitter) {
|
|
195
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
196
|
+
|
|
197
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivatedIndoorLevel level = {
|
|
198
|
+
.activeLevelIndex= (int) [dictionary[@"activeLevelIndex"] integerValue],
|
|
199
|
+
.name = [dictionary[@"name"] UTF8String],
|
|
200
|
+
.shortName = [dictionary[@"shortName"] UTF8String],
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
|
|
204
|
+
.indoorLevel = level,
|
|
205
|
+
};
|
|
206
|
+
mapViewEventEmitter->onIndoorLevelActivated(data);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
_view.onIndoorBuildingFocused = [self](NSDictionary* dictionary) {
|
|
211
|
+
if (_eventEmitter) {
|
|
212
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
213
|
+
|
|
214
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocusedIndoorBuilding indoorBuilding = {
|
|
215
|
+
.underground = [dictionary[@"underground"] boolValue],
|
|
216
|
+
.activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue]
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocused data = {
|
|
220
|
+
.indoorBuilding = indoorBuilding
|
|
221
|
+
};
|
|
222
|
+
mapViewEventEmitter->onIndoorBuildingFocused(data);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
141
226
|
_view.onMapLoaded = [self](NSDictionary* dictionary) {
|
|
142
227
|
if (_eventEmitter) {
|
|
143
228
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
@@ -145,7 +230,7 @@ using namespace facebook::react;
|
|
|
145
230
|
mapViewEventEmitter->onMapLoaded(data);
|
|
146
231
|
}
|
|
147
232
|
};
|
|
148
|
-
|
|
233
|
+
|
|
149
234
|
_view.onKmlReady = [self](NSDictionary* dictionary) {
|
|
150
235
|
if (_eventEmitter) {
|
|
151
236
|
|
|
@@ -213,7 +298,7 @@ using namespace facebook::react;
|
|
|
213
298
|
if (errorDict){
|
|
214
299
|
str = errorDict[@"message"];
|
|
215
300
|
}
|
|
216
|
-
|
|
301
|
+
|
|
217
302
|
facebook::react::RNMapsGoogleMapViewEventEmitter::OnUserLocationChangeError error = {
|
|
218
303
|
.message = std::string([str UTF8String]),
|
|
219
304
|
};
|
|
@@ -228,6 +313,35 @@ using namespace facebook::react;
|
|
|
228
313
|
}
|
|
229
314
|
};
|
|
230
315
|
|
|
316
|
+
_view.onPoiClick = [self](NSDictionary* dictionary) {
|
|
317
|
+
if (_eventEmitter) {
|
|
318
|
+
|
|
319
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
320
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
321
|
+
|
|
322
|
+
// Populate the OnMapPressCoordinate struct
|
|
323
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClickCoordinate coordinate = {
|
|
324
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
325
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
326
|
+
};
|
|
327
|
+
// Populate the OnMapDouplePressPosition struct
|
|
328
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClickPosition position = {
|
|
329
|
+
.x = [positionDict[@"x"] doubleValue],
|
|
330
|
+
.y = [positionDict[@"y"] doubleValue],
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
335
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClick data = {
|
|
336
|
+
.coordinate = coordinate,
|
|
337
|
+
.position = position,
|
|
338
|
+
.placeId = [dictionary[@"placeId"] UTF8String],
|
|
339
|
+
.name = [dictionary[@"name"] UTF8String],
|
|
340
|
+
};
|
|
341
|
+
mapViewEventEmitter->onPoiClick(data);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
|
|
231
345
|
|
|
232
346
|
|
|
233
347
|
_view.onRegionChangeStart = [self](NSDictionary* dictionary) {
|
|
@@ -245,7 +359,7 @@ using namespace facebook::react;
|
|
|
245
359
|
mapViewEventEmitter->onRegionChangeStart(data);
|
|
246
360
|
}
|
|
247
361
|
};
|
|
248
|
-
|
|
362
|
+
|
|
249
363
|
_view.onRegionChange = [self](NSDictionary* dictionary) {
|
|
250
364
|
if (_eventEmitter) {
|
|
251
365
|
|
|
@@ -261,7 +375,7 @@ using namespace facebook::react;
|
|
|
261
375
|
mapViewEventEmitter->onRegionChange(data);
|
|
262
376
|
}
|
|
263
377
|
};
|
|
264
|
-
|
|
378
|
+
|
|
265
379
|
_view.onRegionChangeComplete = [self](NSDictionary* dictionary) {
|
|
266
380
|
if (_eventEmitter) {
|
|
267
381
|
|
|
@@ -331,41 +445,66 @@ using namespace facebook::react;
|
|
|
331
445
|
static const auto defaultProps = std::make_shared<const RNMapsGoogleMapViewProps>();
|
|
332
446
|
_props = defaultProps;
|
|
333
447
|
_legacyMapManager = [[AIRGoogleMapManager alloc] init];
|
|
448
|
+
_pendingInsertsSubviews = [NSMutableDictionary new];
|
|
334
449
|
}
|
|
335
450
|
|
|
336
451
|
return self;
|
|
337
452
|
}
|
|
338
453
|
|
|
339
|
-
- (id)getPaperViewFromChildComponentView:(UIView *)childComponentView {
|
|
340
|
-
// Check if the childComponentView responds to the "adapter" selector
|
|
341
|
-
if ([childComponentView respondsToSelector:@selector(paperView)]) {
|
|
342
|
-
// Safely return the paperView
|
|
343
|
-
return [childComponentView valueForKey:@"paperView"];
|
|
344
|
-
}
|
|
345
|
-
// Return nil if paperView is not accessible
|
|
346
|
-
return nil;
|
|
347
|
-
}
|
|
348
454
|
|
|
349
455
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index{
|
|
350
|
-
id<RCTComponent> paperView = [
|
|
456
|
+
id<RCTComponent> paperView = [childComponentView getPaperViewFromChildComponentView];
|
|
351
457
|
if (paperView){
|
|
352
|
-
[_view
|
|
458
|
+
if(_view && [_view isReady]){
|
|
459
|
+
[_view insertReactSubview:paperView atIndex:index];
|
|
460
|
+
} else {
|
|
461
|
+
[_pendingInsertsSubviews setObject:paperView forKey:[NSNumber numberWithInteger:index]];
|
|
462
|
+
}
|
|
463
|
+
} else {
|
|
464
|
+
[_view insertReactSubview:childComponentView atIndex:index];
|
|
465
|
+
if ([childComponentView isKindOfClass:[RNMapsGooglePolygonView class]]){
|
|
466
|
+
RNMapsGooglePolygonView* polygon = (RNMapsGooglePolygonView *) childComponentView;
|
|
467
|
+
[_polygons addObject:childComponentView];
|
|
468
|
+
[polygon didInsertInMap:_view];
|
|
469
|
+
}
|
|
353
470
|
}
|
|
354
471
|
}
|
|
472
|
+
|
|
355
473
|
- (void) unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
356
474
|
{
|
|
357
|
-
id<RCTComponent> paperView = [
|
|
475
|
+
id<RCTComponent> paperView = [childComponentView getPaperViewFromChildComponentView];
|
|
358
476
|
if (paperView){
|
|
359
|
-
[_view
|
|
477
|
+
if(_view && [_view isReady]){
|
|
478
|
+
[_view removeReactSubview:paperView];
|
|
479
|
+
} else {
|
|
480
|
+
[_pendingInsertsSubviews removeObjectForKey:[NSNumber numberWithInteger:index]];
|
|
481
|
+
}
|
|
482
|
+
} else {
|
|
483
|
+
[_view removeReactSubview:childComponentView];
|
|
484
|
+
if ([childComponentView isKindOfClass:[RNMapsGooglePolygonView class]]){
|
|
485
|
+
RNMapsGooglePolygonView* polygon = (RNMapsGooglePolygonView *) childComponentView;
|
|
486
|
+
[_polygons removeObject:childComponentView];
|
|
487
|
+
[polygon didRemoveFromMap];
|
|
488
|
+
}
|
|
360
489
|
}
|
|
361
490
|
}
|
|
491
|
+
- (void) prepareForRecycle
|
|
492
|
+
{
|
|
493
|
+
[super prepareForRecycle];
|
|
494
|
+
static const auto defaultProps = std::make_shared<const RNMapsGoogleMapViewProps>();
|
|
495
|
+
_props = defaultProps;
|
|
496
|
+
_legacyMapManager = [[AIRGoogleMapManager alloc] init];
|
|
497
|
+
_pendingInsertsSubviews = [NSMutableDictionary new];
|
|
498
|
+
[_view removeFromSuperview];
|
|
499
|
+
_view = nil;
|
|
500
|
+
}
|
|
362
501
|
|
|
363
502
|
|
|
364
503
|
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
365
504
|
{
|
|
366
505
|
const auto &oldViewProps = *std::static_pointer_cast<RNMapsGoogleMapViewProps const>(_props);
|
|
367
506
|
const auto &newViewProps = *std::static_pointer_cast<RNMapsGoogleMapViewProps const>(props);
|
|
368
|
-
|
|
507
|
+
|
|
369
508
|
|
|
370
509
|
if (oldViewProps.googleMapId != newViewProps.googleMapId) {
|
|
371
510
|
NSString* mapID = RCTNSStringFromString(newViewProps.googleMapId);
|
|
@@ -381,8 +520,6 @@ using namespace facebook::react;
|
|
|
381
520
|
if (oldViewProps.loadingBackgroundColor != newViewProps.loadingBackgroundColor){
|
|
382
521
|
_legacyMapManager.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor);
|
|
383
522
|
}
|
|
384
|
-
|
|
385
|
-
NSLog(@"initialCamera lat:%f lng:%f pitch:%f zoom:%f heading: %f", newViewProps.initialCamera.center.latitude, newViewProps.initialCamera.center.longitude, newViewProps.initialCamera.pitch, newViewProps.initialCamera.zoom, newViewProps.initialCamera.heading);
|
|
386
523
|
|
|
387
524
|
// bug with zoom / pitch / heading where value is not 0 even though
|
|
388
525
|
// nothing is passed from JS so we depend on lat / lng comparison for now
|
|
@@ -399,7 +536,7 @@ using namespace facebook::react;
|
|
|
399
536
|
_legacyMapManager.camera = camera;
|
|
400
537
|
}
|
|
401
538
|
|
|
402
|
-
|
|
539
|
+
|
|
403
540
|
|
|
404
541
|
if (!_view){
|
|
405
542
|
[self prepareContentView];
|
|
@@ -433,20 +570,6 @@ using namespace facebook::react;
|
|
|
433
570
|
_view.name = region; \
|
|
434
571
|
}
|
|
435
572
|
|
|
436
|
-
#define REMAP_GOOGLEMAPVIEW_CAMERA_PROP(name) \
|
|
437
|
-
if (newViewProps.name.center.latitude != oldViewProps.name.center.latitude || \
|
|
438
|
-
newViewProps.name.center.longitude != oldViewProps.name.center.longitude || \
|
|
439
|
-
newViewProps.name.heading != oldViewProps.name.heading || \
|
|
440
|
-
newViewProps.name.pitch != oldViewProps.name.pitch || \
|
|
441
|
-
newViewProps.name.zoom != oldViewProps.name.zoom) { \
|
|
442
|
-
GMSCameraPosition* camera = [GMSCameraPosition cameraWithLatitude:newViewProps.name.center.latitude \
|
|
443
|
-
longitude:newViewProps.name.center.longitude \
|
|
444
|
-
zoom:newViewProps.name.zoom \
|
|
445
|
-
bearing:newViewProps.name.heading \
|
|
446
|
-
viewingAngle:newViewProps.name.pitch]; \
|
|
447
|
-
_view.name = camera; \
|
|
448
|
-
}
|
|
449
|
-
|
|
450
573
|
|
|
451
574
|
#define REMAP_MAPVIEW_EDGEINSETS_PROP(name) \
|
|
452
575
|
if (newViewProps.name.top != oldViewProps.name.top || \
|
|
@@ -461,16 +584,16 @@ using namespace facebook::react;
|
|
|
461
584
|
|
|
462
585
|
|
|
463
586
|
REMAP_MAPVIEW_PROP(pitchEnabled)
|
|
464
|
-
|
|
465
587
|
REMAP_MAPVIEW_PROP(zoomTapEnabled)
|
|
466
|
-
|
|
467
588
|
REMAP_MAPVIEW_PROP(scrollEnabled)
|
|
468
|
-
|
|
589
|
+
|
|
590
|
+
REMAP_MAPVIEW_STRING_PROP(kmlSrc)
|
|
591
|
+
|
|
469
592
|
if (newViewProps.minZoom != oldViewProps.minZoom || newViewProps.maxZoom != oldViewProps.maxZoom){
|
|
470
593
|
[_view setMinZoom:newViewProps.minZoom maxZoom:newViewProps.maxZoom];
|
|
471
594
|
}
|
|
472
595
|
|
|
473
|
-
|
|
596
|
+
[_view setShowsCompass:newViewProps.showsCompass];
|
|
474
597
|
REMAP_MAPVIEW_PROP(showsTraffic)
|
|
475
598
|
REMAP_MAPVIEW_PROP(showsUserLocation)
|
|
476
599
|
REMAP_MAPVIEW_PROP(zoomEnabled)
|
|
@@ -479,9 +602,20 @@ using namespace facebook::react;
|
|
|
479
602
|
REMAP_MAPVIEW_REGION_PROP(region)
|
|
480
603
|
REMAP_MAPVIEW_REGION_PROP(initialRegion)
|
|
481
604
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
605
|
+
if (newViewProps.camera.center.latitude != oldViewProps.camera.center.latitude ||
|
|
606
|
+
newViewProps.camera.center.longitude != oldViewProps.camera.center.longitude ||
|
|
607
|
+
newViewProps.camera.heading != oldViewProps.camera.heading ||
|
|
608
|
+
newViewProps.camera.pitch != oldViewProps.camera.pitch ||
|
|
609
|
+
newViewProps.camera.zoom != oldViewProps.camera.zoom) {
|
|
610
|
+
GMSCameraPosition* camera = [GMSCameraPosition cameraWithLatitude:newViewProps.camera.center.latitude
|
|
611
|
+
longitude:newViewProps.camera.center.longitude
|
|
612
|
+
zoom:newViewProps.camera.zoom
|
|
613
|
+
bearing:newViewProps.camera.heading
|
|
614
|
+
viewingAngle:newViewProps.camera.pitch];
|
|
615
|
+
_view.cameraProp = camera;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
|
|
485
619
|
REMAP_MAPVIEW_EDGEINSETS_PROP(mapPadding)
|
|
486
620
|
|
|
487
621
|
|
|
@@ -495,14 +629,16 @@ using namespace facebook::react;
|
|
|
495
629
|
break;
|
|
496
630
|
case RNMapsGoogleMapViewMapType::Terrain:
|
|
497
631
|
_view.mapType = kGMSTypeTerrain;
|
|
632
|
+
break;
|
|
498
633
|
case RNMapsGoogleMapViewMapType::Hybrid:
|
|
499
634
|
_view.mapType = kGMSTypeHybrid;
|
|
635
|
+
break;
|
|
500
636
|
default:
|
|
501
637
|
_view.mapType = kGMSTypeNormal;
|
|
502
638
|
break;
|
|
503
639
|
}
|
|
504
640
|
}
|
|
505
|
-
|
|
641
|
+
|
|
506
642
|
if (oldViewProps.userInterfaceStyle != newViewProps.userInterfaceStyle){
|
|
507
643
|
switch (newViewProps.userInterfaceStyle) {
|
|
508
644
|
case RNMapsGoogleMapViewUserInterfaceStyle::Light:
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNMapsGoogleMapView.h
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Salah Ghanim on 23.11.24.
|
|
6
|
+
// Copyright © 2024 react-native-maps. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
9
|
+
#ifdef HAVE_GOOGLE_MAPS
|
|
10
|
+
|
|
11
|
+
#import <React/RCTViewComponentView.h>
|
|
12
|
+
#import <UIKit/UIKit.h>
|
|
13
|
+
|
|
14
|
+
@class AIRGoogleMap;
|
|
15
|
+
@class AIRGMSPolygon;
|
|
16
|
+
|
|
17
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
+
@interface RNMapsGooglePolygonView : RCTViewComponentView
|
|
19
|
+
- (void) didInsertInMap:(AIRGoogleMap*) map;
|
|
20
|
+
- (void) didRemoveFromMap;
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
24
|
+
|
|
25
|
+
#endif
|
|
26
|
+
#endif
|