Merge pull request #1432 from umap-project/locate-easing
Set map default center even if waiting for user location
This commit is contained in:
commit
84d7c8771e
1 changed files with 5 additions and 1 deletions
|
@ -688,7 +688,11 @@ L.U.Map.include({
|
||||||
// FIXME An invalid hash will cause the load to fail
|
// FIXME An invalid hash will cause the load to fail
|
||||||
this._hash.update()
|
this._hash.update()
|
||||||
} else if (this.options.defaultView === 'locate' && !this.options.noControl) {
|
} else if (this.options.defaultView === 'locate' && !this.options.noControl) {
|
||||||
this.once('locationerror', this._setDefaultCenter)
|
// When using locate as default map view AND activating easing
|
||||||
|
// Leaflet.locate will ask the map view to compute transition to user
|
||||||
|
// position, so in this case we do need a default center, so let's
|
||||||
|
// set it anyway
|
||||||
|
this._setDefaultCenter()
|
||||||
this._controls.locate.start()
|
this._controls.locate.start()
|
||||||
} else if (this.options.defaultView === 'data') {
|
} else if (this.options.defaultView === 'data') {
|
||||||
this.onceDataLoaded(() => {
|
this.onceDataLoaded(() => {
|
||||||
|
|
Loading…
Reference in a new issue