Added support for min/max zoom level, scroll/pitch enabled disabled

This commit is contained in:
Nick
2017-10-23 16:41:36 -07:00
parent 4bd8c38fdd
commit b8d0d53585
8 changed files with 150 additions and 2 deletions
+23 -1
View File
@@ -57,6 +57,26 @@ class MapView extends React.Component {
*/
zoomLevel: PropTypes.number,
/**
* 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,
/**
* Map press listener, gets called when a user presses the map
*/
@@ -65,7 +85,7 @@ class MapView extends React.Component {
/**
* Map long press listener, gets called when a user long presses the map
*/
onLongPress: PropTypes.func,
onLongPress: PropTypes.func,
};
static defaultProps = {
@@ -100,6 +120,8 @@ class MapView extends React.Component {
return (
<RCTMGLMapView
{...this.props}
scrollEnabled={false}
pitchEnabled={false}
onPress={this.onPress}
onLongPress={this.onLongPress} />
);