umap/docs-users/support/advanced.md
2024-06-26 14:16:16 -04:00

31 lines
1.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# uMap advanced usages
## Preloading a map with data {: #preloading-data }
You can preload a map using the `data` or the `dataUrl` parameter:
* The `data` parameter must be URI encoded
(using JavaScripts `encodeURIComponent()` for instance).
* The `dataURL` parameter must link to an encoded URL
(using JavaScripts `encodeURIComponent()` for instance).
You can add the `dataFormat` parameter given the nature of your data:
* `geojson` (default)
* `csv`
* `gpx`
* `georss`
* `kml`
* `osm`
This example, using the `data` parameter, will load a map with a marker
set on Niagara Falls from CSV formatted data:
https://umap.openstreetmap.fr/en/map/?data=name%252Clatitude%252Clongitude%250ANiagara%20Falls%252C43.084799710219066%252C-79.0693759918213&dataFormat=csv
That example, using the `dataUrl` parameter, will load a map with
borders for Arles, dynamically fetched from
[geo.api.gouv.fr](https://geo.api.gouv.fr/) in GeoJSON:
https://umap.openstreetmap.fr/en/map/?dataUrl=https%3A%2F%2Fgeo.api.gouv.fr%2Fcommunes%3Fcode%3D13004%26format%3Dgeojson%26geometry%3Dcontour