Merge pull request #304 from cbiteau/fix_parse_hash_for_negative_values

Make parseHash function working with negative values
This commit is contained in:
gluap 2023-01-08 13:05:10 +01:00 committed by GitHub
commit 94d23adcd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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]),