Fix URL zoom being ignored on initial load (Fixes #59)

This commit is contained in:
James Lyne 2021-07-29 14:14:01 +01:00 committed by GitHub
parent ea9687b6ef
commit f5002ed828
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,6 +178,11 @@ export default defineComponent({
// Otherwise pan to url location, if present
} else if(store.state.parsedUrl?.location) {
location = store.state.parsedUrl.location;
if(!oldValue) {
this.scheduledZoom = store.state.parsedUrl?.zoom || store.state.configuration.defaultZoom;
}
store.commit(MutationTypes.CLEAR_PARSED_URL, undefined);
// Otherwise pan to world center
} else {
@ -185,7 +190,7 @@ export default defineComponent({
}
if(!oldValue) {
this.scheduledZoom = store.state.parsedUrl?.zoom || store.state.configuration.defaultZoom;
this.scheduledZoom = this.scheduledZoom || store.state.configuration.defaultZoom;
}
//Set pan location for when the projection changes