mirror of
https://github.com/status-im/react-native-mapbox-gl.git
synced 2026-08-31 13:01:15 +00:00
Added support for zoomTo
This commit is contained in:
@@ -225,6 +225,17 @@ class MapView extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
zoomTo (zoomLevel, duration = 2000) {
|
||||
if (!this._nativeRef) {
|
||||
return;
|
||||
}
|
||||
this.setCamera({
|
||||
zoom: zoomLevel,
|
||||
duration: duration,
|
||||
mode: MapboxGL.CameraModes.Flight,
|
||||
});
|
||||
}
|
||||
|
||||
setCamera (config = {}) {
|
||||
if (!this._nativeRef) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user