diff --git a/src/ui/map.js b/src/ui/map.js index 3c96fded8cd..a9db59b99ab 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -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({ @@ -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());