Skip to content

Commit

Permalink
resize map before setting initial view #1970
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Oct 8, 2018
1 parent 71400b2 commit 6513cd1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,12 @@ class Map extends Camera {

bindHandlers(this, options);

this.resize();

this._hash = options.hash && (new Hash()).addTo(this);
// don't set position from options if set through hash
if (!this._hash || !this._hash._onHashChange()) {
if (options.bounds) {
this.resize();
this.fitBounds(options.bounds, { duration: 0 });
} else {
this.jumpTo({
Expand All @@ -383,8 +384,6 @@ class Map extends Camera {
}
}

this.resize();

if (options.style) this.setStyle(options.style, { localIdeographFontFamily: options.localIdeographFontFamily });

if (options.attributionControl)
Expand Down

0 comments on commit 6513cd1

Please sign in to comment.