react-native-maps 1.21.0-alpha.104 → 1.21.0-alpha.106
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/src/main/java/com/rnmaps/maps/MapView.java +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMap.h +9 -10
- package/ios/AirGoogleMaps/AIRGoogleMap.m +4 -4
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +7 -8
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +1 -1
- 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.mm +1 -17
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +9 -9
- package/ios/AirMaps/AIRMap.h +5 -6
- package/ios/AirMaps/AIRMapManager.m +7 -7
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +1 -1
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +1 -1
- package/ios/AirMaps/RNMapsMapView.mm +1 -1
- package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
- package/lib/specs/NativeComponentMapView.d.ts +3 -3
- package/package.json +1 -1
- package/react-native-maps.podspec +0 -1
- package/specs/NativeComponentMapView.ts +3 -2
|
@@ -654,6 +654,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
654
654
|
MapBuilder.Builder<String, Object> builder = MapBuilder.builder();
|
|
655
655
|
builder.put(OnMarkerPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerPressEvent.EVENT_NAME));
|
|
656
656
|
builder.put(OnPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnPressEvent.EVENT_NAME));
|
|
657
|
+
builder.put(OnCalloutPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnCalloutPressEvent.EVENT_NAME));
|
|
657
658
|
builder.put(OnMarkerDragEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerDragEvent.EVENT_NAME));
|
|
658
659
|
builder.put(OnMarkerDragStartEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerDragStartEvent.EVENT_NAME));
|
|
659
660
|
builder.put(OnMarkerDragEndEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerDragEndEvent.EVENT_NAME));
|
|
@@ -664,7 +665,6 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
664
665
|
builder.put(OnMarkerSelectEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerSelectEvent.EVENT_NAME));
|
|
665
666
|
builder.put(OnMarkerDeselectEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerDeselectEvent.EVENT_NAME));
|
|
666
667
|
builder.put(OnMapLoadedEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMapLoadedEvent.EVENT_NAME));
|
|
667
|
-
builder.put(OnMarkerDeselectEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerDeselectEvent.EVENT_NAME));
|
|
668
668
|
builder.put(OnMapReadyEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMapReadyEvent.EVENT_NAME));
|
|
669
669
|
builder.put(OnUserLocationChangeEvent.EVENT_NAME, MapBuilder.of("registrationName", OnUserLocationChangeEvent.EVENT_NAME));
|
|
670
670
|
builder.put(OnRegionChangeEvent.EVENT_NAME, MapBuilder.of("registrationName", OnRegionChangeEvent.EVENT_NAME));
|
|
@@ -27,18 +27,17 @@
|
|
|
27
27
|
@property (nonatomic, assign) NSString *customMapStyleString;
|
|
28
28
|
@property (nonatomic, assign) UIEdgeInsets mapPadding;
|
|
29
29
|
@property (nonatomic, assign) NSString *paddingAdjustmentBehaviorString;
|
|
30
|
-
@property (nonatomic, copy)
|
|
31
|
-
@property (nonatomic, copy)
|
|
32
|
-
@property (nonatomic, copy)
|
|
30
|
+
@property (nonatomic, copy) RCTDirectEventBlock onMapReady;
|
|
31
|
+
@property (nonatomic, copy) RCTDirectEventBlock onMapLoaded;
|
|
32
|
+
@property (nonatomic, copy) RCTDirectEventBlock onKmlReady;
|
|
33
33
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
34
34
|
@property (nonatomic, copy) RCTBubblingEventBlock onLongPress;
|
|
35
|
-
@property (nonatomic, copy)
|
|
36
|
-
@property (nonatomic, copy)
|
|
37
|
-
@property (nonatomic, copy)
|
|
38
|
-
@property (nonatomic, copy)
|
|
39
|
-
@property (nonatomic, copy)
|
|
40
|
-
@property (nonatomic, copy)
|
|
41
|
-
@property (nonatomic, copy) RCTBubblingEventBlock onPoiClick;
|
|
35
|
+
@property (nonatomic, copy) RCTDirectEventBlock onPanDrag;
|
|
36
|
+
@property (nonatomic, copy) RCTDirectEventBlock onUserLocationChange;
|
|
37
|
+
@property (nonatomic, copy) RCTDirectEventBlock onMarkerPress;
|
|
38
|
+
@property (nonatomic, copy) RCTDirectEventBlock onMarkerSelect;
|
|
39
|
+
@property (nonatomic, copy) RCTDirectEventBlock onMarkerDeselect;
|
|
40
|
+
@property (nonatomic, copy) RCTDirectEventBlock onPoiClick;
|
|
42
41
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChangeStart;
|
|
43
42
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
|
|
44
43
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChangeComplete;
|
|
@@ -524,7 +524,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
524
524
|
@"isGesture": [NSNumber numberWithBool:isGesture],
|
|
525
525
|
};
|
|
526
526
|
|
|
527
|
-
if (self.
|
|
527
|
+
if (self.onRegionChange) self.onRegionChange(event);
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
- (void)didTapPOIWithPlaceID:(NSString *)placeID
|
|
@@ -546,7 +546,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
546
546
|
@"region": regionAsJSON([AIRGoogleMap makeGMSCameraPositionFromMap:self andGMSCameraPosition:position]),
|
|
547
547
|
@"isGesture": [NSNumber numberWithBool:isGesture],
|
|
548
548
|
};
|
|
549
|
-
|
|
549
|
+
if (self.onRegionChangeComplete) self.onRegionChangeComplete(event); // complete
|
|
550
550
|
_isAnimating = NO;
|
|
551
551
|
}
|
|
552
552
|
|
|
@@ -1068,7 +1068,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1068
1068
|
}
|
|
1069
1069
|
|
|
1070
1070
|
+ (NSString *)GetIconUrl:(GMUPlacemark *) marker parser:(GMUKMLParser *) parser {
|
|
1071
|
-
#
|
|
1071
|
+
#if HAVE_GOOGLE_MAPS_UTILS
|
|
1072
1072
|
if (marker.style.styleID != nil) {
|
|
1073
1073
|
for (GMUStyle *style in parser.styles) {
|
|
1074
1074
|
if (style.styleID == marker.style.styleID) {
|
|
@@ -1133,7 +1133,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
1133
1133
|
}
|
|
1134
1134
|
|
|
1135
1135
|
- (void)setKmlSrc:(NSString *)kmlUrl {
|
|
1136
|
-
#
|
|
1136
|
+
#if HAVE_GOOGLE_MAPS_UTILS
|
|
1137
1137
|
|
|
1138
1138
|
_kmlSrc = kmlUrl;
|
|
1139
1139
|
|
|
@@ -97,14 +97,13 @@ RCT_EXPORT_VIEW_PROPERTY(showsIndoorLevelPicker, BOOL)
|
|
|
97
97
|
RCT_EXPORT_VIEW_PROPERTY(customMapStyleString, NSString)
|
|
98
98
|
RCT_EXPORT_VIEW_PROPERTY(mapPadding, UIEdgeInsets)
|
|
99
99
|
RCT_REMAP_VIEW_PROPERTY(paddingAdjustmentBehavior, paddingAdjustmentBehaviorString, NSString)
|
|
100
|
-
RCT_EXPORT_VIEW_PROPERTY(onMapReady,
|
|
101
|
-
RCT_EXPORT_VIEW_PROPERTY(onMapLoaded,
|
|
102
|
-
RCT_EXPORT_VIEW_PROPERTY(onKmlReady,
|
|
100
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
|
|
101
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapLoaded, RCTDirectEventBlock)
|
|
102
|
+
RCT_EXPORT_VIEW_PROPERTY(onKmlReady, RCTDirectEventBlock)
|
|
103
103
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
104
104
|
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
|
|
105
|
-
RCT_EXPORT_VIEW_PROPERTY(onPanDrag,
|
|
106
|
-
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange,
|
|
107
|
-
RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
|
|
105
|
+
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
|
|
106
|
+
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
|
|
108
107
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
|
|
109
108
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
|
|
110
109
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
|
|
@@ -266,11 +265,11 @@ RCT_EXPORT_METHOD(takeSnapshot:(nonnull NSNumber *)reactTag
|
|
|
266
265
|
} else {
|
|
267
266
|
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
268
267
|
NSMutableDictionary* config = [NSMutableDictionary new];
|
|
269
|
-
|
|
268
|
+
|
|
270
269
|
[mapView takeSnapshotWithConfig:config success:callback error:^(NSString *code, NSString *message, NSError *error) {
|
|
271
270
|
callback(@[error]);
|
|
272
271
|
}];
|
|
273
|
-
|
|
272
|
+
|
|
274
273
|
[config setObject:width forKey:@"width"];
|
|
275
274
|
[config setObject:height forKey:@"height"];
|
|
276
275
|
[config setObject:format forKey:@"format"];
|
|
@@ -86,7 +86,7 @@ RCT_EXPORT_METHOD(redrawCallout:(nonnull NSNumber *)reactTag)
|
|
|
86
86
|
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
87
87
|
} else {
|
|
88
88
|
AIRGoogleMapMarker* marker = (AIRGoogleMapMarker *) view;
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
[NSTimer scheduledTimerWithTimeInterval:0.0
|
|
91
91
|
target:[NSBlockOperation blockOperationWithBlock:^{
|
|
92
92
|
[marker hideCalloutView];
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
NSInteger *maximumZ = self.maximumZ;
|
|
29
29
|
NSInteger *minimumZ = self.minimumZ;
|
|
30
30
|
GMSTileURLConstructor urls = ^NSURL* _Nullable (NSUInteger x, NSUInteger y, NSUInteger zoom) {
|
|
31
|
-
|
|
31
|
+
|
|
32
32
|
if (self.flipY == YES) {
|
|
33
33
|
y = (1 << zoom) - y - 1;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
NSString *url = urlTemplate;
|
|
37
37
|
url = [url stringByReplacingOccurrencesOfString:@"{x}" withString:[NSString stringWithFormat: @"%ld", (long)x]];
|
|
38
38
|
url = [url stringByReplacingOccurrencesOfString:@"{y}" withString:[NSString stringWithFormat: @"%ld", (long)y]];
|
|
@@ -242,7 +242,7 @@ using namespace facebook::react;
|
|
|
242
242
|
mapViewEventEmitter->onKmlReady(data);
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
|
-
_view.
|
|
245
|
+
_view.onRegionChange = [self](NSDictionary* dictionary) {
|
|
246
246
|
if (_eventEmitter) {
|
|
247
247
|
|
|
248
248
|
NSDictionary* regionDict = dictionary[@"region"];
|
|
@@ -363,22 +363,6 @@ using namespace facebook::react;
|
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
365
|
|
|
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
366
|
_view.onRegionChangeComplete = [self](NSDictionary* dictionary) {
|
|
383
367
|
if (_eventEmitter) {
|
|
384
368
|
|
|
@@ -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.
|
|
@@ -39,7 +39,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
39
39
|
if (newHole.size() != oldHole.size()) {
|
|
40
40
|
return false;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
return true;
|
|
@@ -74,7 +74,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
- (void) prepareContentView {
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
_view = [AIRGMSPolygon new];
|
|
79
79
|
_view.onPress = [self](NSDictionary* dictionary) {
|
|
80
80
|
if (_eventEmitter) {
|
|
@@ -169,7 +169,7 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
169
169
|
}
|
|
170
170
|
_view.path = path;
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
|
|
173
173
|
if (!areHolesEqual(newViewProps.holes, oldViewProps.holes)){
|
|
174
174
|
NSMutableArray<GMSMutablePath *> *interiorPolygons = [NSMutableArray array];
|
|
175
175
|
for(int h = 0; h < newViewProps.holes.size(); h++)
|
|
@@ -186,19 +186,19 @@ bool areHolesEqual(const std::vector<std::vector<RNMapsGooglePolygonHolesStruct>
|
|
|
186
186
|
}
|
|
187
187
|
_view.holes = interiorPolygons;
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
|
|
190
|
+
|
|
191
191
|
REMAP_MAPVIEW_PROP(tappable)
|
|
192
192
|
|
|
193
193
|
if (newViewProps.fillColor){
|
|
194
194
|
_view.fillColor = RCTUIColorFromSharedColor(newViewProps.fillColor);
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
if (newViewProps.strokeColor){
|
|
198
198
|
_view.strokeColor = RCTUIColorFromSharedColor(newViewProps.strokeColor);
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
|
|
201
|
+
|
|
202
202
|
|
|
203
203
|
|
|
204
204
|
[super updateProps:props oldProps:oldProps];
|
package/ios/AirMaps/AIRMap.h
CHANGED
|
@@ -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,8 +71,7 @@ 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;
|
|
@@ -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;
|
|
@@ -1006,14 +1006,14 @@ static int kDragCenterContext;
|
|
|
1006
1006
|
|
|
1007
1007
|
- (void)_emitRegionChangeEvent:(AIRMap *)mapView continuous:(BOOL)continuous
|
|
1008
1008
|
{
|
|
1009
|
-
if (!mapView.ignoreRegionChanges && mapView.
|
|
1009
|
+
if (!mapView.ignoreRegionChanges && mapView.onRegionChange) {
|
|
1010
1010
|
MKCoordinateRegion region = mapView.region;
|
|
1011
1011
|
if (!CLLocationCoordinate2DIsValid(region.center)) {
|
|
1012
1012
|
return;
|
|
1013
1013
|
}
|
|
1014
1014
|
|
|
1015
1015
|
#define FLUSH_NAN(value) (isnan(value) ? 0 : value)
|
|
1016
|
-
mapView.
|
|
1016
|
+
mapView.onRegionChange(@{
|
|
1017
1017
|
@"continuous": @(continuous),
|
|
1018
1018
|
@"region": @{
|
|
1019
1019
|
@"latitude": @(FLUSH_NAN(region.center.latitude)),
|
|
@@ -38,7 +38,7 @@ using namespace facebook::react;
|
|
|
38
38
|
- (void)fitToSuppliedMarkers:(NSString *)markersJSON edgePaddingJSON:(NSString *)edgePaddingJSON animated:(BOOL)animated {
|
|
39
39
|
}
|
|
40
40
|
- (void)fitToCoordinates:(NSString *)coordinatesJSON edgePaddingJSON:(NSString *)edgePaddingJSON animated:(BOOL)animated {
|
|
41
|
-
|
|
41
|
+
|
|
42
42
|
}
|
|
43
43
|
- (void) setIndoorActiveLevelIndex:(NSInteger)activeLevelIndex
|
|
44
44
|
{
|
|
@@ -157,7 +157,7 @@ using namespace facebook::react;
|
|
|
157
157
|
mapViewEventEmitter->onMapReady(data);
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
-
_view.
|
|
160
|
+
_view.onRegionChange = [self](NSDictionary* dictionary) {
|
|
161
161
|
if (_eventEmitter) {
|
|
162
162
|
NSDictionary* regionDict = dictionary[@"region"];
|
|
163
163
|
auto mapViewEventEmitter = std::static_pointer_cast<RNMapsMapViewEventEmitter const>(_eventEmitter);
|
|
@@ -17,7 +17,25 @@
|
|
|
17
17
|
|
|
18
18
|
RCT_EXPORT_MODULE(RNMapsMapViewManager)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(onDoublePress, RCTDirectEventBlock)
|
|
25
|
+
|
|
26
|
+
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
|
|
27
|
+
|
|
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(onMarkerDragStart, RCTDirectEventBlock)
|
|
32
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDrag, RCTDirectEventBlock)
|
|
33
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDragEnd, RCTDirectEventBlock)
|
|
34
|
+
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
|
|
36
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeComplete, RCTDirectEventBlock)
|
|
37
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
|
|
38
|
+
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
|
|
21
39
|
|
|
22
40
|
|
|
23
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HostComponent, ViewProps, ColorValue } from 'react-native';
|
|
3
|
-
import { Double, Int32, WithDefault, Float, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
import { Double, Int32, WithDefault, Float, DirectEventHandler, BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
4
|
export type EdgePadding = Readonly<{
|
|
5
5
|
top: Double;
|
|
6
6
|
right: Double;
|
|
@@ -37,7 +37,7 @@ export type KmlMarker = {
|
|
|
37
37
|
y: Double;
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
export type LongPressEventHandler =
|
|
40
|
+
export type LongPressEventHandler = BubblingEventHandler<Readonly<{
|
|
41
41
|
coordinate: {
|
|
42
42
|
latitude: Double;
|
|
43
43
|
longitude: Double;
|
|
@@ -209,7 +209,7 @@ export type PoiClickEventHandler = DirectEventHandler<Readonly<{
|
|
|
209
209
|
y: Double;
|
|
210
210
|
};
|
|
211
211
|
}>>;
|
|
212
|
-
export type MapPressEventHandler =
|
|
212
|
+
export type MapPressEventHandler = BubblingEventHandler<Readonly<{
|
|
213
213
|
coordinate: {
|
|
214
214
|
latitude: Double;
|
|
215
215
|
longitude: Double;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
8
|
-
"version": "1.21.0-alpha.
|
|
8
|
+
"version": "1.21.0-alpha.106",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -33,7 +33,6 @@ Pod::Spec.new do |s|
|
|
|
33
33
|
'GoogleMapsPrivacy' => ['ios/AirGoogleMaps/Resources/GoogleMapsPrivacy.bundle']
|
|
34
34
|
}
|
|
35
35
|
sp.compiler_flags = folly_compiler_flags + ' -DHAVE_GOOGLE_MAPS=1 -DHAVE_GOOGLE_MAPS_UTILS=1'
|
|
36
|
-
sp.dependency "react-native-maps/generated"
|
|
37
36
|
sp.dependency 'GoogleMaps', '9.3.0'
|
|
38
37
|
sp.dependency 'Google-Maps-iOS-Utils', '6.1.0'
|
|
39
38
|
install_modules_dependencies(sp)
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
WithDefault,
|
|
9
9
|
Float,
|
|
10
10
|
DirectEventHandler,
|
|
11
|
+
BubblingEventHandler,
|
|
11
12
|
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
12
13
|
|
|
13
14
|
export type EdgePadding = Readonly<{
|
|
@@ -59,7 +60,7 @@ export type KmlMarker = {
|
|
|
59
60
|
}; // Non-nullable Point
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
export type LongPressEventHandler =
|
|
63
|
+
export type LongPressEventHandler = BubblingEventHandler<
|
|
63
64
|
Readonly<{
|
|
64
65
|
coordinate: {
|
|
65
66
|
latitude: Double; // Inlined LatLng
|
|
@@ -278,7 +279,7 @@ export type PoiClickEventHandler = DirectEventHandler<
|
|
|
278
279
|
}>
|
|
279
280
|
>;
|
|
280
281
|
|
|
281
|
-
export type MapPressEventHandler =
|
|
282
|
+
export type MapPressEventHandler = BubblingEventHandler<
|
|
282
283
|
Readonly<{
|
|
283
284
|
coordinate: {
|
|
284
285
|
latitude: Double; // Inlined LatLng
|