Skip to content

Commit

Permalink
fix: initial bounds resets map's pitch to 0 mapbox#7597
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Nov 23, 2018
1 parent 5401d2f commit 61156f8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
}

Expand Down

0 comments on commit 61156f8

Please sign in to comment.