react-native-maps 2.0.0-beta.1 → 2.0.0-beta.11
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/README.md +34 -11
- package/android/build.gradle +41 -10
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- 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 +9 -83
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +2 -2
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +10 -27
- 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 +7 -5
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +1 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +66 -157
- 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 → GoogleMaps}/RCTConvert+GMSMapViewType.m +8 -0
- 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} +90 -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 +223 -0
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.h → GoogleMaps/RNMGoogleMapMarker.h} +15 -15
- package/ios/{AirGoogleMaps/AIRGoogleMapMarker.m → GoogleMaps/RNMGoogleMapMarker.m} +23 -23
- 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 +385 -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} +25 -8
- package/ios/{AirMaps/AIRMap.h → Maps/RNMMap.h} +8 -8
- package/ios/{AirMaps/AIRMap.m → Maps/RNMMap.m} +60 -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 +830 -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 +465 -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/Geojson.d.ts +1 -1
- 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.d.ts +2 -3
- package/lib/MapMarker.js +2 -4
- package/lib/MapOverlay.d.ts +1 -2
- package/lib/MapOverlay.js +2 -4
- package/lib/MapPolygon.js +2 -2
- package/lib/MapPolyline.js +2 -2
- package/lib/MapUrlTile.js +2 -2
- package/lib/MapView.d.ts +21 -16
- package/lib/MapView.js +92 -118
- package/lib/MapView.types.d.ts +8 -3
- package/lib/MapViewNativeComponent.d.ts +0 -15
- package/lib/MapViewNativeComponent.js +0 -17
- 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/lib/index.d.ts +14 -21
- package/lib/index.js +10 -38
- package/package.json +6 -6
- package/react-native-google-maps.podspec +1 -1
- package/react-native-maps.podspec +2 -2
- 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/{AirMaps → Maps}/Callout/SMCalloutView.m +0 -0
package/lib/Geojson.d.ts
CHANGED
|
@@ -136,7 +136,7 @@ export type GeojsonProps = {
|
|
|
136
136
|
* This is the default value for all point markers in your geojson data. It can be overriden
|
|
137
137
|
* on a per point basis by adding a `trackViewChanges` property to the `properties` object on the point.
|
|
138
138
|
*
|
|
139
|
-
* @default
|
|
139
|
+
* @default false
|
|
140
140
|
* @platform iOS: Google Maps only
|
|
141
141
|
* @platform Android: Supported
|
|
142
142
|
*/
|
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.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ViewProps, ImageURISource, ImageRequireSource } from 'react-native';
|
|
3
3
|
import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
|
|
4
4
|
import { MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
|
|
5
5
|
import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
|
|
@@ -246,7 +246,7 @@ export type MapMarkerProps = ViewProps & {
|
|
|
246
246
|
* Sets whether this marker should track view changes.
|
|
247
247
|
* It's recommended to turn it off whenever it's possible to improve custom marker performance.
|
|
248
248
|
*
|
|
249
|
-
* @default
|
|
249
|
+
* @default false
|
|
250
250
|
* @platform iOS: Google Maps only
|
|
251
251
|
* @platform Android: Supported
|
|
252
252
|
*/
|
|
@@ -273,7 +273,6 @@ export declare class MapMarker extends React.Component<MapMarkerProps> {
|
|
|
273
273
|
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
274
274
|
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
275
275
|
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
276
|
-
static Animated: Animated.AnimatedComponent<typeof MapMarker>;
|
|
277
276
|
private marker;
|
|
278
277
|
constructor(props: MapMarkerProps);
|
|
279
278
|
/**
|
package/lib/MapMarker.js
CHANGED
|
@@ -32,7 +32,6 @@ class MapMarker extends React.Component {
|
|
|
32
32
|
getNativeComponent;
|
|
33
33
|
getMapManagerCommand;
|
|
34
34
|
getUIManagerCommand;
|
|
35
|
-
static Animated;
|
|
36
35
|
marker;
|
|
37
36
|
constructor(props) {
|
|
38
37
|
super(props);
|
|
@@ -88,8 +87,8 @@ class MapMarker extends React.Component {
|
|
|
88
87
|
icon = react_native_1.Image.resolveAssetSource(this.props.icon) || {};
|
|
89
88
|
icon = icon.uri;
|
|
90
89
|
}
|
|
91
|
-
const
|
|
92
|
-
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 => {
|
|
93
92
|
if (stopPropagation) {
|
|
94
93
|
event.stopPropagation();
|
|
95
94
|
}
|
|
@@ -106,7 +105,6 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
106
105
|
backgroundColor: 'transparent',
|
|
107
106
|
},
|
|
108
107
|
});
|
|
109
|
-
MapMarker.Animated = react_native_1.Animated.createAnimatedComponent(MapMarker);
|
|
110
108
|
exports.default = (0, decorateMapComponent_1.default)(MapMarker, 'Marker', {
|
|
111
109
|
google: {
|
|
112
110
|
ios: decorateMapComponent_1.SUPPORTED,
|
package/lib/MapOverlay.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ViewProps, ImageURISource, ImageRequireSource, NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
|
|
4
4
|
import { LatLng, Point } from './sharedTypes';
|
|
5
5
|
import { Modify } from './sharedTypesInternal';
|
|
@@ -59,7 +59,6 @@ export declare class MapOverlay extends React.Component<MapOverlayProps> {
|
|
|
59
59
|
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
60
60
|
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
61
61
|
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
62
|
-
static Animated: Animated.AnimatedComponent<typeof MapOverlay>;
|
|
63
62
|
render(): JSX.Element;
|
|
64
63
|
}
|
|
65
64
|
type Coordinate = [number, number];
|
package/lib/MapOverlay.js
CHANGED
|
@@ -31,7 +31,6 @@ class MapOverlay extends React.Component {
|
|
|
31
31
|
getNativeComponent;
|
|
32
32
|
getMapManagerCommand;
|
|
33
33
|
getUIManagerCommand;
|
|
34
|
-
static Animated;
|
|
35
34
|
render() {
|
|
36
35
|
const { opacity = 1.0 } = this.props;
|
|
37
36
|
let image;
|
|
@@ -43,8 +42,8 @@ class MapOverlay extends React.Component {
|
|
|
43
42
|
const sourceAsset = react_native_1.Image.resolveAssetSource(this.props.image) || {};
|
|
44
43
|
image = sourceAsset.uri;
|
|
45
44
|
}
|
|
46
|
-
const
|
|
47
|
-
return (<
|
|
45
|
+
const RNMMapOverlay = this.getNativeComponent();
|
|
46
|
+
return (<RNMMapOverlay {...this.props} opacity={opacity} image={image} style={[styles.overlay, this.props.style]}/>);
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
exports.MapOverlay = MapOverlay;
|
|
@@ -54,7 +53,6 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
54
53
|
backgroundColor: 'transparent',
|
|
55
54
|
},
|
|
56
55
|
});
|
|
57
|
-
MapOverlay.Animated = react_native_1.Animated.createAnimatedComponent(MapOverlay);
|
|
58
56
|
exports.default = (0, decorateMapComponent_1.default)(MapOverlay, 'Overlay', {
|
|
59
57
|
google: {
|
|
60
58
|
ios: decorateMapComponent_1.SUPPORTED,
|
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
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
3
3
|
import { CalloutPressEvent, ClickEvent, Frame, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point, Provider, Region } from './sharedTypes';
|
|
4
4
|
import { Address, BoundingBox, Camera, ChangeEvent, Details, EdgePadding, FitToOptions, IndoorBuildingEvent, IndoorLevelActivatedEvent, KmlMapEvent, LongPressEvent, MapPressEvent, MapStyleElement, MapType, MapTypes, PanDragEvent, PoiClickEvent, SnapshotOptions, UserLocationChangeEvent } from './MapView.types';
|
|
5
5
|
import { Modify } from './sharedTypesInternal';
|
|
6
6
|
import { MapViewNativeComponentType } from './MapViewNativeComponent';
|
|
7
7
|
export declare const MAP_TYPES: MapTypes;
|
|
8
8
|
export type MapViewProps = ViewProps & {
|
|
9
|
+
/**
|
|
10
|
+
* A boundary of an area within which the map’s center needs to remain.
|
|
11
|
+
* @platform iOS: Supported
|
|
12
|
+
* @platform Android: Supported
|
|
13
|
+
*/
|
|
14
|
+
boundary?: BoundingBox;
|
|
9
15
|
/**
|
|
10
16
|
* If `true` map will be cached and displayed as an image instead of being interactable, for performance usage.
|
|
11
17
|
*
|
|
@@ -47,6 +53,13 @@ export type MapViewProps = ViewProps & {
|
|
|
47
53
|
* @platform Android: Not supported
|
|
48
54
|
*/
|
|
49
55
|
followsUserLocation?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Set to control what indoor building level to display.
|
|
58
|
+
*
|
|
59
|
+
* @platform iOS: Google Maps only
|
|
60
|
+
* @platform Android: Supported
|
|
61
|
+
*/
|
|
62
|
+
indoorActiveLevelIndex?: number;
|
|
50
63
|
/**
|
|
51
64
|
* The initial camera view the map should use. Use this prop instead of `camera`
|
|
52
65
|
* only if you don't want to control the camera of the map besides the initial view.
|
|
@@ -570,7 +583,6 @@ type State = {
|
|
|
570
583
|
isReady: boolean;
|
|
571
584
|
};
|
|
572
585
|
declare class MapView extends React.Component<MapViewProps, State> {
|
|
573
|
-
static Animated: Animated.AnimatedComponent<typeof MapView>;
|
|
574
586
|
private map;
|
|
575
587
|
constructor(props: MapViewProps);
|
|
576
588
|
/**
|
|
@@ -581,22 +593,17 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
581
593
|
private _onMapReady;
|
|
582
594
|
private _onChange;
|
|
583
595
|
getCamera(): Promise<Camera>;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
fitToElements(options?: FitToOptions): void;
|
|
590
|
-
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): void;
|
|
591
|
-
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): void;
|
|
596
|
+
animateCamera(camera: Partial<Camera>, duration?: number): Promise<void>;
|
|
597
|
+
animateToRegion(region: Region, duration?: number): Promise<void>;
|
|
598
|
+
fitToElements(options?: FitToOptions): Promise<void>;
|
|
599
|
+
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): Promise<void>;
|
|
600
|
+
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): Promise<void>;
|
|
592
601
|
/**
|
|
593
602
|
* Get visible boudaries
|
|
594
603
|
*
|
|
595
604
|
* @return Promise Promise with the bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
596
605
|
*/
|
|
597
606
|
getMapBoundaries(): Promise<BoundingBox>;
|
|
598
|
-
setMapBoundaries(northEast: LatLng, southWest: LatLng): void;
|
|
599
|
-
setIndoorActiveLevelIndex(activeLevelIndex: number): void;
|
|
600
607
|
/**
|
|
601
608
|
* Takes a snapshot of the map and saves it to a picture
|
|
602
609
|
* file or returns the image as a base64 encoded string.
|
|
@@ -663,11 +670,9 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
663
670
|
* @return Object Object bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
664
671
|
*/
|
|
665
672
|
boundingBoxForRegion(region: Region): BoundingBox;
|
|
666
|
-
private _mapManagerCommand;
|
|
667
673
|
private _getHandle;
|
|
668
|
-
private
|
|
674
|
+
private _gogleMapsOniOS;
|
|
669
675
|
render(): JSX.Element;
|
|
670
676
|
}
|
|
671
|
-
export declare const
|
|
672
|
-
export declare const enableLatestRenderer: () => any;
|
|
677
|
+
export declare const enableLatestRenderer: () => Promise<string> | undefined;
|
|
673
678
|
export default MapView;
|
package/lib/MapView.js
CHANGED
|
@@ -22,13 +22,17 @@ 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
|
-
exports.enableLatestRenderer = exports.
|
|
29
|
+
exports.enableLatestRenderer = exports.MAP_TYPES = void 0;
|
|
27
30
|
const React = __importStar(require("react"));
|
|
28
31
|
const react_native_1 = require("react-native");
|
|
29
32
|
const decorateMapComponent_1 = require("./decorateMapComponent");
|
|
30
33
|
const ProviderConstants = __importStar(require("./ProviderConstants"));
|
|
31
|
-
const
|
|
34
|
+
const NativeMapViewModule_1 = __importDefault(require("./NativeMapViewModule"));
|
|
35
|
+
const NativeGoogleMapViewModule_1 = __importDefault(require("./NativeGoogleMapViewModule"));
|
|
32
36
|
exports.MAP_TYPES = {
|
|
33
37
|
STANDARD: 'standard',
|
|
34
38
|
SATELLITE: 'satellite',
|
|
@@ -39,7 +43,6 @@ exports.MAP_TYPES = {
|
|
|
39
43
|
};
|
|
40
44
|
const GOOGLE_MAPS_ONLY_TYPES = [exports.MAP_TYPES.TERRAIN, exports.MAP_TYPES.NONE];
|
|
41
45
|
class MapView extends React.Component {
|
|
42
|
-
static Animated;
|
|
43
46
|
map;
|
|
44
47
|
constructor(props) {
|
|
45
48
|
super(props);
|
|
@@ -80,46 +83,43 @@ class MapView extends React.Component {
|
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
getCamera() {
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
85
|
-
}
|
|
86
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
87
|
-
return this._runCommand('getCamera', []);
|
|
88
|
-
}
|
|
89
|
-
return Promise.reject('getCamera not supported on this platform');
|
|
90
|
-
}
|
|
91
|
-
setCamera(camera) {
|
|
92
|
-
if (this.map.current) {
|
|
93
|
-
MapViewNativeComponent_1.Commands.setCamera(this.map.current, camera);
|
|
86
|
+
if (this._gogleMapsOniOS()) {
|
|
87
|
+
return googleMapViewModuleMethod('getCamera')(this._getHandle());
|
|
94
88
|
}
|
|
89
|
+
return mapViewModuleMethod('getCamera')(this._getHandle());
|
|
95
90
|
}
|
|
96
|
-
animateCamera(camera,
|
|
97
|
-
if (this.
|
|
98
|
-
|
|
91
|
+
animateCamera(camera, duration = 500) {
|
|
92
|
+
if (this._gogleMapsOniOS()) {
|
|
93
|
+
return googleMapViewModuleMethod('animateCamera')(this._getHandle(), camera, duration);
|
|
99
94
|
}
|
|
95
|
+
return mapViewModuleMethod('animateCamera')(this._getHandle(), camera, duration);
|
|
100
96
|
}
|
|
101
97
|
animateToRegion(region, duration = 500) {
|
|
102
|
-
if (this.
|
|
103
|
-
|
|
98
|
+
if (this._gogleMapsOniOS()) {
|
|
99
|
+
return googleMapViewModuleMethod('animateToRegion')(this._getHandle(), region, duration);
|
|
104
100
|
}
|
|
101
|
+
return mapViewModuleMethod('animateToRegion')(this._getHandle(), region, duration);
|
|
105
102
|
}
|
|
106
103
|
fitToElements(options = {}) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
105
|
+
if (this._gogleMapsOniOS()) {
|
|
106
|
+
return googleMapViewModuleMethod('fitToElements')(this._getHandle(), edgePadding, duration);
|
|
110
107
|
}
|
|
108
|
+
return mapViewModuleMethod('fitToElements')(this._getHandle(), edgePadding, duration);
|
|
111
109
|
}
|
|
112
110
|
fitToSuppliedMarkers(markers, options = {}) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
112
|
+
if (this._gogleMapsOniOS()) {
|
|
113
|
+
return googleMapViewModuleMethod('fitToSuppliedMarkers')(this._getHandle(), markers, edgePadding, duration);
|
|
116
114
|
}
|
|
115
|
+
return mapViewModuleMethod('fitToSuppliedMarkers')(this._getHandle(), markers, edgePadding, duration);
|
|
117
116
|
}
|
|
118
117
|
fitToCoordinates(coordinates = [], options = {}) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, duration = 0 } = options;
|
|
119
|
+
if (this._gogleMapsOniOS()) {
|
|
120
|
+
return googleMapViewModuleMethod('fitToCoordinates')(this._getHandle(), coordinates, edgePadding, duration);
|
|
122
121
|
}
|
|
122
|
+
return mapViewModuleMethod('fitToCoordinates')(this._getHandle(), coordinates, edgePadding, duration);
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Get visible boudaries
|
|
@@ -127,23 +127,10 @@ class MapView extends React.Component {
|
|
|
127
127
|
* @return Promise Promise with the bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
128
128
|
*/
|
|
129
129
|
async getMapBoundaries() {
|
|
130
|
-
if (
|
|
131
|
-
return
|
|
132
|
-
}
|
|
133
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
134
|
-
return await this._runCommand('getMapBoundaries', []);
|
|
135
|
-
}
|
|
136
|
-
return Promise.reject('getMapBoundaries not supported on this platform');
|
|
137
|
-
}
|
|
138
|
-
setMapBoundaries(northEast, southWest) {
|
|
139
|
-
if (this.map.current) {
|
|
140
|
-
MapViewNativeComponent_1.Commands.setMapBoundaries(this.map.current, northEast, southWest);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
setIndoorActiveLevelIndex(activeLevelIndex) {
|
|
144
|
-
if (this.map.current) {
|
|
145
|
-
MapViewNativeComponent_1.Commands.setIndoorActiveLevelIndex(this.map.current, activeLevelIndex);
|
|
130
|
+
if (this._gogleMapsOniOS()) {
|
|
131
|
+
return googleMapViewModuleMethod('getMapBoundaries')(this._getHandle());
|
|
146
132
|
}
|
|
133
|
+
return mapViewModuleMethod('getMapBoundaries')(this._getHandle());
|
|
147
134
|
}
|
|
148
135
|
/**
|
|
149
136
|
* Takes a snapshot of the map and saves it to a picture
|
|
@@ -164,7 +151,7 @@ class MapView extends React.Component {
|
|
|
164
151
|
const config = {
|
|
165
152
|
width: args.width || 0,
|
|
166
153
|
height: args.height || 0,
|
|
167
|
-
region: args.region
|
|
154
|
+
region: args.region,
|
|
168
155
|
format: args.format || 'png',
|
|
169
156
|
quality: args.quality || 1.0,
|
|
170
157
|
result: args.result || 'file',
|
|
@@ -175,31 +162,10 @@ class MapView extends React.Component {
|
|
|
175
162
|
if (config.result !== 'file' && config.result !== 'base64') {
|
|
176
163
|
throw new Error('Invalid result specified');
|
|
177
164
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return react_native_1.NativeModules.AirMapModule.takeSnapshot(this._getHandle(), config);
|
|
181
|
-
}
|
|
182
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
183
|
-
return new Promise((resolve, reject) => {
|
|
184
|
-
this._runCommand('takeSnapshot', [
|
|
185
|
-
config.width,
|
|
186
|
-
config.height,
|
|
187
|
-
config.region,
|
|
188
|
-
config.format,
|
|
189
|
-
config.quality,
|
|
190
|
-
config.result,
|
|
191
|
-
(err, snapshot) => {
|
|
192
|
-
if (err) {
|
|
193
|
-
reject(err);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
resolve(snapshot);
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
]);
|
|
200
|
-
});
|
|
165
|
+
if (this._gogleMapsOniOS()) {
|
|
166
|
+
return googleMapViewModuleMethod('takeSnapshot')(this._getHandle(), config);
|
|
201
167
|
}
|
|
202
|
-
return
|
|
168
|
+
return mapViewModuleMethod('takeSnapshot')(this._getHandle(), config);
|
|
203
169
|
}
|
|
204
170
|
/**
|
|
205
171
|
* Convert a coordinate to address by using default Geocoder
|
|
@@ -211,13 +177,10 @@ class MapView extends React.Component {
|
|
|
211
177
|
* @return Promise with return type Address
|
|
212
178
|
*/
|
|
213
179
|
addressForCoordinate(coordinate) {
|
|
214
|
-
if (
|
|
215
|
-
|
|
180
|
+
if (this._gogleMapsOniOS()) {
|
|
181
|
+
throw new Error('addressForCoordinate not supported on Google Maps iOS');
|
|
216
182
|
}
|
|
217
|
-
|
|
218
|
-
return this._runCommand('getAddressFromCoordinates', [coordinate]);
|
|
219
|
-
}
|
|
220
|
-
return Promise.reject('getAddress not supported on this platform');
|
|
183
|
+
return mapViewModuleMethod('getAddressFromCoordinates')(this._getHandle(), coordinate);
|
|
221
184
|
}
|
|
222
185
|
/**
|
|
223
186
|
* Convert a map coordinate to user-space point
|
|
@@ -229,13 +192,10 @@ class MapView extends React.Component {
|
|
|
229
192
|
* @return Promise Promise with the point ({ x: Number, y: Number })
|
|
230
193
|
*/
|
|
231
194
|
pointForCoordinate(coordinate) {
|
|
232
|
-
if (
|
|
233
|
-
return
|
|
234
|
-
}
|
|
235
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
236
|
-
return this._runCommand('pointForCoordinate', [coordinate]);
|
|
195
|
+
if (this._gogleMapsOniOS()) {
|
|
196
|
+
return googleMapViewModuleMethod('pointForCoordinate')(this._getHandle(), coordinate);
|
|
237
197
|
}
|
|
238
|
-
return
|
|
198
|
+
return mapViewModuleMethod('pointForCoordinate')(this._getHandle(), coordinate);
|
|
239
199
|
}
|
|
240
200
|
/**
|
|
241
201
|
* Convert a user-space point to a map coordinate
|
|
@@ -247,13 +207,10 @@ class MapView extends React.Component {
|
|
|
247
207
|
* @return Promise Promise with the coordinate ({ latitude: Number, longitude: Number })
|
|
248
208
|
*/
|
|
249
209
|
coordinateForPoint(point) {
|
|
250
|
-
if (
|
|
251
|
-
return
|
|
252
|
-
}
|
|
253
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
254
|
-
return this._runCommand('coordinateForPoint', [point]);
|
|
210
|
+
if (this._gogleMapsOniOS()) {
|
|
211
|
+
return googleMapViewModuleMethod('coordinateForPoint')(this._getHandle(), point);
|
|
255
212
|
}
|
|
256
|
-
return
|
|
213
|
+
return mapViewModuleMethod('coordinateForPoint')(this._getHandle(), point);
|
|
257
214
|
}
|
|
258
215
|
/**
|
|
259
216
|
* Get markers' centers and frames in user-space coordinates
|
|
@@ -263,10 +220,13 @@ class MapView extends React.Component {
|
|
|
263
220
|
* @return Promise Promise with { <identifier>: { point: Point, frame: Frame } }
|
|
264
221
|
*/
|
|
265
222
|
getMarkersFrames(onlyVisible = false) {
|
|
266
|
-
if (react_native_1.Platform.OS
|
|
267
|
-
|
|
223
|
+
if (react_native_1.Platform.OS !== 'ios') {
|
|
224
|
+
throw new Error('getMarkersFrames only supported on iOS');
|
|
268
225
|
}
|
|
269
|
-
|
|
226
|
+
if (this._gogleMapsOniOS()) {
|
|
227
|
+
return googleMapViewModuleMethod('getMarkersFrames')(this._getHandle(), onlyVisible);
|
|
228
|
+
}
|
|
229
|
+
return mapViewModuleMethod('getMarkersFrames')(this._getHandle(), onlyVisible);
|
|
270
230
|
}
|
|
271
231
|
/**
|
|
272
232
|
* Get bounding box from region
|
|
@@ -287,19 +247,15 @@ class MapView extends React.Component {
|
|
|
287
247
|
},
|
|
288
248
|
};
|
|
289
249
|
}
|
|
290
|
-
_mapManagerCommand(name) {
|
|
291
|
-
return react_native_1.NativeModules[`${(0, decorateMapComponent_1.getNativeMapName)(this.props.provider)}Manager`][name];
|
|
292
|
-
}
|
|
293
250
|
_getHandle() {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
if (react_native_1.Platform.OS === 'ios') {
|
|
298
|
-
return this._mapManagerCommand(name)(this._getHandle(), ...args);
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
return Promise.reject(`Invalid platform was passed: ${react_native_1.Platform.OS}`);
|
|
251
|
+
const handle = (0, react_native_1.findNodeHandle)(this.map.current);
|
|
252
|
+
if (!handle) {
|
|
253
|
+
throw new Error('Cannot find node handle');
|
|
302
254
|
}
|
|
255
|
+
return handle;
|
|
256
|
+
}
|
|
257
|
+
_gogleMapsOniOS() {
|
|
258
|
+
return react_native_1.Platform.OS === 'ios' && this.props.provider === 'google';
|
|
303
259
|
}
|
|
304
260
|
render() {
|
|
305
261
|
let props;
|
|
@@ -338,42 +294,60 @@ class MapView extends React.Component {
|
|
|
338
294
|
customMapStyleString: this.props.customMapStyle
|
|
339
295
|
? JSON.stringify(this.props.customMapStyle)
|
|
340
296
|
: undefined,
|
|
297
|
+
boundary: this.props.boundary,
|
|
341
298
|
};
|
|
342
299
|
}
|
|
343
300
|
if (react_native_1.Platform.OS === 'android' && this.props.liteMode) {
|
|
344
301
|
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
345
|
-
<
|
|
302
|
+
<RNMMapLite {...props}/>
|
|
346
303
|
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
347
304
|
}
|
|
348
|
-
const
|
|
305
|
+
const RNMMap = getNativeMapComponent(this.props.provider);
|
|
349
306
|
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
350
|
-
<
|
|
307
|
+
<RNMMap {...props}/>
|
|
351
308
|
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
352
309
|
}
|
|
353
310
|
}
|
|
354
|
-
const
|
|
355
|
-
default: (0, react_native_1.requireNativeComponent)('
|
|
311
|
+
const rnmMaps = {
|
|
312
|
+
default: (0, react_native_1.requireNativeComponent)('RNMMap'),
|
|
356
313
|
google: () => null,
|
|
357
314
|
};
|
|
358
315
|
if (react_native_1.Platform.OS === 'android') {
|
|
359
|
-
|
|
316
|
+
rnmMaps.google = rnmMaps.default;
|
|
360
317
|
}
|
|
361
318
|
else {
|
|
362
|
-
|
|
363
|
-
? (0, react_native_1.requireNativeComponent)('
|
|
364
|
-
: (0, decorateMapComponent_1.createNotSupportedComponent)('react-native-maps:
|
|
319
|
+
rnmMaps.google = decorateMapComponent_1.googleMapIsInstalled
|
|
320
|
+
? (0, react_native_1.requireNativeComponent)('RNMGoogleMap')
|
|
321
|
+
: (0, decorateMapComponent_1.createNotSupportedComponent)('react-native-maps: RNMGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS.');
|
|
365
322
|
}
|
|
366
|
-
const getNativeMapComponent = (provider) =>
|
|
367
|
-
const
|
|
368
|
-
? (0, react_native_1.requireNativeComponent)('
|
|
323
|
+
const getNativeMapComponent = (provider) => rnmMaps[provider || 'default'];
|
|
324
|
+
const RNMMapLite = react_native_1.UIManager.getViewManagerConfig('RNMMapLite')
|
|
325
|
+
? (0, react_native_1.requireNativeComponent)('RNMMapLite')
|
|
369
326
|
: () => null;
|
|
370
|
-
exports.AnimatedMapView = react_native_1.Animated.createAnimatedComponent(MapView);
|
|
371
327
|
const enableLatestRenderer = () => {
|
|
372
|
-
if (react_native_1.Platform.OS
|
|
373
|
-
return;
|
|
328
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
329
|
+
return mapViewModuleMethod('enableLatestRenderer')();
|
|
374
330
|
}
|
|
375
|
-
return react_native_1.NativeModules.AirMapModule.enableLatestRenderer();
|
|
376
331
|
};
|
|
377
332
|
exports.enableLatestRenderer = enableLatestRenderer;
|
|
378
|
-
|
|
333
|
+
function mapViewModuleMethod(name) {
|
|
334
|
+
if (!NativeMapViewModule_1.default) {
|
|
335
|
+
throw new Error('MapViewModule is null');
|
|
336
|
+
}
|
|
337
|
+
const method = NativeMapViewModule_1.default[name];
|
|
338
|
+
if (!method) {
|
|
339
|
+
throw new Error(`Method ${name} is not defined`);
|
|
340
|
+
}
|
|
341
|
+
return NativeMapViewModule_1.default[name];
|
|
342
|
+
}
|
|
343
|
+
function googleMapViewModuleMethod(name) {
|
|
344
|
+
if (!NativeGoogleMapViewModule_1.default) {
|
|
345
|
+
throw new Error('GoogleMapViewModule is null');
|
|
346
|
+
}
|
|
347
|
+
const method = NativeGoogleMapViewModule_1.default[name];
|
|
348
|
+
if (!method) {
|
|
349
|
+
throw new Error(`Method ${name} is not defined`);
|
|
350
|
+
}
|
|
351
|
+
return NativeGoogleMapViewModule_1.default[name];
|
|
352
|
+
}
|
|
379
353
|
exports.default = MapView;
|