From 0dee16269db81cebae07dbe849e4f31414ce7d2e Mon Sep 17 00:00:00 2001 From: Jeremy Stratman Date: Mon, 13 Apr 2020 14:19:52 -0700 Subject: [PATCH 1/2] add inline snippet and examples to map.jumpTo --- src/ui/camera.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ui/camera.js b/src/ui/camera.js index e78443f14d9..bb208ddc26a 100644 --- a/src/ui/camera.js +++ b/src/ui/camera.js @@ -631,6 +631,19 @@ class Camera extends Evented { * @fires zoomend * @fires pitchend * @returns {Map} `this` + * @example + * // jump to null island at current zoom + * map.jumpTo({center: [0, 0]}); + * // jump with zoom, pitch, and bearing set + * map.jumpTo({ + * center: [0, 0], + * zoom: 8, + * bearing: 90, + * pitch: 45 + * } + * }); + * @see [Jump to a series of locations](https://docs.mapbox.com/mapbox-gl-js/example/jump-to/) + * @see [Update a feature in realtime](https://docs.mapbox.com/mapbox-gl-js/example/live-update-feature/) */ jumpTo(options: CameraOptions, eventData?: Object) { this.stop(); From 1e2edc5a2460f9dfba63c4c2151326eebb4191e8 Mon Sep 17 00:00:00 2001 From: Jeremy Stratman Date: Mon, 13 Apr 2020 14:33:18 -0700 Subject: [PATCH 2/2] minor reorder to match options and text --- src/ui/camera.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/camera.js b/src/ui/camera.js index bb208ddc26a..31295bdb417 100644 --- a/src/ui/camera.js +++ b/src/ui/camera.js @@ -638,8 +638,8 @@ class Camera extends Evented { * map.jumpTo({ * center: [0, 0], * zoom: 8, - * bearing: 90, - * pitch: 45 + * pitch: 45, + * bearing: 90 * } * }); * @see [Jump to a series of locations](https://docs.mapbox.com/mapbox-gl-js/example/jump-to/)