2017-08-22 17:22:40 -07:00
import React from 'react' ;
import PropTypes from 'prop-types' ;
2017-09-01 09:58:36 -07:00
import { NativeModules , requireNativeComponent } from 'react-native' ;
import { makePoint , makeLatLngBounds } from '../utils/geoUtils' ;
2017-09-06 15:26:57 -07:00
import {
isFunction ,
isNumber ,
runNativeCommand ,
2017-09-06 16:03:16 -07:00
toJSONString ,
2017-10-04 12:51:36 -07:00
getFilter ,
2017-10-03 11:46:16 -07:00
IS_ANDROID ,
2017-09-06 15:26:57 -07:00
} from '../utils' ;
2017-08-22 17:22:40 -07:00
2017-09-01 09:58:36 -07:00
const MapboxGL = NativeModules . MGLModule ;
2017-08-22 17:22:40 -07:00
2017-08-28 13:17:46 -07:00
export const NATIVE_MODULE_NAME = 'RCTMGLMapView' ;
const RCTMGLMapView = requireNativeComponent ( NATIVE_MODULE_NAME , MapView , {
2017-10-03 11:46:16 -07:00
nativeOnly : { onMapChange : true , onAndroidCallback : true },
2017-08-28 13:17:46 -07:00
});
2017-08-24 13:17:22 -07:00
/**
* MapView backed by Mapbox Native GL
*/
2017-08-22 17:22:40 -07:00
class MapView extends React . Component {
static propTypes = {
2017-08-24 13:17:22 -07:00
/**
* Animates changes between pitch and bearing
*/
2017-08-22 17:22:40 -07:00
animated : PropTypes . bool ,
2017-08-24 13:17:22 -07:00
/**
2017-09-01 09:58:36 -07:00
* Initial center coordinate on map [lng, lat]
2017-08-24 13:17:22 -07:00
*/
2017-09-01 09:58:36 -07:00
centerCoordinate : PropTypes . arrayOf ( PropTypes . number ),
/**
* Shows the users location on the map
*/
showUserLocation : PropTypes . bool ,
/**
* The mode used to track the user location on the map
*/
userTrackingMode : PropTypes . number ,
2017-08-24 13:17:22 -07:00
/**
* Initial heading on map
*/
2017-08-22 17:22:40 -07:00
heading : PropTypes . number ,
2017-08-24 13:17:22 -07:00
/**
* Initial pitch on map
*/
pitch : PropTypes . number ,
/**
* Style for wrapping React Native View
*/
2017-08-22 17:22:40 -07:00
style : PropTypes . any ,
2017-08-24 13:17:22 -07:00
/**
* Style URL for map
*/
2017-08-22 17:22:40 -07:00
styleURL : PropTypes . string ,
2017-08-24 13:17:22 -07:00
/**
* Initial zoom level of map
*/
zoomLevel : PropTypes . number ,
2017-08-24 16:39:04 -07:00
2017-08-24 17:13:34 -07:00
/**
* Min zoom level of map
*/
minZoomLevel : PropTypes . number ,
/**
* Max zoom level of map
*/
maxZoomLevel : PropTypes . number ,
/**
* Enable/Disable scroll on the map
*/
scrollEnabled : PropTypes . bool ,
/**
* Enable/Disable pitch on map
*/
pitchEnabled : PropTypes . bool ,
2017-09-27 14:11:44 -07:00
/**
* Enable/Disable rotation on map
*/
rotateEnabled : PropTypes . bool ,
/**
* Enable/Disable attribution on map. For iOS you need to add MGLMapboxMetricsEnabledSettingShownInApp=YES
* to your Info.plist
*/
attributionEnabled : PropTypes . bool ,
/**
* Enable/Disable the logo on the map.
*/
logoEnabled : PropTypes . bool ,
2017-08-24 16:39:04 -07:00
/**
* Map press listener, gets called when a user presses the map
*/
2017-09-01 09:58:36 -07:00
onPress : PropTypes . func ,
2017-08-24 16:39:04 -07:00
2017-09-01 09:58:36 -07:00
/**
* Map long press listener, gets called when a user long presses the map
*/
onLongPress : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered whenever the currently displayed map region is about to change.
*/
onRegionWillChange : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered whenever the currently displayed map region is changing.
*/
onRegionIsChanging : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered whenever the currently displayed map region finished changing
*/
onRegionDidChange : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map is about to start loading a new map style.
*/
onWillStartLoadingMap : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This is triggered when the map has successfully loaded a new map style.
*/
onDidFinishLoadingMap : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map has failed to load a new map style.
*/
onDidFailLoadingMap : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map will start rendering a frame.
*/
onWillStartRenderingFrame : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map finished rendering a frame.
*/
onDidFinishRenderingFrame : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map fully finished rendering a frame.
*/
onDidFinishRenderingFrameFully : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map will start rendering the map.
*/
onWillStartRenderingMap : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map finished rendering the map.
*/
onDidFinishRenderingMap : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when the map fully finished rendering the map.
*/
onDidFinishRenderingMapFully : PropTypes . func ,
2017-08-28 13:17:46 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when a style has finished loading.
*/
onDidFinishLoadingStyle : PropTypes . func ,
2017-08-28 14:48:47 -07:00
2017-09-01 09:58:36 -07:00
/**
* This event is triggered when a fly to animation is cancelled or completed after calling flyTo
*/
onFlyToComplete : PropTypes . func ,
/**
* This event is triggered once the camera is finished after calling setCamera
*/
onSetCameraComplete : PropTypes . func ,
2017-08-22 17:22:40 -07:00
};
static defaultProps = {
2017-09-01 09:58:36 -07:00
animated : false ,
2017-08-22 17:22:40 -07:00
heading : 0 ,
pitch : 0 ,
2017-08-28 13:17:46 -07:00
scrollEnabled : true ,
pitchEnabled : true ,
2017-09-27 14:11:44 -07:00
rotateEnabled : true ,
attributionEnabled : true ,
logoEnabled : true ,
2017-08-22 17:22:40 -07:00
zoomLevel : 16 ,
2017-09-01 09:58:36 -07:00
userTrackingMode : MapboxGL . UserTrackingModes . None ,
styleURL : MapboxGL . StyleURL . Street ,
2017-08-22 17:22:40 -07:00
};
2017-08-24 16:39:04 -07:00
constructor ( props ) {
super ( props );
2017-08-28 13:17:46 -07:00
this . _onPress = this . _onPress . bind ( this );
this . _onLongPress = this . _onLongPress . bind ( this );
this . _onChange = this . _onChange . bind ( this );
2017-10-03 11:46:16 -07:00
this . _onAndroidCallback = this . _onAndroidCallback . bind ( this );
this . _callbackMap = new Map ();
}
/**
2017-10-18 13:40:26 -07:00
* Returns an array of rendered map features that intersect with a given point.
*
* @example
* this._map.queryRenderedFeaturesAtPoint([30, 40], ['==', 'type', 'Point'], ['id1', 'id2'])
*
* @param {Array<Number>} coordinate - A point expressed in the map view’ s coordinate system.
* @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
* @param {Array=} layerIDs - A array of layer id's to filter the features by
2017-10-04 12:51:36 -07:00
* @return {FeatureCollection}
2017-10-03 11:46:16 -07:00
*/
2017-10-04 12:51:36 -07:00
async queryRenderedFeaturesAtPoint ( coordinate , filter = [], layerIDs = []) {
if ( ! coordinate || coordinate . length < 2 ) {
throw new Error ( 'Must pass in valid coordinate[lng, lat]' );
2017-10-03 11:46:16 -07:00
}
2017-10-04 12:51:36 -07:00
const res = await this . _runNativeCommand ( 'queryRenderedFeaturesAtPoint' , [
coordinate ,
getFilter ( filter ),
layerIDs ,
]);
if ( IS_ANDROID ) {
return JSON . parse ( res . data );
}
return res . data ;
}
/**
2017-10-18 13:40:26 -07:00
* Returns an array of rendered map features that intersect with the given rectangle,
* restricted to the given style layers and filtered by the given predicate.
*
* @example
* this._map.queryRenderedFeaturesInRect([30, 40, 20, 10], ['==', 'type', 'Point'], ['id1', 'id2'])
*
* @param {Array<Number>} bbox - A rectangle expressed in the map view’ s coordinate system.
* @param {Array=} filter - A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these layers are included in the returned array.
* @param {Array=} layerIDs - A array of layer id's to filter the features by
2017-10-04 12:51:36 -07:00
* @return {FeatureCollection}
*/
async queryRenderedFeaturesInRect ( bbox , filter = [], layerIDs = []) {
if ( ! bbox || bbox . length !== 4 ) {
throw new Error ( 'Must pass in a valid bounding box[top, right, bottom, left]' );
}
const res = await this . _runNativeCommand ( 'queryRenderedFeaturesInRect' , [
bbox ,
getFilter ( filter ),
layerIDs ,
]);
if ( IS_ANDROID ) {
return JSON . parse ( res . data );
}
return res . data ;
2017-09-01 09:58:36 -07:00
}
2017-09-07 17:00:16 -07:00
/**
* Map camera transitions to fit provided bounds
*
* @example
* this.map.fitBounds([lng, lat], [lng, lat])
2017-10-18 13:40:26 -07:00
* this.map.fitBounds([lng, lat], [lng, lat], 20, 1000) // padding for all sides
* this.map.fitBounds([lng, lat], [lng, lat], [verticalPadding, horizontalPadding], 1000)
* this.map.fitBounds([lng, lat], [lng, lat], [top, right, bottom, left], 1000)
2017-09-07 17:00:16 -07:00
*
* @param {Array<Number>} northEastCoordinates - North east coordinate of bound
* @param {Array<Number>} southWestCoordinates - South west coordinate of bound
2017-10-18 13:40:26 -07:00
* @param {Number=} padding - Camera padding for bound
2017-09-07 17:00:16 -07:00
* @param {Number=} duration - Duration of camera animation
* @return {void}
*/
2017-09-01 09:58:36 -07:00
fitBounds ( northEastCoordinates , southWestCoordinates , padding = 0 , duration = 2000 ) {
if ( ! this . _nativeRef ) {
return ;
}
2017-10-05 16:41:35 -07:00
let pad = {
paddingLeft : 0 ,
paddingRight : 0 ,
paddingTop : 0 ,
paddingBottom : 0 ,
};
if ( Array . isArray ( padding )) {
if ( padding . length === 2 ) {
pad . paddingTop = padding [ 0 ];
pad . paddingBottom = padding [ 0 ];
pad . paddingLeft = padding [ 1 ];
pad . paddingRight = padding [ 1 ];
} else if ( padding . length === 4 ) {
pad . paddingTop = padding [ 0 ];
pad . paddingRight = padding [ 1 ];
pad . paddingBottom = padding [ 2 ];
pad . paddingLeft = padding [ 3 ];
}
} else {
pad . paddingLeft = padding ;
pad . paddingRight = padding ;
pad . paddingTop = padding ;
pad . paddingBottom = padding ;
}
2017-10-03 11:46:16 -07:00
return this . setCamera ({
2017-09-06 15:26:57 -07:00
bounds : {
ne : northEastCoordinates ,
sw : southWestCoordinates ,
2017-10-05 16:41:35 -07:00
... pad ,
2017-09-06 15:26:57 -07:00
},
duration : duration ,
mode : MapboxGL . CameraModes . Flight ,
});
2017-08-24 16:39:04 -07:00
}
2017-09-07 17:00:16 -07:00
/**
* Map camera will fly to new coordinate
*
* @example
* this.map.flyTo([lng, lat])
* this.map.flyTo([lng, lat], 12000)
*
* @param {Array<Number>} coordinates - Coordinates that map camera will jump too
* @param {Number=} duration - Duration of camera animation
* @return {void}
*/
2017-08-28 13:17:46 -07:00
flyTo ( coordinates , duration = 2000 ) {
if ( ! this . _nativeRef ) {
2017-10-03 11:46:16 -07:00
return Promise . reject ( 'No native reference found' );
2017-08-28 13:17:46 -07:00
}
2017-10-03 11:46:16 -07:00
return this . setCamera ({
2017-09-06 15:26:57 -07:00
centerCoordinate : coordinates ,
duration : duration ,
mode : MapboxGL . CameraModes . Flight ,
});
2017-08-28 13:17:46 -07:00
}
2017-10-19 10:27:42 -07:00
/**
* Map camera will move to new coordinate at the same zoom level
*
* @example
* this.map.moveTo([lng, lat], 200) // eases camera to new location based on duration
* this.map.moveTo([lng, lat]) // snaps camera to new location without any easing
*
* @param {Array<Number>} coordinates - Coordinates that map camera will move too
* @param {Number=} duration - Duration of camera animation
* @return {void}
*/
moveTo ( coordinates , duration = 0 ) {
if ( ! this . _nativeRef ) {
return Promise . reject ( 'No native reference found' );
}
return this . setCamera ({
centerCoordinate : coordinates ,
duration : duration ,
});
}
2017-09-07 17:00:16 -07:00
/**
* Map camera will zoom to specified level
*
* @example
* this.map.zoomTo(16)
* this.map.zoomTo(16, 100)
*
* @param {Number} zoomLevel - Zoom level that the map camera will animate too
* @param {Number=} duration - Duration of camera animation
* @return {void}
*/
2017-09-07 12:10:01 -07:00
zoomTo ( zoomLevel , duration = 2000 ) {
if ( ! this . _nativeRef ) {
2017-10-03 11:46:16 -07:00
return Promise . reject ( 'No native reference found' );
2017-09-07 12:10:01 -07:00
}
2017-10-03 11:46:16 -07:00
return this . setCamera ({
2017-09-07 12:10:01 -07:00
zoom : zoomLevel ,
duration : duration ,
mode : MapboxGL . CameraModes . Flight ,
});
}
2017-09-07 17:00:16 -07:00
/**
* Map camera will perform updates based on provided config. Advanced use only!
*
* @example
* this.map.setCamera({
* centerCoordinate: [lng, lat],
* zoomLevel: 16,
* duration: 2000,
* })
*
* this.map.setCamera({
* stops: [
* { pitch: 45, duration: 200 },
* { heading: 180, duration: 300 },
* ]
* })
*
* @param {Object} config - Camera configuration
*/
2017-09-01 09:58:36 -07:00
setCamera ( config = {}) {
if ( ! this . _nativeRef ) {
return ;
}
2017-09-06 15:26:57 -07:00
let cameraConfig = {};
if ( config . stops ) {
cameraConfig . stops = [];
for ( let stop of config . stops ) {
cameraConfig . stops . push ( this . _createStopConfig ( stop ));
}
} else {
cameraConfig = this . _createStopConfig ( config );
2017-09-01 09:58:36 -07:00
}
2017-10-04 12:51:36 -07:00
return this . _runNativeCommand ( 'setCamera' , [ cameraConfig ]);
}
2017-10-03 11:46:16 -07:00
2017-10-04 12:51:36 -07:00
_runNativeCommand ( methodName , args ) {
2017-10-03 11:46:16 -07:00
if ( IS_ANDROID ) {
2017-10-04 12:51:36 -07:00
return new Promise (( resolve ) => {
2017-10-03 11:46:16 -07:00
const callbackID = '' + Date . now ();
this . _addAddAndroidCallback ( callbackID , resolve );
args . unshift ( callbackID );
2017-10-04 12:51:36 -07:00
runNativeCommand ( NATIVE_MODULE_NAME , methodName , this . _nativeRef , args );
2017-10-03 11:46:16 -07:00
});
}
2017-10-04 12:51:36 -07:00
return runNativeCommand ( NATIVE_MODULE_NAME , methodName , this . _nativeRef , args );
2017-09-06 15:26:57 -07:00
}
_createStopConfig ( config = {}) {
let stopConfig = {
mode : isNumber ( config . mode ) ? config . mode : MapboxGL . CameraModes . Ease ,
2017-09-01 09:58:36 -07:00
pitch : config . pitch ,
heading : config . heading ,
duration : config . duration || 2000 ,
2017-09-06 15:26:57 -07:00
zoom : config . zoom ,
2017-09-01 09:58:36 -07:00
};
2017-09-06 15:26:57 -07:00
if ( config . centerCoordinate ) {
stopConfig . centerCoordinate = toJSONString ( makePoint ( config . centerCoordinate ));
}
if ( config . bounds && config . bounds . ne && config . bounds . sw ) {
2017-10-05 16:41:35 -07:00
const { ne , sw , paddingLeft , paddingRight , paddingTop , paddingBottom } = config . bounds ;
2017-09-06 15:26:57 -07:00
stopConfig . bounds = toJSONString ( makeLatLngBounds ( ne , sw ));
2017-10-05 16:41:35 -07:00
stopConfig . boundsPaddingTop = paddingTop || 0 ;
stopConfig . boundsPaddingRight = paddingRight || 0 ;
stopConfig . boundsPaddingBottom = paddingBottom || 0 ;
stopConfig . boundsPaddingLeft = paddingLeft || 0 ;
2017-09-06 15:26:57 -07:00
}
return stopConfig ;
2017-09-01 09:58:36 -07:00
}
2017-10-03 11:46:16 -07:00
_addAddAndroidCallback ( id , callback ) {
this . _callbackMap . set ( id , callback );
}
_removeAndroidCallback ( id ) {
this . _callbackMap . remove ( id );
}
_onAndroidCallback ( e ) {
2017-10-04 12:51:36 -07:00
const callbackID = e . nativeEvent . type ;
2017-10-03 11:46:16 -07:00
const callback = this . _callbackMap . get ( callbackID );
if ( ! callback ) {
return ;
}
this . _callbackMap . delete ( callbackID );
2017-10-04 12:51:36 -07:00
callback . call ( null , e . nativeEvent . payload );
2017-10-03 11:46:16 -07:00
}
2017-08-28 13:17:46 -07:00
_onPress ( e ) {
if ( isFunction ( this . props . onPress )) {
this . props . onPress ( e . nativeEvent . payload );
2017-08-24 16:39:04 -07:00
}
}
2017-08-28 13:17:46 -07:00
_onLongPress ( e ) {
if ( isFunction ( this . props . onLongPress )) {
this . props . onLongPress ( e . nativeEvent . payload );
}
}
_onChange ( e ) {
const { type , payload } = e . nativeEvent ;
let propName = '' ;
switch ( type ) {
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . RegionWillChange :
2017-08-28 13:17:46 -07:00
propName = 'onRegionWillChange' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . RegionIsChanging :
2017-08-28 13:17:46 -07:00
propName = 'onRegionIsChanging' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . RegionDidChange :
2017-08-28 13:17:46 -07:00
propName = 'onRegionDidChange' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . WillStartLoadinMap :
2017-08-28 13:17:46 -07:00
propName = 'onWillStartLoadingMap' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFinishLoadingMap :
2017-08-28 13:17:46 -07:00
propName = 'onDidFinishLoadingMap' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFailLoadingMap :
2017-08-28 13:17:46 -07:00
propName = 'onDidFailLoadingMap' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . WillStartRenderingFrame :
2017-08-28 13:17:46 -07:00
propName = 'onWillStartRenderingFrame' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFinishRenderingFrame :
2017-08-28 13:17:46 -07:00
propName = 'onDidFinishRenderingFrame' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFinishRenderingFrameFully :
2017-08-28 13:17:46 -07:00
propName = 'onDidFinishRenderingFrameFully' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . WillStartRenderingMap :
2017-08-28 13:17:46 -07:00
propName = 'onWillStartRenderingMap' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFinishRenderingMap :
2017-08-28 13:17:46 -07:00
propName = 'onDidFinishRenderingMap' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFinishRenderingMapFully :
2017-08-28 13:17:46 -07:00
propName = 'onDidFinishRenderingMapFully' ;
break ;
2017-09-01 09:58:36 -07:00
case MapboxGL . EventTypes . DidFinishLoadingStyle :
2017-08-28 13:17:46 -07:00
propName = 'onDidFinishLoadingStyle' ;
break ;
}
if ( propName . length ) {
this . _handleOnChange ( propName , payload );
}
}
2017-09-01 09:58:36 -07:00
_handleOnChange ( propName , payload ) {
2017-08-28 13:17:46 -07:00
if ( isFunction ( this . props [ propName ])) {
this . props [ propName ]( payload );
2017-08-24 16:39:04 -07:00
}
}
2017-09-01 09:58:36 -07:00
_getCenterCoordinate () {
if ( ! this . props . centerCoordinate ) {
return ;
}
2017-09-06 15:26:57 -07:00
return toJSONString (( makePoint ( this . props . centerCoordinate )));
2017-09-01 09:58:36 -07:00
}
2017-08-22 17:22:40 -07:00
render () {
2017-09-01 09:58:36 -07:00
let props = {
2017-08-28 13:17:46 -07:00
animated : this . props . animated ,
2017-09-01 09:58:36 -07:00
centerCoordinate : this . _getCenterCoordinate (),
showUserLocation : this . props . showUserLocation ,
userTrackingMode : this . props . userTrackingMode ,
2017-08-28 13:17:46 -07:00
heading : this . props . heading ,
pitch : this . props . pitch ,
style : this . props . style ,
styleURL : this . props . styleURL ,
zoomLevel : this . props . zoomLevel ,
minZoomLevel : this . props . minZoomLevel ,
maxZoomLevel : this . props . maxZoomLevel ,
scrollEnabled : this . props . scrollEnabled ,
pitchEnabled : this . props . pitchEnabled ,
2017-09-27 14:11:44 -07:00
rotateEnabled : this . props . rotateEnabled ,
attributionEnabled : this . props . attributionEnabled ,
logoEnabled : this . props . logoEnabled ,
2017-08-28 13:17:46 -07:00
};
const callbacks = {
2017-09-06 15:26:57 -07:00
ref : ( nativeRef ) => this . _nativeRef = nativeRef ,
2017-08-28 13:17:46 -07:00
onPress : this . _onPress ,
onLongPress : this . _onLongPress ,
onMapChange : this . _onChange ,
2017-10-03 11:46:16 -07:00
onAndroidCallback : IS_ANDROID ? this . _onAndroidCallback : undefined ,
2017-08-28 13:17:46 -07:00
};
2017-08-24 16:39:04 -07:00
return (
2017-09-06 15:26:57 -07:00
< RCTMGLMapView {... props } {... callbacks } >
{ this . props . children }
< /RCTMGLMapView>
2017-08-24 16:39:04 -07:00
);
2017-08-22 17:22:40 -07:00
}
}
export default MapView ;