From c6098403e4830e9db732901b9f19729debc10809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Wed, 13 Nov 2019 20:00:31 +0100 Subject: [PATCH 1/2] Allow the hash param to be a string or a boolean. --- src/components/map/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/map/options.js b/src/components/map/options.js index 60bb2898..8ce369a0 100755 --- a/src/components/map/options.js +++ b/src/components/map/options.js @@ -22,7 +22,7 @@ export default { required: true }, hash: { - type: Boolean, + type: [Boolean, String], default: false }, interactive: { From ffb1f62e4f4a90de4e4a315ab18831852430eb96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Wed, 13 Nov 2019 20:06:37 +0100 Subject: [PATCH 2/2] Update the doc about the new type of the hash param. --- docs_source/api/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs_source/api/README.md b/docs_source/api/README.md index 42eb45e4..36a74c09 100644 --- a/docs_source/api/README.md +++ b/docs_source/api/README.md @@ -50,10 +50,10 @@ ### `hash` -- **Type:** `Boolean` +- **Type:** `Boolean`, `String` - **Default:** `false` - **Synced** -- **Description:** If true, the map's position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page's URL +- **Description:** If true, the map's position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page's URL. If it's a string, it will be the name of the param in a parameter-styled hash. - **See:** `options.hash` in [Map](https://docs.mapbox.com/mapbox-gl-js/api/#map) ### `interactive`