Added support for zoomTo

This commit is contained in:
Nick
2017-09-26 20:12:53 -07:00
parent 252a9bbc57
commit 89f1fa79ee
17 changed files with 162 additions and 21 deletions
+11
View File
@@ -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;