From b2f58f681c500a7155b08aa2a76795fe3bbc3f8e Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 7 Sep 2021 23:08:44 +0100 Subject: [PATCH] Fully support Pl3xmap URLs --- src/App.vue | 3 ++- src/util.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index adc2e46..662060b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -121,7 +121,8 @@ export default defineComponent({ //Remove legacy url if one was parsed if(parsedUrl.legacy) { const url = new URL(window.location.href); - url.searchParams.delete('worldname'); + url.searchParams.delete('worldname'); //Dynmap + url.searchParams.delete('world'); //Pl3xmap url.searchParams.delete('mapname'); url.searchParams.delete('x'); url.searchParams.delete('y'); diff --git a/src/util.ts b/src/util.ts index 8b8649f..fd92a13 100644 --- a/src/util.ts +++ b/src/util.ts @@ -156,11 +156,11 @@ export const parseMapHash = (hash: string) => { } export const parseMapSearchParams = (query: URLSearchParams) => { - const world = query.get('worldname') || undefined, + const world = query.get('worldname') /* Dynmap */ || query.get('world') /* Pl3xmap */ || undefined, map = query.get('mapname') || undefined, location = [ query.get('x') || '', - query.get('y') || '', + query.get('y') || '64', query.get('z') || '' ].map(item => parseFloat(item)).filter(item => !isNaN(item) && isFinite(item)), zoom = query.has('zoom') ? parseInt(query.get('zoom') as string) : undefined;