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 Jul 25, 2018
1 parent bb24c7d commit 5f53c01
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 @@ -366,11 +366,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 @@ -382,8 +383,6 @@ class Map extends Camera {
}
}

this.resize();

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

if (options.attributionControl) this.addControl(new AttributionControl());
Expand Down

0 comments on commit 5f53c01

Please sign in to comment.