react-native-maps 2.0.0-beta.5 → 2.0.0-beta.7
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/MapCalloutManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapCircleManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapGradientPolyline.java +4 -4
- package/android/src/main/java/com/rnmaps/maps/MapGradientPolylineManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapHeatmapManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapLiteManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapLocalTile.java +4 -4
- package/android/src/main/java/com/rnmaps/maps/MapLocalTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +1 -56
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +9 -26
- package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolygonManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapTileProvider.java +4 -4
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +24 -131
- package/android/src/main/java/com/rnmaps/maps/MapViewModule.java +598 -0
- package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +6 -6
- package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapsPackage.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/SizeReportingShadowNode.java +1 -1
- package/ios/{AirGoogleMaps/AIRDummyView.h → GoogleMaps/RNMDummyView.h} +3 -3
- package/ios/{AirGoogleMaps/AIRDummyView.m → GoogleMaps/RNMDummyView.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSMarker.h → GoogleMaps/RNMGMSMarker.h} +6 -6
- package/ios/{AirGoogleMaps/AIRGMSMarker.m → GoogleMaps/RNMGMSMarker.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolygon.h → GoogleMaps/RNMGMSPolygon.h} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolygon.m → GoogleMaps/RNMGMSPolygon.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolyline.h → GoogleMaps/RNMGMSPolyline.h} +4 -4
- package/ios/{AirGoogleMaps/AIRGMSPolyline.m → GoogleMaps/RNMGMSPolyline.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMap.h → GoogleMaps/RNMGoogleMap.h} +5 -5
- package/ios/{AirGoogleMaps/AIRGoogleMap.m → GoogleMaps/RNMGoogleMap.m} +77 -77
- package/ios/{AirGoogleMaps/AIRGoogleMapCallout.h → GoogleMaps/RNMGoogleMapCallout.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCallout.m → GoogleMaps/RNMGoogleMapCallout.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutManager.h → GoogleMaps/RNMGoogleMapCalloutManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutManager.m → GoogleMaps/RNMGoogleMapCalloutManager.m} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutSubview.h → GoogleMaps/RNMGoogleMapCalloutSubview.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutSubview.m → GoogleMaps/RNMGoogleMapCalloutSubview.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapCalloutSubviewManager.h → GoogleMaps/RNMGoogleMapCalloutSubviewManager.h} +3 -3
- package/ios/GoogleMaps/RNMGoogleMapCalloutSubviewManager.m +28 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapCircle.h → GoogleMaps/RNMGoogleMapCircle.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCircle.m → GoogleMaps/RNMGoogleMapCircle.m} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapCircleManager.h → GoogleMaps/RNMGoogleMapCircleManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapCircleManager.m → GoogleMaps/RNMGoogleMapCircleManager.m} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapHeatmap.h → GoogleMaps/RNMGoogleMapHeatmap.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapHeatmap.m → GoogleMaps/RNMGoogleMapHeatmap.m} +4 -4
- package/ios/GoogleMaps/RNMGoogleMapHeatmapManager.h +11 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapHeatmapManager.m → GoogleMaps/RNMGoogleMapHeatmapManager.m} +9 -9
- package/ios/{AirGoogleMaps/AIRGoogleMapManager.h → GoogleMaps/RNMGoogleMapManager.h} +3 -3
- package/ios/GoogleMaps/RNMGoogleMapManager.m +274 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.h → GoogleMaps/RNMGoogleMapMarker.h} +15 -15
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.m → GoogleMaps/RNMGoogleMapMarker.m} +22 -22
- package/ios/{AirGoogleMaps/AIRGoogleMapMarkerManager.h → GoogleMaps/RNMGoogleMapMarkerManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapMarkerManager.m → GoogleMaps/RNMGoogleMapMarkerManager.m} +20 -20
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlay.h → GoogleMaps/RNMGoogleMapOverlay.h} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlay.m → GoogleMaps/RNMGoogleMapOverlay.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlayManager.h → GoogleMaps/RNMGoogleMapOverlayManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapOverlayManager.m → GoogleMaps/RNMGoogleMapOverlayManager.m} +6 -6
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygon.h → GoogleMaps/RNMGoogleMapPolygon.h} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygon.m → GoogleMaps/RNMGoogleMapPolygon.m} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapPolylineManager.h → GoogleMaps/RNMGoogleMapPolygonManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygonManager.m → GoogleMaps/RNMGoogleMapPolygonManager.m} +10 -10
- package/ios/{AirGoogleMaps/AIRGoogleMapPolyline.h → GoogleMaps/RNMGoogleMapPolyline.h} +7 -7
- package/ios/{AirGoogleMaps/AIRGoogleMapPolyline.m → GoogleMaps/RNMGoogleMapPolyline.m} +9 -9
- package/ios/{AirGoogleMaps/AIRGoogleMapPolygonManager.h → GoogleMaps/RNMGoogleMapPolylineManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapPolylineManager.m → GoogleMaps/RNMGoogleMapPolylineManager.m} +9 -9
- package/ios/{AirGoogleMaps/AIRGoogleMapUrlTile.h → GoogleMaps/RNMGoogleMapUrlTile.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapUrlTile.m → GoogleMaps/RNMGoogleMapUrlTile.m} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapUrlTileManager.h → GoogleMaps/RNMGoogleMapUrlTileManager.h} +2 -2
- package/ios/{AirGoogleMaps/AIRGoogleMapURLTileManager.m → GoogleMaps/RNMGoogleMapUrlTileManager.m} +7 -7
- package/ios/GoogleMaps/RNMGoogleMapViewModule.h +5 -0
- package/ios/GoogleMaps/RNMGoogleMapViewModule.m +380 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTile.h → GoogleMaps/RNMGoogleMapWMSTile.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTile.m → GoogleMaps/RNMGoogleMapWMSTile.m} +4 -4
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTileManager.h → GoogleMaps/RNMGoogleMapWMSTileManager.h} +3 -3
- package/ios/{AirGoogleMaps/AIRGoogleMapWMSTileManager.m → GoogleMaps/RNMGoogleMapWMSTileManager.m} +8 -8
- package/ios/{AirMaps → Maps}/Callout/SMCalloutView.h +4 -4
- package/ios/{AirMaps/RCTConvert+AirMap.h → Maps/RCTConvert+RNMMap.h} +1 -1
- package/ios/{AirMaps/RCTConvert+AirMap.m → Maps/RCTConvert+RNMMap.m} +8 -8
- package/ios/{AirMaps/AIRMap.h → Maps/RNMMap.h} +8 -8
- package/ios/{AirMaps/AIRMap.m → Maps/RNMMap.m} +56 -56
- package/ios/{AirMaps/AIRMapCallout.h → Maps/RNMMapCallout.h} +1 -1
- package/ios/{AirMaps/AIRMapCallout.m → Maps/RNMMapCallout.m} +2 -2
- package/ios/{AirMaps/AIRMapCircleManager.h → Maps/RNMMapCalloutManager.h} +2 -2
- package/ios/{AirMaps/AIRMapCalloutManager.m → Maps/RNMMapCalloutManager.m} +7 -7
- package/ios/{AirMaps/AIRMapCalloutSubview.h → Maps/RNMMapCalloutSubview.h} +3 -3
- package/ios/{AirMaps/AIRMapCalloutSubview.m → Maps/RNMMapCalloutSubview.m} +4 -4
- package/ios/Maps/RNMMapCalloutSubviewManager.h +14 -0
- package/ios/Maps/RNMMapCalloutSubviewManager.m +24 -0
- package/ios/{AirMaps/AIRMapCircle.h → Maps/RNMMapCircle.h} +5 -5
- package/ios/{AirMaps/AIRMapCircle.m → Maps/RNMMapCircle.m} +3 -3
- package/ios/{AirMaps/AIRMapCalloutManager.h → Maps/RNMMapCircleManager.h} +2 -2
- package/ios/{AirMaps/AIRMapCircleManager.m → Maps/RNMMapCircleManager.m} +7 -7
- package/ios/{AirMaps/AIRMapCoordinate.h → Maps/RNMMapCoordinate.h} +2 -2
- package/ios/{AirMaps/AIRMapCoordinate.m → Maps/RNMMapCoordinate.m} +3 -3
- package/ios/{AirMaps/AIRMapLocalTile.h → Maps/RNMMapLocalTile.h} +7 -7
- package/ios/{AirMaps/AIRMapLocalTile.m → Maps/RNMMapLocalTile.m} +6 -6
- package/ios/{AirMaps/AIRMapLocalTileManager.h → Maps/RNMMapLocalTileManager.h} +3 -3
- package/ios/{AirMaps/AIRMapLocalTileManager.m → Maps/RNMMapLocalTileManager.m} +9 -9
- package/ios/{AirMaps/AIRMapLocalTileOverlay.h → Maps/RNMMapLocalTileOverlay.h} +2 -2
- package/ios/{AirMaps/AIRMapLocalTileOverlay.m → Maps/RNMMapLocalTileOverlay.m} +5 -5
- package/ios/{AirMaps/AIRMapManager.h → Maps/RNMMapManager.h} +6 -6
- package/ios/Maps/RNMMapManager.m +857 -0
- package/ios/{AirMaps/AIRMapMarker.h → Maps/RNMMapMarker.h} +8 -8
- package/ios/{AirMaps/AIRMapMarker.m → Maps/RNMMapMarker.m} +13 -13
- package/ios/{AirMaps/AIRMapMarkerManager.h → Maps/RNMMapMarkerManager.h} +1 -1
- package/ios/{AirMaps/AIRMapMarkerManager.m → Maps/RNMMapMarkerManager.m} +14 -14
- package/ios/{AirMaps/AIRMapOverlay.h → Maps/RNMMapOverlay.h} +7 -7
- package/ios/{AirMaps/AIRMapOverlay.m → Maps/RNMMapOverlay.m} +4 -4
- package/ios/Maps/RNMMapOverlayManager.h +5 -0
- package/ios/{AirMaps/AIRMapOverlayManager.m → Maps/RNMMapOverlayManager.m} +6 -6
- package/ios/{AirMaps/AIRMapOverlayRenderer.h → Maps/RNMMapOverlayRenderer.h} +1 -1
- package/ios/{AirMaps/AIRMapOverlayRenderer.m → Maps/RNMMapOverlayRenderer.m} +5 -5
- package/ios/{AirMaps/AIRMapPolygon.h → Maps/RNMMapPolygon.h} +7 -7
- package/ios/{AirMaps/AIRMapPolygon.m → Maps/RNMMapPolygon.m} +4 -4
- package/ios/{AirMaps/AIRMapPolygonManager.h → Maps/RNMMapPolygonManager.h} +2 -2
- package/ios/{AirMaps/AIRMapPolygonManager.m → Maps/RNMMapPolygonManager.m} +10 -10
- package/ios/{AirMaps/AIRMapPolyline.h → Maps/RNMMapPolyline.h} +6 -6
- package/ios/{AirMaps/AIRMapPolyline.m → Maps/RNMMapPolyline.m} +11 -11
- package/ios/{AirMaps/AIRMapPolylineManager.h → Maps/RNMMapPolylineManager.h} +2 -2
- package/ios/{AirMaps/AIRMapPolylineManager.m → Maps/RNMMapPolylineManager.m} +9 -9
- package/ios/{AirMaps/AIRMapPolylineRenderer.h → Maps/RNMMapPolylineRenderer.h} +2 -2
- package/ios/{AirMaps/AIRMapPolylineRenderer.m → Maps/RNMMapPolylineRenderer.m} +10 -10
- package/ios/{AirMaps/AIRMapSnapshot.h → Maps/RNMMapSnapshot.h} +6 -6
- package/ios/{AirMaps/AIRMapUrlTile.h → Maps/RNMMapUrlTile.h} +18 -18
- package/ios/{AirMaps/AIRMapUrlTile.m → Maps/RNMMapUrlTile.m} +7 -7
- package/ios/{AirMaps/AIRMapUrlTileCachedOverlay.h → Maps/RNMMapUrlTileCachedOverlay.h} +3 -3
- package/ios/{AirMaps/AIRMapUrlTileCachedOverlay.m → Maps/RNMMapUrlTileCachedOverlay.m} +10 -10
- package/ios/{AirMaps/AIRMapUrlTileManager.h → Maps/RNMMapUrlTileManager.h} +3 -3
- package/ios/{AirMaps/AIRMapUrlTileManager.m → Maps/RNMMapUrlTileManager.m} +9 -9
- package/ios/Maps/RNMMapViewModule.h +5 -0
- package/ios/Maps/RNMMapViewModule.m +459 -0
- package/ios/{AirMaps/AIRMapWMSTile.h → Maps/RNMMapWMSTile.h} +11 -11
- package/ios/{AirMaps/AIRMapWMSTile.m → Maps/RNMMapWMSTile.m} +15 -15
- package/ios/{AirMaps/AIRMapWMSTileManager.h → Maps/RNMMapWMSTileManager.h} +3 -3
- package/ios/{AirMaps/AIRMapWMSTileManager.m → Maps/RNMMapWMSTileManager.m} +9 -9
- package/ios/RNMaps.xcodeproj/project.pbxproj +647 -0
- package/lib/MapCallout.js +2 -2
- package/lib/MapCalloutSubview.js +2 -2
- package/lib/MapCircle.js +2 -2
- package/lib/MapHeatmap.js +2 -2
- package/lib/MapLocalTile.js +2 -2
- package/lib/MapMarker.js +2 -2
- package/lib/MapOverlay.js +2 -2
- package/lib/MapPolygon.js +2 -2
- package/lib/MapPolyline.js +2 -2
- package/lib/MapUrlTile.js +2 -2
- package/lib/MapView.d.ts +7 -8
- package/lib/MapView.js +89 -97
- package/lib/MapView.types.d.ts +8 -2
- package/lib/MapViewNativeComponent.d.ts +2 -7
- package/lib/MapViewNativeComponent.js +0 -5
- package/lib/MapWMSTile.js +2 -2
- package/lib/NativeGoogleMapViewModule.d.ts +25 -0
- package/lib/NativeGoogleMapViewModule.js +4 -0
- package/lib/NativeMapViewModule.d.ts +29 -0
- package/lib/NativeMapViewModule.js +4 -0
- package/lib/decorateMapComponent.d.ts +1 -1
- package/lib/decorateMapComponent.js +3 -3
- package/package.json +1 -1
- package/react-native-google-maps.podspec +1 -1
- package/react-native-maps.podspec +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +0 -380
- package/ios/AirGoogleMaps/AIRGoogleMapCalloutSubviewManager.m +0 -28
- package/ios/AirGoogleMaps/AIRGoogleMapHeatmapManager.h +0 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -597
- package/ios/AirMaps/AIRMapCalloutSubviewManager.h +0 -14
- package/ios/AirMaps/AIRMapCalloutSubviewManager.m +0 -24
- package/ios/AirMaps/AIRMapManager.m +0 -1253
- package/ios/AirMaps/AIRMapOverlayManager.h +0 -5
- package/ios/AirMaps/AIRWeakMapReference.h +0 -24
- package/ios/AirMaps/AIRWeakMapReference.m +0 -23
- package/ios/AirMaps/AIRWeakTimerReference.h +0 -21
- package/ios/AirMaps/AIRWeakTimerReference.m +0 -42
- package/ios/AirMaps.xcodeproj/project.pbxproj +0 -587
- /package/ios/{AirGoogleMaps → GoogleMaps}/RCTConvert+GMSMapViewType.h +0 -0
- /package/ios/{AirGoogleMaps → GoogleMaps}/RCTConvert+GMSMapViewType.m +0 -0
- /package/ios/{AirMaps → Maps}/Callout/SMCalloutView.m +0 -0
package/lib/MapCallout.js
CHANGED
|
@@ -33,8 +33,8 @@ class MapCallout extends React.Component {
|
|
|
33
33
|
getUIManagerCommand;
|
|
34
34
|
render() {
|
|
35
35
|
const { tooltip = false, alphaHitTest = false } = this.props;
|
|
36
|
-
const
|
|
37
|
-
return (<
|
|
36
|
+
const RNMMapCallout = this.getNativeComponent();
|
|
37
|
+
return (<RNMMapCallout {...this.props} tooltip={tooltip} alphaHitTest={alphaHitTest} style={[styles.callout, this.props.style]}/>);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
exports.MapCallout = MapCallout;
|
package/lib/MapCalloutSubview.js
CHANGED
|
@@ -32,8 +32,8 @@ class MapCalloutSubview extends React.Component {
|
|
|
32
32
|
getMapManagerCommand;
|
|
33
33
|
getUIManagerCommand;
|
|
34
34
|
render() {
|
|
35
|
-
const
|
|
36
|
-
return (<
|
|
35
|
+
const RNMMapCalloutSubview = this.getNativeComponent();
|
|
36
|
+
return (<RNMMapCalloutSubview {...this.props} style={[styles.calloutSubview, this.props.style]}/>);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.MapCalloutSubview = MapCalloutSubview;
|
package/lib/MapCircle.js
CHANGED
|
@@ -40,8 +40,8 @@ class MapCircle extends React.Component {
|
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
42
|
const { strokeColor = '#000', strokeWidth = 1 } = this.props;
|
|
43
|
-
const
|
|
44
|
-
return (<
|
|
43
|
+
const RNMMapCircle = this.getNativeComponent();
|
|
44
|
+
return (<RNMMapCircle {...this.props} strokeColor={strokeColor} strokeWidth={strokeWidth} ref={this.circle}/>);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.MapCircle = MapCircle;
|
package/lib/MapHeatmap.js
CHANGED
|
@@ -40,14 +40,14 @@ class MapHeatmap extends React.Component {
|
|
|
40
40
|
this.heatmap.current?.setNativeProps(props);
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
|
-
const
|
|
43
|
+
const RNMMapHeatmap = this.getNativeComponent();
|
|
44
44
|
const propGradient = this.props.gradient;
|
|
45
45
|
let gradient;
|
|
46
46
|
if (propGradient) {
|
|
47
47
|
const colors = propGradient.colors.map(c => (0, react_native_1.processColor)(c));
|
|
48
48
|
gradient = { ...propGradient, colors };
|
|
49
49
|
}
|
|
50
|
-
return (<
|
|
50
|
+
return (<RNMMapHeatmap {...this.props} gradient={gradient} ref={this.heatmap}/>);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
exports.MapHeatmap = MapHeatmap;
|
package/lib/MapLocalTile.js
CHANGED
|
@@ -31,8 +31,8 @@ class MapLocalTile extends React.Component {
|
|
|
31
31
|
getMapManagerCommand;
|
|
32
32
|
getUIManagerCommand;
|
|
33
33
|
render() {
|
|
34
|
-
const
|
|
35
|
-
return <
|
|
34
|
+
const RNMMapLocalTile = this.getNativeComponent();
|
|
35
|
+
return <RNMMapLocalTile {...this.props}/>;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.MapLocalTile = MapLocalTile;
|
package/lib/MapMarker.js
CHANGED
|
@@ -87,8 +87,8 @@ class MapMarker extends React.Component {
|
|
|
87
87
|
icon = react_native_1.Image.resolveAssetSource(this.props.icon) || {};
|
|
88
88
|
icon = icon.uri;
|
|
89
89
|
}
|
|
90
|
-
const
|
|
91
|
-
return (<
|
|
90
|
+
const RNMMapMarker = this.getNativeComponent();
|
|
91
|
+
return (<RNMMapMarker {...this.props} ref={this.marker} image={image} icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
|
|
92
92
|
if (stopPropagation) {
|
|
93
93
|
event.stopPropagation();
|
|
94
94
|
}
|
package/lib/MapOverlay.js
CHANGED
|
@@ -42,8 +42,8 @@ class MapOverlay extends React.Component {
|
|
|
42
42
|
const sourceAsset = react_native_1.Image.resolveAssetSource(this.props.image) || {};
|
|
43
43
|
image = sourceAsset.uri;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
46
|
-
return (<
|
|
45
|
+
const RNMMapOverlay = this.getNativeComponent();
|
|
46
|
+
return (<RNMMapOverlay {...this.props} opacity={opacity} image={image} style={[styles.overlay, this.props.style]}/>);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
exports.MapOverlay = MapOverlay;
|
package/lib/MapPolygon.js
CHANGED
|
@@ -40,8 +40,8 @@ class MapPolygon extends React.Component {
|
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
42
|
const { strokeColor = '#000', strokeWidth = 1 } = this.props;
|
|
43
|
-
const
|
|
44
|
-
return (<
|
|
43
|
+
const RNMMapPolygon = this.getNativeComponent();
|
|
44
|
+
return (<RNMMapPolygon {...this.props} strokeColor={strokeColor} strokeWidth={strokeWidth} ref={this.polygon}/>);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.MapPolygon = MapPolygon;
|
package/lib/MapPolyline.js
CHANGED
|
@@ -40,8 +40,8 @@ class MapPolyline extends React.Component {
|
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
42
|
const { strokeColor = '#000', strokeWidth = 1, lineJoin = 'round', lineCap = 'round', } = this.props;
|
|
43
|
-
const
|
|
44
|
-
return (<
|
|
43
|
+
const RNMMapPolyline = this.getNativeComponent();
|
|
44
|
+
return (<RNMMapPolyline {...this.props} strokeColor={strokeColor} strokeWidth={strokeWidth} lineJoin={lineJoin} lineCap={lineCap} ref={this.polyline}/>);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.MapPolyline = MapPolyline;
|
package/lib/MapUrlTile.js
CHANGED
|
@@ -31,8 +31,8 @@ class MapUrlTile extends React.Component {
|
|
|
31
31
|
getMapManagerCommand;
|
|
32
32
|
getUIManagerCommand;
|
|
33
33
|
render() {
|
|
34
|
-
const
|
|
35
|
-
return <
|
|
34
|
+
const RNMMapUrlTile = this.getNativeComponent();
|
|
35
|
+
return <RNMMapUrlTile {...this.props}/>;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.MapUrlTile = MapUrlTile;
|
package/lib/MapView.d.ts
CHANGED
|
@@ -581,11 +581,11 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
581
581
|
private _onChange;
|
|
582
582
|
getCamera(): Promise<Camera>;
|
|
583
583
|
setCamera(camera: Partial<Camera>): void;
|
|
584
|
-
animateCamera(camera: Partial<Camera>, duration?: number): void
|
|
585
|
-
animateToRegion(region: Region, duration?: number): void
|
|
586
|
-
fitToElements(options?: FitToOptions): void
|
|
587
|
-
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): void
|
|
588
|
-
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): void
|
|
584
|
+
animateCamera(camera: Partial<Camera>, duration?: number): Promise<void>;
|
|
585
|
+
animateToRegion(region: Region, duration?: number): Promise<void>;
|
|
586
|
+
fitToElements(options?: FitToOptions): Promise<void>;
|
|
587
|
+
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): Promise<void>;
|
|
588
|
+
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): Promise<void>;
|
|
589
589
|
/**
|
|
590
590
|
* Get visible boudaries
|
|
591
591
|
*
|
|
@@ -660,10 +660,9 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
660
660
|
* @return Object Object bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
661
661
|
*/
|
|
662
662
|
boundingBoxForRegion(region: Region): BoundingBox;
|
|
663
|
-
private _mapManagerCommand;
|
|
664
663
|
private _getHandle;
|
|
665
|
-
private
|
|
664
|
+
private _gogleMapsOniOS;
|
|
666
665
|
render(): JSX.Element;
|
|
667
666
|
}
|
|
668
|
-
export declare const enableLatestRenderer: () =>
|
|
667
|
+
export declare const enableLatestRenderer: () => Promise<string> | undefined;
|
|
669
668
|
export default MapView;
|
package/lib/MapView.js
CHANGED
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.enableLatestRenderer = exports.MAP_TYPES = void 0;
|
|
27
30
|
const React = __importStar(require("react"));
|
|
@@ -29,6 +32,8 @@ const react_native_1 = require("react-native");
|
|
|
29
32
|
const decorateMapComponent_1 = require("./decorateMapComponent");
|
|
30
33
|
const ProviderConstants = __importStar(require("./ProviderConstants"));
|
|
31
34
|
const MapViewNativeComponent_1 = require("./MapViewNativeComponent");
|
|
35
|
+
const NativeMapViewModule_1 = __importDefault(require("./NativeMapViewModule"));
|
|
36
|
+
const NativeGoogleMapViewModule_1 = __importDefault(require("./NativeGoogleMapViewModule"));
|
|
32
37
|
exports.MAP_TYPES = {
|
|
33
38
|
STANDARD: 'standard',
|
|
34
39
|
SATELLITE: 'satellite',
|
|
@@ -79,13 +84,10 @@ class MapView extends React.Component {
|
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
getCamera() {
|
|
82
|
-
if (
|
|
83
|
-
return
|
|
84
|
-
}
|
|
85
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
86
|
-
return this._runCommand('getCamera', []);
|
|
87
|
+
if (this._gogleMapsOniOS()) {
|
|
88
|
+
return googleMapViewModuleMethod('getCamera')(this._getHandle());
|
|
87
89
|
}
|
|
88
|
-
return
|
|
90
|
+
return mapViewModuleMethod('getCamera')(this._getHandle());
|
|
89
91
|
}
|
|
90
92
|
setCamera(camera) {
|
|
91
93
|
if (this.map.current) {
|
|
@@ -93,32 +95,37 @@ class MapView extends React.Component {
|
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
97
|
animateCamera(camera, duration = 500) {
|
|
96
|
-
if (this.
|
|
97
|
-
|
|
98
|
+
if (this._gogleMapsOniOS()) {
|
|
99
|
+
return googleMapViewModuleMethod('animateCamera')(this._getHandle(), camera, duration);
|
|
98
100
|
}
|
|
101
|
+
return mapViewModuleMethod('animateCamera')(this._getHandle(), camera, duration);
|
|
99
102
|
}
|
|
100
103
|
animateToRegion(region, duration = 500) {
|
|
101
|
-
if (this.
|
|
102
|
-
|
|
104
|
+
if (this._gogleMapsOniOS()) {
|
|
105
|
+
return googleMapViewModuleMethod('animateToRegion')(this._getHandle(), region, duration);
|
|
103
106
|
}
|
|
107
|
+
return mapViewModuleMethod('animateToRegion')(this._getHandle(), region, duration);
|
|
104
108
|
}
|
|
105
109
|
fitToElements(options = {}) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
111
|
+
if (this._gogleMapsOniOS()) {
|
|
112
|
+
return googleMapViewModuleMethod('fitToElements')(this._getHandle(), edgePadding, duration);
|
|
109
113
|
}
|
|
114
|
+
return mapViewModuleMethod('fitToElements')(this._getHandle(), edgePadding, duration);
|
|
110
115
|
}
|
|
111
116
|
fitToSuppliedMarkers(markers, options = {}) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
118
|
+
if (this._gogleMapsOniOS()) {
|
|
119
|
+
return googleMapViewModuleMethod('fitToSuppliedMarkers')(this._getHandle(), markers, edgePadding, duration);
|
|
115
120
|
}
|
|
121
|
+
return mapViewModuleMethod('fitToSuppliedMarkers')(this._getHandle(), markers, edgePadding, duration);
|
|
116
122
|
}
|
|
117
123
|
fitToCoordinates(coordinates = [], options = {}) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
125
|
+
if (this._gogleMapsOniOS()) {
|
|
126
|
+
return googleMapViewModuleMethod('fitToCoordinates')(this._getHandle(), coordinates, edgePadding, duration);
|
|
121
127
|
}
|
|
128
|
+
return mapViewModuleMethod('fitToCoordinates')(this._getHandle(), coordinates, edgePadding, duration);
|
|
122
129
|
}
|
|
123
130
|
/**
|
|
124
131
|
* Get visible boudaries
|
|
@@ -126,13 +133,10 @@ class MapView extends React.Component {
|
|
|
126
133
|
* @return Promise Promise with the bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
127
134
|
*/
|
|
128
135
|
async getMapBoundaries() {
|
|
129
|
-
if (
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
133
|
-
return await this._runCommand('getMapBoundaries', []);
|
|
136
|
+
if (this._gogleMapsOniOS()) {
|
|
137
|
+
return googleMapViewModuleMethod('getMapBoundaries')(this._getHandle());
|
|
134
138
|
}
|
|
135
|
-
return
|
|
139
|
+
return mapViewModuleMethod('getMapBoundaries')(this._getHandle());
|
|
136
140
|
}
|
|
137
141
|
setMapBoundaries(northEast, southWest) {
|
|
138
142
|
if (this.map.current) {
|
|
@@ -163,7 +167,7 @@ class MapView extends React.Component {
|
|
|
163
167
|
const config = {
|
|
164
168
|
width: args.width || 0,
|
|
165
169
|
height: args.height || 0,
|
|
166
|
-
region: args.region
|
|
170
|
+
region: args.region,
|
|
167
171
|
format: args.format || 'png',
|
|
168
172
|
quality: args.quality || 1.0,
|
|
169
173
|
result: args.result || 'file',
|
|
@@ -174,31 +178,10 @@ class MapView extends React.Component {
|
|
|
174
178
|
if (config.result !== 'file' && config.result !== 'base64') {
|
|
175
179
|
throw new Error('Invalid result specified');
|
|
176
180
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return react_native_1.NativeModules.AirMapModule.takeSnapshot(this._getHandle(), config);
|
|
180
|
-
}
|
|
181
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
182
|
-
return new Promise((resolve, reject) => {
|
|
183
|
-
this._runCommand('takeSnapshot', [
|
|
184
|
-
config.width,
|
|
185
|
-
config.height,
|
|
186
|
-
config.region,
|
|
187
|
-
config.format,
|
|
188
|
-
config.quality,
|
|
189
|
-
config.result,
|
|
190
|
-
(err, snapshot) => {
|
|
191
|
-
if (err) {
|
|
192
|
-
reject(err);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
resolve(snapshot);
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
]);
|
|
199
|
-
});
|
|
181
|
+
if (this._gogleMapsOniOS()) {
|
|
182
|
+
return googleMapViewModuleMethod('takeSnapshot')(this._getHandle(), config);
|
|
200
183
|
}
|
|
201
|
-
return
|
|
184
|
+
return mapViewModuleMethod('takeSnapshot')(this._getHandle(), config);
|
|
202
185
|
}
|
|
203
186
|
/**
|
|
204
187
|
* Convert a coordinate to address by using default Geocoder
|
|
@@ -210,13 +193,10 @@ class MapView extends React.Component {
|
|
|
210
193
|
* @return Promise with return type Address
|
|
211
194
|
*/
|
|
212
195
|
addressForCoordinate(coordinate) {
|
|
213
|
-
if (
|
|
214
|
-
|
|
196
|
+
if (this._gogleMapsOniOS()) {
|
|
197
|
+
throw new Error('addressForCoordinate not supported on Google Maps iOS');
|
|
215
198
|
}
|
|
216
|
-
|
|
217
|
-
return this._runCommand('getAddressFromCoordinates', [coordinate]);
|
|
218
|
-
}
|
|
219
|
-
return Promise.reject('getAddress not supported on this platform');
|
|
199
|
+
return mapViewModuleMethod('getAddressFromCoordinates')(this._getHandle(), coordinate);
|
|
220
200
|
}
|
|
221
201
|
/**
|
|
222
202
|
* Convert a map coordinate to user-space point
|
|
@@ -228,13 +208,10 @@ class MapView extends React.Component {
|
|
|
228
208
|
* @return Promise Promise with the point ({ x: Number, y: Number })
|
|
229
209
|
*/
|
|
230
210
|
pointForCoordinate(coordinate) {
|
|
231
|
-
if (
|
|
232
|
-
return
|
|
233
|
-
}
|
|
234
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
235
|
-
return this._runCommand('pointForCoordinate', [coordinate]);
|
|
211
|
+
if (this._gogleMapsOniOS()) {
|
|
212
|
+
return googleMapViewModuleMethod('pointForCoordinate')(this._getHandle(), coordinate);
|
|
236
213
|
}
|
|
237
|
-
return
|
|
214
|
+
return mapViewModuleMethod('pointForCoordinate')(this._getHandle(), coordinate);
|
|
238
215
|
}
|
|
239
216
|
/**
|
|
240
217
|
* Convert a user-space point to a map coordinate
|
|
@@ -246,13 +223,10 @@ class MapView extends React.Component {
|
|
|
246
223
|
* @return Promise Promise with the coordinate ({ latitude: Number, longitude: Number })
|
|
247
224
|
*/
|
|
248
225
|
coordinateForPoint(point) {
|
|
249
|
-
if (
|
|
250
|
-
return
|
|
251
|
-
}
|
|
252
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
253
|
-
return this._runCommand('coordinateForPoint', [point]);
|
|
226
|
+
if (this._gogleMapsOniOS()) {
|
|
227
|
+
return googleMapViewModuleMethod('coordinateForPoint')(this._getHandle(), point);
|
|
254
228
|
}
|
|
255
|
-
return
|
|
229
|
+
return mapViewModuleMethod('coordinateForPoint')(this._getHandle(), point);
|
|
256
230
|
}
|
|
257
231
|
/**
|
|
258
232
|
* Get markers' centers and frames in user-space coordinates
|
|
@@ -262,10 +236,13 @@ class MapView extends React.Component {
|
|
|
262
236
|
* @return Promise Promise with { <identifier>: { point: Point, frame: Frame } }
|
|
263
237
|
*/
|
|
264
238
|
getMarkersFrames(onlyVisible = false) {
|
|
265
|
-
if (react_native_1.Platform.OS
|
|
266
|
-
|
|
239
|
+
if (react_native_1.Platform.OS !== 'ios') {
|
|
240
|
+
throw new Error('getMarkersFrames only supported on iOS');
|
|
267
241
|
}
|
|
268
|
-
|
|
242
|
+
if (this._gogleMapsOniOS()) {
|
|
243
|
+
return googleMapViewModuleMethod('getMarkersFrames')(this._getHandle(), onlyVisible);
|
|
244
|
+
}
|
|
245
|
+
return mapViewModuleMethod('getMarkersFrames')(this._getHandle(), onlyVisible);
|
|
269
246
|
}
|
|
270
247
|
/**
|
|
271
248
|
* Get bounding box from region
|
|
@@ -286,19 +263,15 @@ class MapView extends React.Component {
|
|
|
286
263
|
},
|
|
287
264
|
};
|
|
288
265
|
}
|
|
289
|
-
_mapManagerCommand(name) {
|
|
290
|
-
return react_native_1.NativeModules[`${(0, decorateMapComponent_1.getNativeMapName)(this.props.provider)}Manager`][name];
|
|
291
|
-
}
|
|
292
266
|
_getHandle() {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
if (react_native_1.Platform.OS === 'ios') {
|
|
297
|
-
return this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
return Promise.reject(`Invalid platform was passed: ${react_native_1.Platform.OS}`);
|
|
267
|
+
const handle = (0, react_native_1.findNodeHandle)(this.map.current);
|
|
268
|
+
if (!handle) {
|
|
269
|
+
throw new Error('Cannot find node handle');
|
|
301
270
|
}
|
|
271
|
+
return handle;
|
|
272
|
+
}
|
|
273
|
+
_gogleMapsOniOS() {
|
|
274
|
+
return react_native_1.Platform.OS === 'ios' && this.props.provider === 'google';
|
|
302
275
|
}
|
|
303
276
|
render() {
|
|
304
277
|
let props;
|
|
@@ -341,36 +314,55 @@ class MapView extends React.Component {
|
|
|
341
314
|
}
|
|
342
315
|
if (react_native_1.Platform.OS === 'android' && this.props.liteMode) {
|
|
343
316
|
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
344
|
-
<
|
|
317
|
+
<RNMMapLite {...props}/>
|
|
345
318
|
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
346
319
|
}
|
|
347
|
-
const
|
|
320
|
+
const RNMMap = getNativeMapComponent(this.props.provider);
|
|
348
321
|
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
349
|
-
<
|
|
322
|
+
<RNMMap {...props}/>
|
|
350
323
|
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
351
324
|
}
|
|
352
325
|
}
|
|
353
|
-
const
|
|
354
|
-
default: (0, react_native_1.requireNativeComponent)('
|
|
326
|
+
const rnmMaps = {
|
|
327
|
+
default: (0, react_native_1.requireNativeComponent)('RNMMap'),
|
|
355
328
|
google: () => null,
|
|
356
329
|
};
|
|
357
330
|
if (react_native_1.Platform.OS === 'android') {
|
|
358
|
-
|
|
331
|
+
rnmMaps.google = rnmMaps.default;
|
|
359
332
|
}
|
|
360
333
|
else {
|
|
361
|
-
|
|
362
|
-
? (0, react_native_1.requireNativeComponent)('
|
|
363
|
-
: (0, decorateMapComponent_1.createNotSupportedComponent)('react-native-maps:
|
|
334
|
+
rnmMaps.google = decorateMapComponent_1.googleMapIsInstalled
|
|
335
|
+
? (0, react_native_1.requireNativeComponent)('RNMGoogleMap')
|
|
336
|
+
: (0, decorateMapComponent_1.createNotSupportedComponent)('react-native-maps: RNMGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS.');
|
|
364
337
|
}
|
|
365
|
-
const getNativeMapComponent = (provider) =>
|
|
366
|
-
const
|
|
367
|
-
? (0, react_native_1.requireNativeComponent)('
|
|
338
|
+
const getNativeMapComponent = (provider) => rnmMaps[provider || 'default'];
|
|
339
|
+
const RNMMapLite = react_native_1.UIManager.getViewManagerConfig('RNMMapLite')
|
|
340
|
+
? (0, react_native_1.requireNativeComponent)('RNMMapLite')
|
|
368
341
|
: () => null;
|
|
369
342
|
const enableLatestRenderer = () => {
|
|
370
|
-
if (react_native_1.Platform.OS
|
|
371
|
-
return;
|
|
343
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
344
|
+
return mapViewModuleMethod('enableLatestRenderer')();
|
|
372
345
|
}
|
|
373
|
-
return react_native_1.NativeModules.AirMapModule.enableLatestRenderer();
|
|
374
346
|
};
|
|
375
347
|
exports.enableLatestRenderer = enableLatestRenderer;
|
|
348
|
+
function mapViewModuleMethod(name) {
|
|
349
|
+
if (!NativeMapViewModule_1.default) {
|
|
350
|
+
throw new Error('MapViewModule is null');
|
|
351
|
+
}
|
|
352
|
+
const method = NativeMapViewModule_1.default[name];
|
|
353
|
+
if (!method) {
|
|
354
|
+
throw new Error(`Method ${name} is not defined`);
|
|
355
|
+
}
|
|
356
|
+
return NativeMapViewModule_1.default[name];
|
|
357
|
+
}
|
|
358
|
+
function googleMapViewModuleMethod(name) {
|
|
359
|
+
if (!NativeGoogleMapViewModule_1.default) {
|
|
360
|
+
throw new Error('GoogleMapViewModule is null');
|
|
361
|
+
}
|
|
362
|
+
const method = NativeGoogleMapViewModule_1.default[name];
|
|
363
|
+
if (!method) {
|
|
364
|
+
throw new Error(`Method ${name} is not defined`);
|
|
365
|
+
}
|
|
366
|
+
return NativeGoogleMapViewModule_1.default[name];
|
|
367
|
+
}
|
|
376
368
|
exports.default = MapView;
|
package/lib/MapView.types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClickEvent, LatLng, Point, Region } from './sharedTypes';
|
|
1
|
+
import { ClickEvent, Frame, LatLng, Point, Region } from './sharedTypes';
|
|
2
2
|
import { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
export type Camera = {
|
|
4
4
|
/**
|
|
@@ -119,7 +119,7 @@ export type ChangeEvent = NativeSyntheticEvent<{
|
|
|
119
119
|
}>;
|
|
120
120
|
export type FitToOptions = {
|
|
121
121
|
edgePadding?: EdgePadding;
|
|
122
|
-
|
|
122
|
+
duration?: number;
|
|
123
123
|
};
|
|
124
124
|
export type BoundingBox = {
|
|
125
125
|
northEast: LatLng;
|
|
@@ -150,4 +150,10 @@ export type Address = {
|
|
|
150
150
|
subLocality: string;
|
|
151
151
|
thoroughfare: string;
|
|
152
152
|
};
|
|
153
|
+
export interface MarkersFrames {
|
|
154
|
+
[key: string]: {
|
|
155
|
+
point: Point;
|
|
156
|
+
frame: Frame;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
153
159
|
export type NativeCommandName = 'animateCamera' | 'animateToRegion' | 'coordinateForPoint' | 'fitToCoordinates' | 'fitToElements' | 'fitToSuppliedMarkers' | 'getAddressFromCoordinates' | 'getCamera' | 'getMapBoundaries' | 'getMarkersFrames' | 'pointForCoordinate' | 'setCamera' | 'setIndoorActiveLevelIndex' | 'setMapBoundaries' | 'takeSnapshot';
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { HostComponent } from 'react-native';
|
|
3
3
|
import { NativeProps } from './MapView';
|
|
4
|
-
import { Camera
|
|
5
|
-
import { LatLng
|
|
4
|
+
import { Camera } from './MapView.types';
|
|
5
|
+
import { LatLng } from './sharedTypes';
|
|
6
6
|
export type MapViewNativeComponentType = HostComponent<NativeProps>;
|
|
7
7
|
interface NativeCommands {
|
|
8
|
-
animateToRegion: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, region: Region, duration: number) => void;
|
|
9
8
|
setCamera: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, camera: Partial<Camera>) => void;
|
|
10
|
-
animateCamera: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, camera: Partial<Camera>, duration: number) => void;
|
|
11
|
-
fitToElements: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, edgePadding: EdgePadding, animated: boolean) => void;
|
|
12
|
-
fitToSuppliedMarkers: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, markers: string[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
13
|
-
fitToCoordinates: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, coordinates: LatLng[], edgePadding: EdgePadding, animated: boolean) => void;
|
|
14
9
|
setMapBoundaries: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, northEast: LatLng, southWest: LatLng) => void;
|
|
15
10
|
setIndoorActiveLevelIndex: (viewRef: NonNullable<React.RefObject<MapViewNativeComponentType>['current']>, activeLevelIndex: number) => void;
|
|
16
11
|
}
|
|
@@ -7,12 +7,7 @@ exports.Commands = void 0;
|
|
|
7
7
|
const codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
|
|
8
8
|
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
9
9
|
supportedCommands: [
|
|
10
|
-
'animateToRegion',
|
|
11
10
|
'setCamera',
|
|
12
|
-
'animateCamera',
|
|
13
|
-
'fitToElements',
|
|
14
|
-
'fitToSuppliedMarkers',
|
|
15
|
-
'fitToCoordinates',
|
|
16
11
|
'setMapBoundaries',
|
|
17
12
|
'setIndoorActiveLevelIndex',
|
|
18
13
|
],
|
package/lib/MapWMSTile.js
CHANGED
|
@@ -31,8 +31,8 @@ class MapWMSTile extends React.Component {
|
|
|
31
31
|
getMapManagerCommand;
|
|
32
32
|
getUIManagerCommand;
|
|
33
33
|
render() {
|
|
34
|
-
const
|
|
35
|
-
return <
|
|
34
|
+
const RNMMapWMSTile = this.getNativeComponent();
|
|
35
|
+
return <RNMMapWMSTile {...this.props}/>;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
exports.MapWMSTile = MapWMSTile;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { BoundingBox, Camera, EdgePadding, MarkersFrames } from './MapView.types';
|
|
3
|
+
import { LatLng, Point, Region } from './sharedTypes';
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
animateCamera: (viewTag: number, camera: Partial<Camera>, duration: number) => Promise<void>;
|
|
6
|
+
animateToRegion: (viewTag: number, region: Region, duration: number) => Promise<void>;
|
|
7
|
+
coordinateForPoint: (viewTag: number, point: Point) => Promise<LatLng>;
|
|
8
|
+
fitToCoordinates: (viewTag: number, coordinates: LatLng[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
9
|
+
fitToElements: (viewTag: number, edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
10
|
+
fitToSuppliedMarkers: (viewTag: number, markers: string[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
11
|
+
getCamera: (viewTag: number) => Promise<Camera>;
|
|
12
|
+
getMapBoundaries: (viewTag: number) => Promise<BoundingBox>;
|
|
13
|
+
getMarkersFrames: (viewTag: number, onlyVisible: boolean) => Promise<MarkersFrames>;
|
|
14
|
+
pointForCoordinate: (viewTag: number, coordinate: LatLng) => Promise<Point>;
|
|
15
|
+
takeSnapshot: (viewTag: number, config: {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
region?: Region;
|
|
19
|
+
format: string;
|
|
20
|
+
quality: number;
|
|
21
|
+
result: string;
|
|
22
|
+
}) => Promise<string>;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: Spec | null;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { Address, BoundingBox, Camera, EdgePadding, MarkersFrames } from './MapView.types';
|
|
3
|
+
import { LatLng, Point, Region } from './sharedTypes';
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
animateCamera: (viewTag: number, camera: Partial<Camera>, duration: number) => Promise<void>;
|
|
6
|
+
animateToRegion: (viewTag: number, region: Region, duration: number) => Promise<void>;
|
|
7
|
+
coordinateForPoint: (viewTag: number, point: Point) => Promise<LatLng>;
|
|
8
|
+
/** android only */
|
|
9
|
+
enableLatestRenderer: () => Promise<string>;
|
|
10
|
+
fitToCoordinates: (viewTag: number, coordinates: LatLng[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
11
|
+
fitToElements: (viewTag: number, edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
12
|
+
fitToSuppliedMarkers: (viewTag: number, markers: string[], edgePadding: EdgePadding, duration: number) => Promise<void>;
|
|
13
|
+
getAddressFromCoordinates: (viewTag: number, coordinate: LatLng) => Promise<Address>;
|
|
14
|
+
getCamera: (viewTag: number) => Promise<Camera>;
|
|
15
|
+
getMapBoundaries: (viewTag: number) => Promise<BoundingBox>;
|
|
16
|
+
/** ios only */
|
|
17
|
+
getMarkersFrames: (viewTag: number, onlyVisible: boolean) => Promise<MarkersFrames>;
|
|
18
|
+
pointForCoordinate: (viewTag: number, coordinate: LatLng) => Promise<Point>;
|
|
19
|
+
takeSnapshot: (viewTag: number, config: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
region?: Region;
|
|
23
|
+
format: string;
|
|
24
|
+
quality: number;
|
|
25
|
+
result: string;
|
|
26
|
+
}) => Promise<string>;
|
|
27
|
+
}
|
|
28
|
+
declare const _default: Spec | null;
|
|
29
|
+
export default _default;
|
|
@@ -16,7 +16,7 @@ export declare const SUPPORTED: ImplementationStatus;
|
|
|
16
16
|
export declare const USES_DEFAULT_IMPLEMENTATION: ImplementationStatus;
|
|
17
17
|
export declare const NOT_SUPPORTED: ImplementationStatus;
|
|
18
18
|
export declare const ProviderContext: import("react").Context<Provider>;
|
|
19
|
-
export declare function getNativeMapName(provider: Provider): "
|
|
19
|
+
export declare function getNativeMapName(provider: Provider): "RNMMap" | "RNMGoogleMap";
|
|
20
20
|
export declare const createNotSupportedComponent: (message: string) => () => null;
|
|
21
21
|
export declare const googleMapIsInstalled = true;
|
|
22
22
|
export default function decorateMapComponent<Type extends Component>(Component: Type, componentName: ComponentName, providers: Providers): Type;
|
|
@@ -10,12 +10,12 @@ exports.NOT_SUPPORTED = 'NOT_SUPPORTED';
|
|
|
10
10
|
exports.ProviderContext = (0, react_1.createContext)(undefined);
|
|
11
11
|
function getNativeMapName(provider) {
|
|
12
12
|
if (react_native_1.Platform.OS === 'android') {
|
|
13
|
-
return '
|
|
13
|
+
return 'RNMMap';
|
|
14
14
|
}
|
|
15
15
|
if (provider === ProviderConstants_1.PROVIDER_GOOGLE) {
|
|
16
|
-
return '
|
|
16
|
+
return 'RNMGoogleMap';
|
|
17
17
|
}
|
|
18
|
-
return '
|
|
18
|
+
return 'RNMMap';
|
|
19
19
|
}
|
|
20
20
|
exports.getNativeMapName = getNativeMapName;
|
|
21
21
|
function getNativeComponentName(provider, component) {
|