From 61156f84508661bfd295693aa3f28c6fbd9764cd Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Fri, 23 Nov 2018 12:01:48 +0300 Subject: [PATCH] fix: initial bounds resets map's pitch to 0 #7597 --- src/ui/map.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ui/map.js b/src/ui/map.js index 4ab3142c291..e06604de06a 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -373,16 +373,16 @@ class Map extends Camera { this._hash = options.hash && (new Hash()).addTo(this); // don't set position from options if set through hash if (!this._hash || !this._hash._onHashChange()) { + this.jumpTo({ + center: options.center, + zoom: options.zoom, + bearing: options.bearing, + pitch: options.pitch + }); + if (options.bounds) { this.resize(); this.fitBounds(options.bounds, { duration: 0 }); - } else { - this.jumpTo({ - center: options.center, - zoom: options.zoom, - bearing: options.bearing, - pitch: options.pitch - }); } }