react-native-maps 2.0.0-beta.12 → 2.0.0-beta.13
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/MapManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +1 -1
- package/ios/GoogleMaps/RNMGoogleMap.h +37 -38
- package/ios/GoogleMaps/RNMGoogleMap.m +1 -1
- package/ios/GoogleMaps/RNMGoogleMapManager.m +1 -1
- package/ios/Maps/RNMMap.h +1 -0
- package/ios/Maps/RNMMapManager.m +5 -1
- package/lib/MapView.d.ts +7 -7
- package/package.json +1 -1
|
@@ -311,7 +311,7 @@ public class MapManager extends ViewGroupManager<MapView> {
|
|
|
311
311
|
"onIndoorLevelActivated", MapBuilder.of("registrationName", "onIndoorLevelActivated"),
|
|
312
312
|
"onIndoorBuildingFocused", MapBuilder.of("registrationName", "onIndoorBuildingFocused"),
|
|
313
313
|
"onDoublePress", MapBuilder.of("registrationName", "onDoublePress"),
|
|
314
|
-
"
|
|
314
|
+
"onTilesRendered", MapBuilder.of("registrationName", "onTilesRendered")
|
|
315
315
|
));
|
|
316
316
|
|
|
317
317
|
return map;
|
|
@@ -404,7 +404,7 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
404
404
|
map.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
|
|
405
405
|
@Override public void onMapLoaded() {
|
|
406
406
|
isMapLoaded = true;
|
|
407
|
-
manager.pushEvent(context, view, "
|
|
407
|
+
manager.pushEvent(context, view, "onTilesRendered", new WritableNativeMap());
|
|
408
408
|
MapView.this.cacheView();
|
|
409
409
|
}
|
|
410
410
|
});
|
|
@@ -18,62 +18,61 @@
|
|
|
18
18
|
@interface RNMGoogleMap : GMSMapView
|
|
19
19
|
|
|
20
20
|
// TODO: don't use MK region?
|
|
21
|
-
@property (nonatomic,
|
|
21
|
+
@property (nonatomic, assign) BOOL pitchEnabled;
|
|
22
|
+
@property (nonatomic, assign) BOOL rotateEnabled;
|
|
23
|
+
@property (nonatomic, assign) BOOL scrollDuringRotateOrZoomEnabled;
|
|
24
|
+
@property (nonatomic, assign) BOOL scrollEnabled;
|
|
25
|
+
@property (nonatomic, assign) BOOL showsBuildings;
|
|
26
|
+
@property (nonatomic, assign) BOOL showsCompass;
|
|
27
|
+
@property (nonatomic, assign) BOOL showsIndoorLevelPicker;
|
|
28
|
+
@property (nonatomic, assign) BOOL showsIndoors;
|
|
29
|
+
@property (nonatomic, assign) BOOL showsMyLocationButton;
|
|
30
|
+
@property (nonatomic, assign) BOOL showsTraffic;
|
|
31
|
+
@property (nonatomic, assign) BOOL showsUserLocation;
|
|
32
|
+
@property (nonatomic, assign) BOOL zoomEnabled;
|
|
33
|
+
@property (nonatomic, assign) BOOL zoomTapEnabled;
|
|
34
|
+
@property (nonatomic, assign) GMSCameraPosition *cameraProp; // Because the base class already has a "camera" prop.
|
|
22
35
|
@property (nonatomic, assign) MKCoordinateRegion initialRegion;
|
|
23
36
|
@property (nonatomic, assign) MKCoordinateRegion region;
|
|
24
|
-
@property (nonatomic, assign) GMSCameraPosition *cameraProp; // Because the base class already has a "camera" prop.
|
|
25
|
-
@property (nonatomic, strong) GMSCameraPosition *initialCamera;
|
|
26
37
|
@property (nonatomic, assign) NSString *customMapStyleString;
|
|
27
|
-
@property (nonatomic, assign)
|
|
38
|
+
@property (nonatomic, assign) NSString *kmlSrc;
|
|
28
39
|
@property (nonatomic, assign) NSString *paddingAdjustmentBehaviorString;
|
|
29
|
-
@property (nonatomic,
|
|
30
|
-
@property (nonatomic, copy) RCTBubblingEventBlock
|
|
40
|
+
@property (nonatomic, assign) UIEdgeInsets mapPadding;
|
|
41
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onChange;
|
|
31
42
|
@property (nonatomic, copy) RCTBubblingEventBlock onKmlReady;
|
|
32
|
-
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
33
43
|
@property (nonatomic, copy) RCTBubblingEventBlock onLongPress;
|
|
34
|
-
@property (nonatomic, copy) RCTBubblingEventBlock
|
|
35
|
-
@property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;
|
|
44
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onMapReady;
|
|
36
45
|
@property (nonatomic, copy) RCTBubblingEventBlock onMarkerPress;
|
|
37
|
-
@property (nonatomic, copy) RCTBubblingEventBlock
|
|
46
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onPanDrag;
|
|
38
47
|
@property (nonatomic, copy) RCTBubblingEventBlock onPoiClick;
|
|
48
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
49
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onTilesRendered;
|
|
50
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;
|
|
51
|
+
@property (nonatomic, copy) RCTDirectEventBlock onIndoorBuildingFocused;
|
|
52
|
+
@property (nonatomic, copy) RCTDirectEventBlock onIndoorLevelActivated;
|
|
39
53
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
|
|
40
54
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChangeComplete;
|
|
41
|
-
@property (nonatomic,
|
|
42
|
-
@property (nonatomic,
|
|
55
|
+
@property (nonatomic, strong) GMSCameraPosition *initialCamera;
|
|
56
|
+
@property (nonatomic, strong) NSMutableArray *circles;
|
|
57
|
+
@property (nonatomic, strong) NSMutableArray *heatmaps;
|
|
43
58
|
@property (nonatomic, strong) NSMutableArray *markers;
|
|
59
|
+
@property (nonatomic, strong) NSMutableArray *overlays;
|
|
44
60
|
@property (nonatomic, strong) NSMutableArray *polygons;
|
|
45
61
|
@property (nonatomic, strong) NSMutableArray *polylines;
|
|
46
|
-
@property (nonatomic, strong) NSMutableArray *circles;
|
|
47
|
-
@property (nonatomic, strong) NSMutableArray *heatmaps;
|
|
48
62
|
@property (nonatomic, strong) NSMutableArray *tiles;
|
|
49
|
-
@property (nonatomic,
|
|
50
|
-
|
|
51
|
-
@property (nonatomic, assign) BOOL showsBuildings;
|
|
52
|
-
@property (nonatomic, assign) BOOL showsTraffic;
|
|
53
|
-
@property (nonatomic, assign) BOOL showsCompass;
|
|
54
|
-
@property (nonatomic, assign) BOOL scrollEnabled;
|
|
55
|
-
@property (nonatomic, assign) BOOL zoomEnabled;
|
|
56
|
-
@property (nonatomic, assign) BOOL rotateEnabled;
|
|
57
|
-
@property (nonatomic, assign) BOOL scrollDuringRotateOrZoomEnabled;
|
|
58
|
-
@property (nonatomic, assign) BOOL pitchEnabled;
|
|
59
|
-
@property (nonatomic, assign) BOOL zoomTapEnabled;
|
|
60
|
-
@property (nonatomic, assign) BOOL showsUserLocation;
|
|
61
|
-
@property (nonatomic, assign) BOOL showsMyLocationButton;
|
|
62
|
-
@property (nonatomic, assign) BOOL showsIndoors;
|
|
63
|
-
@property (nonatomic, assign) BOOL showsIndoorLevelPicker;
|
|
64
|
-
@property (nonatomic, assign) NSString *kmlSrc;
|
|
63
|
+
@property (nonatomic, weak) RCTBridge *bridge;
|
|
65
64
|
|
|
66
|
-
- (void)didPrepareMap;
|
|
67
|
-
- (void)mapViewDidFinishTileRendering;
|
|
68
65
|
- (BOOL)didTapMarker:(GMSMarker *)marker;
|
|
69
|
-
- (
|
|
70
|
-
- (void)didTapPolygon:(GMSPolygon *)polygon;
|
|
71
|
-
- (void)didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
72
|
-
- (void)didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
66
|
+
- (NSArray *)getMapBoundaries;
|
|
73
67
|
- (void)didChangeCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture;
|
|
74
|
-
- (void)
|
|
68
|
+
- (void)didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
69
|
+
- (void)didPrepareMap;
|
|
70
|
+
- (void)didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
75
71
|
- (void)didTapPOIWithPlaceID:(NSString *)placeID name:(NSString *) name location:(CLLocationCoordinate2D) location;
|
|
76
|
-
- (
|
|
72
|
+
- (void)didTapPolygon:(GMSPolygon *)polygon;
|
|
73
|
+
- (void)didTapPolyline:(GMSPolyline *)polyline;
|
|
74
|
+
- (void)idleAtCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture;
|
|
75
|
+
- (void)mapViewDidFinishTileRendering;
|
|
77
76
|
|
|
78
77
|
+ (MKCoordinateRegion)makeGMSCameraPositionFromMap:(GMSMapView *)map andGMSCameraPosition:(GMSCameraPosition *)position;
|
|
79
78
|
+ (GMSCameraPosition*)makeGMSCameraPositionFromMap:(GMSMapView *)map andMKCoordinateRegion:(MKCoordinateRegion)region;
|
|
@@ -330,7 +330,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
- (void)mapViewDidFinishTileRendering {
|
|
333
|
-
if (self.
|
|
333
|
+
if (self.onTilesRendered) self.onTilesRendered(@{});
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
- (BOOL)didTapMarker:(GMSMarker *)marker {
|
|
@@ -81,7 +81,6 @@ RCT_EXPORT_VIEW_PROPERTY(onIndoorBuildingFocused, RCTDirectEventBlock)
|
|
|
81
81
|
RCT_EXPORT_VIEW_PROPERTY(onIndoorLevelActivated, RCTDirectEventBlock)
|
|
82
82
|
RCT_EXPORT_VIEW_PROPERTY(onKmlReady, RCTBubblingEventBlock)
|
|
83
83
|
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
|
|
84
|
-
RCT_EXPORT_VIEW_PROPERTY(onMapLoaded, RCTBubblingEventBlock)
|
|
85
84
|
RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTBubblingEventBlock)
|
|
86
85
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
|
|
87
86
|
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTBubblingEventBlock)
|
|
@@ -89,6 +88,7 @@ RCT_EXPORT_VIEW_PROPERTY(onPoiClick, RCTDirectEventBlock)
|
|
|
89
88
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
90
89
|
RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
|
|
91
90
|
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeComplete, RCTDirectEventBlock)
|
|
91
|
+
RCT_EXPORT_VIEW_PROPERTY(onTilesRendered, RCTBubblingEventBlock)
|
|
92
92
|
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTBubblingEventBlock)
|
|
93
93
|
RCT_EXPORT_VIEW_PROPERTY(pitchEnabled, BOOL)
|
|
94
94
|
RCT_EXPORT_VIEW_PROPERTY(region, MKCoordinateRegion)
|
package/ios/Maps/RNMMap.h
CHANGED
|
@@ -66,6 +66,7 @@ extern const NSInteger RNMMapMaxZoomLevel;
|
|
|
66
66
|
@property (nonatomic, copy) RCTDirectEventBlock onMarkerDragEnd;
|
|
67
67
|
@property (nonatomic, copy) RCTDirectEventBlock onCalloutPress;
|
|
68
68
|
@property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
|
|
69
|
+
@property (nonatomic, copy) RCTBubblingEventBlock onTilesRendered;
|
|
69
70
|
@property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;
|
|
70
71
|
|
|
71
72
|
- (void)cacheViewIfNeeded;
|
package/ios/Maps/RNMMapManager.m
CHANGED
|
@@ -111,6 +111,7 @@ RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
|
|
|
111
111
|
RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
|
|
112
112
|
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTBubblingEventBlock)
|
|
113
113
|
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
114
|
+
RCT_EXPORT_VIEW_PROPERTY(onTilesRendered, RCTBubblingEventBlock)
|
|
114
115
|
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTBubblingEventBlock)
|
|
115
116
|
RCT_EXPORT_VIEW_PROPERTY(pitchEnabled, BOOL)
|
|
116
117
|
RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL)
|
|
@@ -551,9 +552,12 @@ static int kDragCenterContext;
|
|
|
551
552
|
[mapView beginLoading];
|
|
552
553
|
}
|
|
553
554
|
|
|
554
|
-
- (void)mapViewDidFinishRenderingMap:(RNMMap *)mapView fullyRendered:(BOOL)fullyRendered
|
|
555
|
+
- (void)mapViewDidFinishRenderingMap:(RNMMap *)mapView fullyRendered:(__unused BOOL)fullyRendered
|
|
555
556
|
{
|
|
556
557
|
[mapView finishLoading];
|
|
558
|
+
if (mapView.onTilesRendered) {
|
|
559
|
+
mapView.onTilesRendered(@{});
|
|
560
|
+
}
|
|
557
561
|
}
|
|
558
562
|
|
|
559
563
|
#pragma mark Private
|
package/lib/MapView.d.ts
CHANGED
|
@@ -227,13 +227,6 @@ export type MapViewProps = ViewProps & {
|
|
|
227
227
|
* @platform Android: Supported
|
|
228
228
|
*/
|
|
229
229
|
onLongPress?: (event: LongPressEvent) => void;
|
|
230
|
-
/**
|
|
231
|
-
* Callback that is called when the map has finished rendering all tiles.
|
|
232
|
-
*
|
|
233
|
-
* @platform iOS: Google Maps only
|
|
234
|
-
* @platform Android: Supported
|
|
235
|
-
*/
|
|
236
|
-
onMapLoaded?: (event: NativeSyntheticEvent<{}>) => void;
|
|
237
230
|
/**
|
|
238
231
|
* Callback that is called once the map is ready.
|
|
239
232
|
*
|
|
@@ -329,6 +322,13 @@ export type MapViewProps = ViewProps & {
|
|
|
329
322
|
* @platform Android: Supported
|
|
330
323
|
*/
|
|
331
324
|
onRegionChangeComplete?: (region: Region, details: Details) => void;
|
|
325
|
+
/**
|
|
326
|
+
* Callback that is called when the map has finished rendering all tiles.
|
|
327
|
+
*
|
|
328
|
+
* @platform iOS: Supported
|
|
329
|
+
* @platform Android: Supported
|
|
330
|
+
*/
|
|
331
|
+
onTilesRendered?: (event: NativeSyntheticEvent<{}>) => void;
|
|
332
332
|
/**
|
|
333
333
|
* Callback that is called when the underlying map figures our users current location
|
|
334
334
|
* (coordinate also includes isFromMockProvider value for Android API 18 and above).
|
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": "2.0.0-beta.
|
|
8
|
+
"version": "2.0.0-beta.13",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|