Skip to content

Commit 822d7a8

Browse files
committed
make hash parameter format explicit in documentation
1 parent c721949 commit 822d7a8

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

API.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ of iD (e.g. `https://ideditor-release.netlify.app`), the following parameters ar
1515
`{z}`/`{zoom}`, `{ty}` for flipped TMS-style Y coordinates, and `{switch:a,b,c}` for
1616
DNS multiplexing.<br/>
1717
_Example:_ `background=custom:https://tile.openstreetmap.org/{zoom}/{x}/{y}.png`
18-
* __`comment`__ - Prefills the changeset comment. Pass a url encoded string.<br/>
18+
* __`comment`__ - Prefills the changeset comment.<br/>
1919
_Example:_ `comment=CAR%20crisis%2C%20refugee%20areas%20in%20Cameroon`
2020
* __`disable_features`__ - Disables features in the list.<br/>
2121
_Example:_ `disable_features=water,service_roads,points,paths,boundaries`<br/>
@@ -24,7 +24,7 @@ of iD (e.g. `https://ideditor-release.netlify.app`), the following parameters ar
2424
* __`gpx`__ - A custom URL for loading a gpx track. Specifying a `gpx` parameter will
2525
automatically enable the gpx layer for display.<br/>
2626
_Example:_ `gpx=https://gist.githubusercontent.com/answerquest/9445352b60ca5b44714675eae00f243a/raw/56a6343a29223318f4a697bfd16cbb2c3b8155ad/sample_boundary.gpx`
27-
* __`hashtags`__ - Prefills the changeset hashtags. Pass a url encoded list of event
27+
* __`hashtags`__ - Prefills the changeset hashtags. Pass a list of event
2828
hashtags separated by commas, semicolons, or spaces. Leading '#' symbols are
2929
optional and will be added automatically. (Note that hashtag-like strings are
3030
automatically detected in the `comment`).<br/>
@@ -55,16 +55,19 @@ of iD (e.g. `https://ideditor-release.netlify.app`), the following parameters ar
5555
* __`presets`__ - A comma-separated list of preset IDs. These will be the only presets the user may select.<br/>
5656
_Example:_ `presets=building,highway/residential,highway/unclassified`
5757
* __`rtl=true`__ - Force iD into right-to-left mode (useful for testing).
58-
* __`source`__ - Prefills the changeset source. Pass a url encoded string.<br/>
58+
* __`source`__ - Prefills the changeset source.<br/>
5959
_Example:_ `source=Bing%3BMapillary`
60-
* __`validationDisable`__ - The issues identified by these types/subtypes will be disabled (i.e. Issues will not be shown at all). Each parameter value should contain a urlencoded, comma-separated list of type/subtype match rules. An asterisk `*` may be used as a wildcard.<br/>
60+
* __`validationDisable`__ - The issues identified by these types/subtypes will be disabled (i.e. Issues will not be shown at all). Each parameter value should contain a comma-separated list of type/subtype match rules. An asterisk `*` may be used as a wildcard.<br/>
6161
_Example:_ `validationDisable=crossing_ways/highway*,crossing_ways/tunnel*`
62-
* __`validationWarning`__ - The issues identified by these types/subtypes will be treated as warnings (i.e. Issues will be surfaced to the user but not block changeset upload). Each parameter value should contain a urlencoded, comma-separated list of type/subtype match rules. An asterisk `*` may be used as a wildcard.<br/>
62+
* __`validationWarning`__ - The issues identified by these types/subtypes will be treated as warnings (i.e. Issues will be surfaced to the user but not block changeset upload). Each parameter value should contain a comma-separated list of type/subtype match rules. An asterisk `*` may be used as a wildcard.<br/>
6363
_Example:_ `validationWarning=crossing_ways/highway*,crossing_ways/tunnel*`
64-
* __`validationError`__ - The issues identified by these types/subtypes will be treated as errors (i.e. Issues will be surfaced to the user but will block changeset upload). Each parameter value should contain a urlencoded, comma-separated list of type/subtype match rules. An asterisk `*` may be used as a wildcard.<br/>
64+
* __`validationError`__ - The issues identified by these types/subtypes will be treated as errors (i.e. Issues will be surfaced to the user but will block changeset upload). Each parameter value should contain a comma-separated list of type/subtype match rules. An asterisk `*` may be used as a wildcard.<br/>
6565
_Example:_ `validationError=crossing_ways/highway*,crossing_ways/tunnel*`
6666
* __`walkthrough=true`__ - Start the walkthrough automatically
6767

68+
Pass these parameters as a `x-www-form-urlencoded` string in the _hash_ portion of the URL, similarly to how you how a _query_ string of an URL is typically constructed. Input strings have to be [percent encoded](https://en.wikipedia.org/wiki/Percent-encoding) (spaces can be represented either as `+` or `%20`), for example using [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/toString) in Javascript.
69+
70+
6871
##### iD on openstreetmap.org (Rails Port)
6972

7073
When constructing a URL to an instance of iD embedded on the [OpenStreetMap website](github.com/openstreetmap/openstreetmap-website/) (e.g. `https://www.openstreetmap.org/edit?editor=id`), the following parameters

0 commit comments

Comments
 (0)