From cb0c5beecfde3c50c96acc7256f0d5385dfd7de1 Mon Sep 17 00:00:00 2001 From: Hanusiak Piotr Date: Thu, 20 Jan 2022 14:14:24 +0100 Subject: [PATCH] get additional hash parameters from url --- front/src/Url/UrlManager.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/front/src/Url/UrlManager.ts b/front/src/Url/UrlManager.ts index 011efa5a..c6e463e4 100644 --- a/front/src/Url/UrlManager.ts +++ b/front/src/Url/UrlManager.ts @@ -49,6 +49,14 @@ class UrlManager { return hash.length > 1 ? hash.substring(1) : null; } + public getHashParameters(): Record { + return window.location.hash.split("&").reduce((res: Record, item: string) => { + const parts = item.split("="); + res[parts[0]] = parts[1]; + return res; + }, {}); + } + pushStartLayerNameToUrl(startLayerName: string): void { window.location.hash = startLayerName; }