MapComplete/Docs/Dev/URL_Parameters.md

12 KiB

URL-parameters and URL-hash

This document gives an overview of which URL-parameters can be used to influence MapComplete.

Table of contents

  1. What is a URL parameter?
  1. language
  2. fs-translation-mode
  3. mode
  4. fake-user
  5. fs-enable-login
  6. fs-search
  7. fs-background
  8. fs-filter
  9. fs-welcome-message
  10. fs-community-index
  11. fs-iframe-popout
  12. fs-homepage-link
  13. fs-share-screen
  14. fs-geolocation
  15. fs-layers-enabled
  16. fs-all-questions
  17. fs-export
  18. fs-cache
  19. test
  20. debug
  21. moreprivacy
  22. overpassUrl
  23. overpassTimeout
  24. overpassMaxZoom
  25. osmApiTileSize
  26. background
  27. layer-

What is a URL parameter?

"URL-parameters are extra parts of the URL used to set the state.

For example, if the url is https://mapcomplete.org/cyclofix?lat=51.0&lon=4.3&z=5&test=true#node/1234, the URL-parameters are stated in the part between the ? and the #. There are multiple, all separated by &, namely:

  • The url-parameter lat is 51.0 in this instance
  • The url-parameter lon is 4.3 in this instance
  • The url-parameter z is 5 in this instance
  • The url-parameter test is true in this instance

Finally, the URL-hash is the part after the #. It is node/1234 in this case.

The URL-hash can contain multiple values:

  • The id of the currently selected object, e.g. node/1234

  • The currently opened menu view

Possible hashes to open a menu

The possible hashes are:

about_theme,background,copyright,copyright_icons,community_index,download,failedImages,favourites,filter,hotkeys,manageOffline,menu,privacy,search,share,usersettings

language

The language to display MapComplete in. The user display language is determined in the following order:

  1. Use the language as set by the URL-parameter language (following ISO 639-1 | ex. language=nl). This will disable setting the language by the user
  2. If the user did log in and did set their language before with MapComplete, use this language. This language selection is synchronized accross devices using the openstreetmap.org user preferences.
  3. If the user visited MapComplete before and did change their language manually, this changed language will be saved in local storage. Use the language from local storage
  4. Use the navigator-language (if available)
  5. Use English

Note that this URL-parameter is not added to the URL-bar by default. Note that the loading screen will always use the navigator language.

Translations are never complete. If a translation in a certain language is missing, English is used as fallback.

This documentation is defined in the source code at Locale.ts

No default value set

fs-translation-mode

If set, will show a translation button next to every string.

This documentation is defined in the source code at Locale.ts

The default value is false

mode

The mode the application starts in, e.g. 'map', 'dashboard' or 'statistics'

This documentation is defined in the source code at generateDocs.ts

The default value is map

fake-user

If true, 'dryrun' mode is activated and a fake user account is loaded

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is false

fs-enable-login

Disables/Enables logging in and thus disables editing all together. This effectively puts MapComplete into read-only mode.

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

Disables/Enables the search bar

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-background

Disables/Enables the background layer control where a user can enable e.g. aerial imagery

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-filter

Disables/Enables the filter view where a user can enable/disable MapComplete-layers or filter for certain properties

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-welcome-message

Disables/enables the help menu or welcome message

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-community-index

Disables/enables the button to get in touch with the community

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-iframe-popout

Disables/Enables the extraLink button. By default, if in iframe mode and the welcome message is hidden, a popout button to the full mapcomplete instance is shown instead (unless disabled with this switch or another extraLink button is enabled)

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

Disables/Enables the various links which go back to the index page with the theme overview

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-share-screen

Disables/Enables the 'Share-screen'-tab in the welcome message

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-geolocation

Disables/Enables the geolocation button

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-layers-enabled

If set to false, all layers will be disabled - except the explicitly enabled layers

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-all-questions

Always show all questions

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is false

fs-export

Enable the export as GeoJSON and CSV button

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

fs-cache

Enable/disable caching from localStorage

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is true

test

If true, 'dryrun' mode is activated. The app will behave as normal, except that changes to OSM will be printed onto the console instead of actually uploaded to osm.org

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is false

debug

If true, shows some extra debugging help such as all the available tags on every object

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is false

moreprivacy

If true, the location distance indication will not be written to the changeset and other privacy enhancing measures might be taken.

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is false

overpassUrl

Point mapcomplete to a different overpass-instance. Example: https://overpass-api.de/api/interpreter

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is https://overpass-api.de/api/interpreter,https://overpass.private.coffee/api/interpreter,https://overpass.osm.jp/api/interpreter

overpassTimeout

Set a different timeout (in seconds) for queries in overpass

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is 30

overpassMaxZoom

point to switch between OSM-api and overpass

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is 16

osmApiTileSize

Tilesize when the OSM-API is used to fetch data within a BBOX

This documentation is defined in the source code at FeatureSwitchState.ts

The default value is 17

background

When set, load this raster layer (or a layer of this category) as background layer instead of using the default background. This is as if the user opened the background selection menu and selected the layer with the given id or category.

Most raster layers are based on the editor layer index

Selecting a category

If one of the following values is used, this parameter will be interpreted as a category instead of the id of a specific layer. The best layer of this category will be used. Supported categories are those from the editor layer index and are:

  • photo
  • map
  • historicmap
  • osmbasedmap
  • historicphoto
  • qa
  • elevation
  • other

Selecting a specific layer

One can use the ID of an ELI-layer or use one of the global, builtin layers:

  • protomaps.sunny-self
  • protomaps.white
  • protomaps.light
  • protomaps.grayscale
  • protomaps.dark
  • protomaps.black
  • protomaps.sunny_unlabeled
  • americana
  • alidade.smooth
  • alidade.smooth_dark
  • stamen.terrain
  • stamen.toner
  • stamen.watercolor
  • stadia.bright
  • carto.positron
  • carto.dark_matter
  • carto.voyager
  • carto.positron_no_labels
  • carto.dark_matter_no_labels
  • carto.voyager_no_labels
  • cyclosm
  • EsriWorldImagery
  • EsriWorldImageryClarity
  • Mapbox
  • OpenAerialMapMosaic
  • osmfr-basque
  • osmfr-breton
  • osmfr
  • HDM_HOT
  • osmfr-occitan

This documentation is defined in the source code at FeatureSwitchState.ts

No default value set

layer-<layer-id>

Whether the layer with id is shown

This documentation is defined in the source code at QueryParameterDocumentation.ts

The default value is true

This document is autogenerated from src/Logic/Web/QueryParameters.ts, src/UI/QueryParameterDocumentation.ts