Cleanup url getter
This commit is contained in:
parent
46fc602a96
commit
8382142cb2
@ -68,16 +68,11 @@ export const getters: GetterTree<State, State> & Getters = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
url(state: State): string {
|
url(state: State): string {
|
||||||
const x = state.currentLocation.x,
|
|
||||||
y = state.currentLocation.y,
|
|
||||||
z = state.currentLocation.z,
|
|
||||||
zoom = state.currentZoom;
|
|
||||||
|
|
||||||
if(!state.currentWorld || !state.currentMap) {
|
if(!state.currentWorld || !state.currentMap) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return getUrlForLocation(state.currentMap, {x,y,z}, zoom);
|
return getUrlForLocation(state.currentMap, state.currentLocation, state.currentZoom);
|
||||||
},
|
},
|
||||||
|
|
||||||
pageTitle(state: State): string {
|
pageTitle(state: State): string {
|
||||||
|
@ -193,7 +193,7 @@ const validateParsedUrl = (parsed: any) => {
|
|||||||
|
|
||||||
export const getUrlForLocation = (map: LiveAtlasMapDefinition, location: Coordinate, zoom: number): string => {
|
export const getUrlForLocation = (map: LiveAtlasMapDefinition, location: Coordinate, zoom: number): string => {
|
||||||
const x = Math.round(location.x),
|
const x = Math.round(location.x),
|
||||||
y = Math.round(location.y || 0),
|
y = Math.round(location.y),
|
||||||
z = Math.round(location.z),
|
z = Math.round(location.z),
|
||||||
locationString = `${x},${y},${z}`;
|
locationString = `${x},${y},${z}`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user