Handle pl3xmap world default zoom

This commit is contained in:
James Lyne 2021-12-10 15:54:55 +00:00
parent 2ab03f8fde
commit cbd6c7f3b9
3 changed files with 4 additions and 2 deletions

View File

@ -189,7 +189,7 @@ export default defineComponent({
location = store.state.parsedUrl.location;
if(!oldValue) {
this.scheduledZoom = store.state.parsedUrl?.zoom || store.state.configuration.defaultZoom;
this.scheduledZoom = store.state.parsedUrl?.zoom || newValue.defaultZoom || store.state.configuration.defaultZoom;
}
store.commit(MutationTypes.CLEAR_PARSED_URL, undefined);
@ -198,7 +198,7 @@ export default defineComponent({
location = newValue.center;
}
this.scheduledZoom = this.scheduledZoom || store.state.configuration.defaultZoom;
this.scheduledZoom = this.scheduledZoom || newValue.defaultZoom || store.state.configuration.defaultZoom;
//Set pan location for when the projection changes
this.scheduledPan = location;

1
src/index.d.ts vendored
View File

@ -182,6 +182,7 @@ interface LiveAtlasWorldDefinition {
displayName: string;
dimension: LiveAtlasDimension;
center: Coordinate;
defaultZoom?: number;
maps: Map<string, LiveAtlasMapDefinition>;
}

View File

@ -150,6 +150,7 @@ export default class Pl3xmapMapProvider extends MapProvider {
dimension,
seaLevel: 0,
center: {x: worldResponse.spawn.x, y: 0, z: worldResponse.spawn.z},
defaultZoom: worldResponse.zoom.def || 1,
maps,
};