Make parseHash function working with negative values

This commit is contained in:
Charly BITEAU 2023-01-07 12:56:17 +01:00
parent c1ccec9664
commit d889abc798

View file

@ -31,7 +31,7 @@ export const withBaseMapStyle = connect((state) => ({
function parseHash(v: string): Viewport | null {
if (!v) return null;
const m = v.match(/^#([0-9\.]+)\/([0-9\.]+)\/([0-9\.]+)$/);
const m = v.match(/^#([0-9\.]+)\/([0-9\.\-]+)\/([0-9\.\-]+)$/);
if (!m) return null;
return {
zoom: Number.parseFloat(m[1]),