moveTo parameter working if layer is found

This commit is contained in:
Hanusiak Piotr 2022-01-20 15:10:54 +01:00
parent cb0c5beecf
commit e87c0a07a4
4 changed files with 57 additions and 8 deletions

View file

@ -49,12 +49,13 @@ class UrlManager {
return hash.length > 1 ? hash.substring(1) : null;
}
public getHashParameters(): Record<string, string> {
return window.location.hash.split("&").reduce((res: Record<string, string>, item: string) => {
public getHashParameter(name: string): string | undefined {
const parameters = window.location.hash.split("&").reduce((res: Record<string, string>, item: string) => {
const parts = item.split("=");
res[parts[0]] = parts[1];
return res;
}, {});
return parameters[name];
}
pushStartLayerNameToUrl(startLayerName: string): void {