react-native-maps 1.21.0-alpha.8 → 1.21.0-alpha.80
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/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/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 +27 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +29 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +940 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +809 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +170 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1142 -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 +22 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +87 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +89 -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/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +618 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +259 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +156 -4
- 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/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 +30 -2
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -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/MapPolygon.java +29 -0
- 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 +1649 -1336
- package/ios/AirGoogleMaps/AIRGoogleMap.h +3 -2
- package/ios/AirGoogleMaps/AIRGoogleMap.m +155 -50
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +17 -28
- 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.h +3 -3
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +201 -60
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +5 -2
- package/ios/AirMaps/AIRMap.m +285 -153
- 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 +42 -172
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
- package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
- package/ios/AirMaps/RNMapsMapView.h +3 -3
- package/ios/AirMaps/RNMapsMapView.mm +340 -308
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +430 -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 +27 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +29 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +940 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +809 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +170 -0
- package/ios/generated/RNMapsSpecs/Props.h +1142 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +595 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +22 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +87 -0
- package/ios/generated/RNMapsSpecs/States.cpp +16 -0
- package/ios/generated/RNMapsSpecs/States.h +89 -0
- package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
- package/ios/generated/RNMapsSpecsJSI.h +268 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -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 +53 -9
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.js +2 -8
- package/lib/MapPolygon.d.ts +1 -1
- package/lib/MapPolyline.d.ts +7 -7
- package/lib/MapView.d.ts +14 -27
- package/lib/MapView.js +97 -103
- package/lib/MapView.types.d.ts +1 -1
- package/lib/createFabricMap.d.ts +1 -0
- package/lib/createFabricMap.js +15 -2
- package/lib/decorateMapComponent.js +30 -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/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/NativeComponentPolyline.d.ts +101 -0
- package/lib/specs/NativeComponentPolyline.js +7 -0
- package/package.json +25 -20
- package/react-native-maps.podspec +2 -1
|
@@ -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;
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
#import <React/RCTViewComponentView.h>
|
|
12
12
|
#import <UIKit/UIKit.h>
|
|
13
|
+
#import "RNMapsHostVewDelegate.h"
|
|
14
|
+
|
|
13
15
|
@class AIRGoogleMap;
|
|
14
16
|
|
|
15
17
|
NS_ASSUME_NONNULL_BEGIN
|
|
16
18
|
|
|
17
|
-
@interface RNMapsGoogleMapView : RCTViewComponentView
|
|
18
|
-
|
|
19
|
-
- (AIRGoogleMap *) mapView;
|
|
19
|
+
@interface RNMapsGoogleMapView : RCTViewComponentView<RNMapsHostVewDelegate>
|
|
20
20
|
|
|
21
21
|
@end
|
|
22
22
|
|
|
@@ -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,21 @@
|
|
|
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
|
+
#import "AIRGoogleMapManager.h"
|
|
14
15
|
|
|
15
|
-
#import <react/
|
|
16
|
-
#import <react/
|
|
17
|
-
#import <react/
|
|
18
|
-
#import <react/
|
|
16
|
+
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
17
|
+
#import <react-native-maps-generated/EventEmitters.h>
|
|
18
|
+
#import <react-native-maps-generated/Props.h>
|
|
19
|
+
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
19
20
|
|
|
20
21
|
#import "RCTFabricComponentsPlugins.h"
|
|
21
22
|
#import <React/RCTConversions.h>
|
|
22
23
|
#import "RCTConvert+GMSMapViewType.h"
|
|
23
24
|
#import "RCTConvert+AirMap.h"
|
|
24
|
-
|
|
25
|
+
#import "UIView+AirMap.h"
|
|
25
26
|
|
|
26
27
|
using namespace facebook::react;
|
|
27
28
|
|
|
@@ -31,10 +32,12 @@ using namespace facebook::react;
|
|
|
31
32
|
@implementation RNMapsGoogleMapView {
|
|
32
33
|
AIRGoogleMap *_view;
|
|
33
34
|
AIRGoogleMapManager* _legacyMapManager;
|
|
35
|
+
NSMutableDictionary<NSNumber*, UIView*>* _pendingInsertsSubviews;
|
|
36
|
+
NSMutableArray *_polygons;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
|
|
37
|
-
- (
|
|
40
|
+
- (id<RNMapsAirModuleDelegate>) mapView {
|
|
38
41
|
return _view;
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -42,11 +45,12 @@ using namespace facebook::react;
|
|
|
42
45
|
- (void)animateToRegion:(NSString *)regionJSON duration:(NSInteger)duration{
|
|
43
46
|
NSDictionary* regionDic = [RCTConvert dictonaryFromString:regionJSON];
|
|
44
47
|
MKCoordinateRegion region = [RCTConvert MKCoordinateRegion:regionDic];
|
|
45
|
-
[CATransaction begin];
|
|
46
|
-
[CATransaction setAnimationDuration:duration/1000];
|
|
47
48
|
GMSCameraPosition *camera = [AIRGoogleMap makeGMSCameraPositionFromMap:_view andMKCoordinateRegion:region];
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
if (duration == 0){
|
|
50
|
+
[_view setRegion:region];
|
|
51
|
+
} else {
|
|
52
|
+
[_view animateToCameraPosition:camera];
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
- (void)setCamera:(NSString *)cameraJSON{
|
|
52
56
|
NSDictionary* cameraDic = [RCTConvert dictonaryFromString:cameraJSON];
|
|
@@ -79,9 +83,19 @@ using namespace facebook::react;
|
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
NSDictionary* edgePadding = [RCTConvert dictonaryFromString:edgePaddingJSON];
|
|
82
|
-
|
|
86
|
+
|
|
83
87
|
[_view fitToCoordinates:coordinatesArray withEdgePadding:edgePadding animated:animated];
|
|
84
88
|
}
|
|
89
|
+
- (void) setIndoorActiveLevelIndex:(NSInteger)activeLevelIndex
|
|
90
|
+
{
|
|
91
|
+
if (!_view.indoorDisplay) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if ( activeLevelIndex < [_view.indoorDisplay.activeBuilding.levels count]) {
|
|
95
|
+
_view.indoorDisplay.activeLevel = _view.indoorDisplay.activeBuilding.levels[activeLevelIndex];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
}
|
|
85
99
|
|
|
86
100
|
#pragma mark - Native commands
|
|
87
101
|
|
|
@@ -95,11 +109,25 @@ using namespace facebook::react;
|
|
|
95
109
|
{
|
|
96
110
|
return concreteComponentDescriptorProvider<RNMapsGoogleMapViewComponentDescriptor>();
|
|
97
111
|
}
|
|
112
|
+
- (void) loadPendingInsertSubviews
|
|
113
|
+
{
|
|
114
|
+
if ([_pendingInsertsSubviews count] > 0){
|
|
115
|
+
NSArray<NSNumber *> *sortedKeys = [[_pendingInsertsSubviews allKeys] sortedArrayUsingSelector:@selector(compare:)];
|
|
116
|
+
for (NSNumber *key in sortedKeys) {
|
|
117
|
+
// Get the corresponding view
|
|
118
|
+
UIView *view = [_pendingInsertsSubviews objectForKey:key];
|
|
119
|
+
[_view insertReactSubview:view atIndex:[key integerValue]];
|
|
120
|
+
// Remove the entry from the dictionary
|
|
121
|
+
[_pendingInsertsSubviews removeObjectForKey:key];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
98
125
|
|
|
99
126
|
- (void) prepareContentView {
|
|
100
|
-
|
|
127
|
+
|
|
101
128
|
_view = (AIRGoogleMap *)[_legacyMapManager view];
|
|
102
|
-
|
|
129
|
+
_polygons = [NSMutableArray new];
|
|
130
|
+
|
|
103
131
|
self.contentView = _view;
|
|
104
132
|
|
|
105
133
|
_view.onPress = [self](NSDictionary* dictionary) {
|
|
@@ -130,14 +158,76 @@ using namespace facebook::react;
|
|
|
130
158
|
}
|
|
131
159
|
};
|
|
132
160
|
|
|
161
|
+
_view.onLongPress = [self](NSDictionary* dictionary) {
|
|
162
|
+
if (_eventEmitter) {
|
|
163
|
+
// Extract values from the NSDictionary
|
|
164
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
165
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
166
|
+
|
|
167
|
+
// Populate the OnMapPressCoordinate struct
|
|
168
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnLongPressCoordinate coordinate = {
|
|
169
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
170
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// Populate the OnMapPressPosition struct
|
|
174
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnLongPressPosition position = {
|
|
175
|
+
.x = [positionDict[@"x"] doubleValue],
|
|
176
|
+
.y = [positionDict[@"y"] doubleValue],
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
180
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnLongPress data = {
|
|
181
|
+
.action = std::string([@"press" UTF8String]),
|
|
182
|
+
.position = position,
|
|
183
|
+
.coordinate = coordinate
|
|
184
|
+
};
|
|
185
|
+
mapViewEventEmitter->onLongPress(data);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
|
|
133
189
|
_view.onMapReady = [self](NSDictionary* dictionary) {
|
|
190
|
+
[self loadPendingInsertSubviews];
|
|
134
191
|
if (_eventEmitter) {
|
|
135
192
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
136
193
|
facebook::react::RNMapsGoogleMapViewEventEmitter::OnMapReady data = {};
|
|
137
194
|
mapViewEventEmitter->onMapReady(data);
|
|
138
195
|
}
|
|
139
196
|
};
|
|
140
|
-
|
|
197
|
+
|
|
198
|
+
_view.onIndoorLevelActivated = [self](NSDictionary* dictionary) {
|
|
199
|
+
if (_eventEmitter) {
|
|
200
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
201
|
+
|
|
202
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivatedIndoorLevel level = {
|
|
203
|
+
.activeLevelIndex= (int) [dictionary[@"activeLevelIndex"] integerValue],
|
|
204
|
+
.name = [dictionary[@"name"] UTF8String],
|
|
205
|
+
.shortName = [dictionary[@"shortName"] UTF8String],
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
|
|
209
|
+
.indoorLevel = level,
|
|
210
|
+
};
|
|
211
|
+
mapViewEventEmitter->onIndoorLevelActivated(data);
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
_view.onIndoorBuildingFocused = [self](NSDictionary* dictionary) {
|
|
216
|
+
if (_eventEmitter) {
|
|
217
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
218
|
+
|
|
219
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocusedIndoorBuilding indoorBuilding = {
|
|
220
|
+
.underground = [dictionary[@"underground"] boolValue],
|
|
221
|
+
.activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue]
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocused data = {
|
|
225
|
+
.indoorBuilding = indoorBuilding
|
|
226
|
+
};
|
|
227
|
+
mapViewEventEmitter->onIndoorBuildingFocused(data);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
141
231
|
_view.onMapLoaded = [self](NSDictionary* dictionary) {
|
|
142
232
|
if (_eventEmitter) {
|
|
143
233
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
@@ -145,7 +235,7 @@ using namespace facebook::react;
|
|
|
145
235
|
mapViewEventEmitter->onMapLoaded(data);
|
|
146
236
|
}
|
|
147
237
|
};
|
|
148
|
-
|
|
238
|
+
|
|
149
239
|
_view.onKmlReady = [self](NSDictionary* dictionary) {
|
|
150
240
|
if (_eventEmitter) {
|
|
151
241
|
|
|
@@ -213,7 +303,7 @@ using namespace facebook::react;
|
|
|
213
303
|
if (errorDict){
|
|
214
304
|
str = errorDict[@"message"];
|
|
215
305
|
}
|
|
216
|
-
|
|
306
|
+
|
|
217
307
|
facebook::react::RNMapsGoogleMapViewEventEmitter::OnUserLocationChangeError error = {
|
|
218
308
|
.message = std::string([str UTF8String]),
|
|
219
309
|
};
|
|
@@ -228,6 +318,35 @@ using namespace facebook::react;
|
|
|
228
318
|
}
|
|
229
319
|
};
|
|
230
320
|
|
|
321
|
+
_view.onPoiClick = [self](NSDictionary* dictionary) {
|
|
322
|
+
if (_eventEmitter) {
|
|
323
|
+
|
|
324
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
325
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
326
|
+
|
|
327
|
+
// Populate the OnMapPressCoordinate struct
|
|
328
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClickCoordinate coordinate = {
|
|
329
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
330
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
331
|
+
};
|
|
332
|
+
// Populate the OnMapDouplePressPosition struct
|
|
333
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClickPosition position = {
|
|
334
|
+
.x = [positionDict[@"x"] doubleValue],
|
|
335
|
+
.y = [positionDict[@"y"] doubleValue],
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
|
|
340
|
+
facebook::react::RNMapsGoogleMapViewEventEmitter::OnPoiClick data = {
|
|
341
|
+
.coordinate = coordinate,
|
|
342
|
+
.position = position,
|
|
343
|
+
.placeId = [dictionary[@"placeId"] UTF8String],
|
|
344
|
+
.name = [dictionary[@"name"] UTF8String],
|
|
345
|
+
};
|
|
346
|
+
mapViewEventEmitter->onPoiClick(data);
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
|
|
231
350
|
|
|
232
351
|
|
|
233
352
|
_view.onRegionChangeStart = [self](NSDictionary* dictionary) {
|
|
@@ -245,7 +364,7 @@ using namespace facebook::react;
|
|
|
245
364
|
mapViewEventEmitter->onRegionChangeStart(data);
|
|
246
365
|
}
|
|
247
366
|
};
|
|
248
|
-
|
|
367
|
+
|
|
249
368
|
_view.onRegionChange = [self](NSDictionary* dictionary) {
|
|
250
369
|
if (_eventEmitter) {
|
|
251
370
|
|
|
@@ -261,7 +380,7 @@ using namespace facebook::react;
|
|
|
261
380
|
mapViewEventEmitter->onRegionChange(data);
|
|
262
381
|
}
|
|
263
382
|
};
|
|
264
|
-
|
|
383
|
+
|
|
265
384
|
_view.onRegionChangeComplete = [self](NSDictionary* dictionary) {
|
|
266
385
|
if (_eventEmitter) {
|
|
267
386
|
|
|
@@ -331,41 +450,66 @@ using namespace facebook::react;
|
|
|
331
450
|
static const auto defaultProps = std::make_shared<const RNMapsGoogleMapViewProps>();
|
|
332
451
|
_props = defaultProps;
|
|
333
452
|
_legacyMapManager = [[AIRGoogleMapManager alloc] init];
|
|
453
|
+
_pendingInsertsSubviews = [NSMutableDictionary new];
|
|
334
454
|
}
|
|
335
455
|
|
|
336
456
|
return self;
|
|
337
457
|
}
|
|
338
458
|
|
|
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
459
|
|
|
349
460
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index{
|
|
350
|
-
id<RCTComponent> paperView = [
|
|
461
|
+
id<RCTComponent> paperView = [childComponentView getPaperViewFromChildComponentView];
|
|
351
462
|
if (paperView){
|
|
352
|
-
[_view
|
|
463
|
+
if(_view && [_view isReady]){
|
|
464
|
+
[_view insertReactSubview:paperView atIndex:index];
|
|
465
|
+
} else {
|
|
466
|
+
[_pendingInsertsSubviews setObject:paperView forKey:[NSNumber numberWithInteger:index]];
|
|
467
|
+
}
|
|
468
|
+
} else {
|
|
469
|
+
[_view insertReactSubview:childComponentView atIndex:index];
|
|
470
|
+
if ([childComponentView isKindOfClass:[RNMapsGooglePolygonView class]]){
|
|
471
|
+
RNMapsGooglePolygonView* polygon = (RNMapsGooglePolygonView *) childComponentView;
|
|
472
|
+
[_polygons addObject:childComponentView];
|
|
473
|
+
[polygon didInsertInMap:_view];
|
|
474
|
+
}
|
|
353
475
|
}
|
|
354
476
|
}
|
|
477
|
+
|
|
355
478
|
- (void) unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
356
479
|
{
|
|
357
|
-
id<RCTComponent> paperView = [
|
|
480
|
+
id<RCTComponent> paperView = [childComponentView getPaperViewFromChildComponentView];
|
|
358
481
|
if (paperView){
|
|
359
|
-
[_view
|
|
482
|
+
if(_view && [_view isReady]){
|
|
483
|
+
[_view removeReactSubview:paperView];
|
|
484
|
+
} else {
|
|
485
|
+
[_pendingInsertsSubviews removeObjectForKey:[NSNumber numberWithInteger:index]];
|
|
486
|
+
}
|
|
487
|
+
} else {
|
|
488
|
+
[_view removeReactSubview:childComponentView];
|
|
489
|
+
if ([childComponentView isKindOfClass:[RNMapsGooglePolygonView class]]){
|
|
490
|
+
RNMapsGooglePolygonView* polygon = (RNMapsGooglePolygonView *) childComponentView;
|
|
491
|
+
[_polygons removeObject:childComponentView];
|
|
492
|
+
[polygon didRemoveFromMap];
|
|
493
|
+
}
|
|
360
494
|
}
|
|
361
495
|
}
|
|
496
|
+
- (void) prepareForRecycle
|
|
497
|
+
{
|
|
498
|
+
[super prepareForRecycle];
|
|
499
|
+
static const auto defaultProps = std::make_shared<const RNMapsGoogleMapViewProps>();
|
|
500
|
+
_props = defaultProps;
|
|
501
|
+
_legacyMapManager = [[AIRGoogleMapManager alloc] init];
|
|
502
|
+
_pendingInsertsSubviews = [NSMutableDictionary new];
|
|
503
|
+
[_view removeFromSuperview];
|
|
504
|
+
_view = nil;
|
|
505
|
+
}
|
|
362
506
|
|
|
363
507
|
|
|
364
508
|
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
365
509
|
{
|
|
366
510
|
const auto &oldViewProps = *std::static_pointer_cast<RNMapsGoogleMapViewProps const>(_props);
|
|
367
511
|
const auto &newViewProps = *std::static_pointer_cast<RNMapsGoogleMapViewProps const>(props);
|
|
368
|
-
|
|
512
|
+
|
|
369
513
|
|
|
370
514
|
if (oldViewProps.googleMapId != newViewProps.googleMapId) {
|
|
371
515
|
NSString* mapID = RCTNSStringFromString(newViewProps.googleMapId);
|
|
@@ -381,8 +525,6 @@ using namespace facebook::react;
|
|
|
381
525
|
if (oldViewProps.loadingBackgroundColor != newViewProps.loadingBackgroundColor){
|
|
382
526
|
_legacyMapManager.backgroundColor = RCTUIColorFromSharedColor(newViewProps.backgroundColor);
|
|
383
527
|
}
|
|
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
528
|
|
|
387
529
|
// bug with zoom / pitch / heading where value is not 0 even though
|
|
388
530
|
// nothing is passed from JS so we depend on lat / lng comparison for now
|
|
@@ -399,7 +541,7 @@ using namespace facebook::react;
|
|
|
399
541
|
_legacyMapManager.camera = camera;
|
|
400
542
|
}
|
|
401
543
|
|
|
402
|
-
|
|
544
|
+
|
|
403
545
|
|
|
404
546
|
if (!_view){
|
|
405
547
|
[self prepareContentView];
|
|
@@ -433,20 +575,6 @@ using namespace facebook::react;
|
|
|
433
575
|
_view.name = region; \
|
|
434
576
|
}
|
|
435
577
|
|
|
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
578
|
|
|
451
579
|
#define REMAP_MAPVIEW_EDGEINSETS_PROP(name) \
|
|
452
580
|
if (newViewProps.name.top != oldViewProps.name.top || \
|
|
@@ -461,16 +589,16 @@ using namespace facebook::react;
|
|
|
461
589
|
|
|
462
590
|
|
|
463
591
|
REMAP_MAPVIEW_PROP(pitchEnabled)
|
|
464
|
-
|
|
465
592
|
REMAP_MAPVIEW_PROP(zoomTapEnabled)
|
|
466
|
-
|
|
467
593
|
REMAP_MAPVIEW_PROP(scrollEnabled)
|
|
468
|
-
|
|
594
|
+
|
|
595
|
+
REMAP_MAPVIEW_STRING_PROP(kmlSrc)
|
|
596
|
+
|
|
469
597
|
if (newViewProps.minZoom != oldViewProps.minZoom || newViewProps.maxZoom != oldViewProps.maxZoom){
|
|
470
598
|
[_view setMinZoom:newViewProps.minZoom maxZoom:newViewProps.maxZoom];
|
|
471
599
|
}
|
|
472
600
|
|
|
473
|
-
|
|
601
|
+
[_view setShowsCompass:newViewProps.showsCompass];
|
|
474
602
|
REMAP_MAPVIEW_PROP(showsTraffic)
|
|
475
603
|
REMAP_MAPVIEW_PROP(showsUserLocation)
|
|
476
604
|
REMAP_MAPVIEW_PROP(zoomEnabled)
|
|
@@ -479,9 +607,20 @@ using namespace facebook::react;
|
|
|
479
607
|
REMAP_MAPVIEW_REGION_PROP(region)
|
|
480
608
|
REMAP_MAPVIEW_REGION_PROP(initialRegion)
|
|
481
609
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
610
|
+
if (newViewProps.camera.center.latitude != oldViewProps.camera.center.latitude ||
|
|
611
|
+
newViewProps.camera.center.longitude != oldViewProps.camera.center.longitude ||
|
|
612
|
+
newViewProps.camera.heading != oldViewProps.camera.heading ||
|
|
613
|
+
newViewProps.camera.pitch != oldViewProps.camera.pitch ||
|
|
614
|
+
newViewProps.camera.zoom != oldViewProps.camera.zoom) {
|
|
615
|
+
GMSCameraPosition* camera = [GMSCameraPosition cameraWithLatitude:newViewProps.camera.center.latitude
|
|
616
|
+
longitude:newViewProps.camera.center.longitude
|
|
617
|
+
zoom:newViewProps.camera.zoom
|
|
618
|
+
bearing:newViewProps.camera.heading
|
|
619
|
+
viewingAngle:newViewProps.camera.pitch];
|
|
620
|
+
_view.cameraProp = camera;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
|
|
485
624
|
REMAP_MAPVIEW_EDGEINSETS_PROP(mapPadding)
|
|
486
625
|
|
|
487
626
|
|
|
@@ -495,14 +634,16 @@ using namespace facebook::react;
|
|
|
495
634
|
break;
|
|
496
635
|
case RNMapsGoogleMapViewMapType::Terrain:
|
|
497
636
|
_view.mapType = kGMSTypeTerrain;
|
|
637
|
+
break;
|
|
498
638
|
case RNMapsGoogleMapViewMapType::Hybrid:
|
|
499
639
|
_view.mapType = kGMSTypeHybrid;
|
|
640
|
+
break;
|
|
500
641
|
default:
|
|
501
642
|
_view.mapType = kGMSTypeNormal;
|
|
502
643
|
break;
|
|
503
644
|
}
|
|
504
645
|
}
|
|
505
|
-
|
|
646
|
+
|
|
506
647
|
if (oldViewProps.userInterfaceStyle != newViewProps.userInterfaceStyle){
|
|
507
648
|
switch (newViewProps.userInterfaceStyle) {
|
|
508
649
|
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
|