From a256168f1c82f16759dc85e45210d9731a37f214 Mon Sep 17 00:00:00 2001 From: Stepan Kuzmin Date: Wed, 25 Jul 2018 18:02:32 +0300 Subject: [PATCH] resize map before setting initial view #1970 --- src/ui/map.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui/map.js b/src/ui/map.js index 0ca2237ece4..53ecfc2290c 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)