Skip to content

YAML front-matter config

The real power of Overpass Ultra lies in it's easy configuration of MapLibre with the a query's YAML front-matter.

style

Customize the MapLibre style. See Styling for more information.

Example:

---
style: https://example.com/style.json
---

server

Use a different Overpass API server.

Example:

---
server:  https://overpass.private.coffee/api/
---

Only applies to Overpass queries.

popupTemplate

Customize the interactive popup with a LiquidJS template. Or set it to false to disable the interactive popup.

---
popupTemplate: "{{type}} {{id}} - {{tags.name}}"
---

type

Specify the type of source in the query.

Default: overpass

overpass

An Overpass QL query. Results converted into a GeoJSON source with osmtogeojson.

osmxml

An OSM XML document or a URL to one. Converted into a GeoJSON source with osmtogeojson.

osmjson

An OSM JSON document or a URL to one. Converted into a GeoJSON source with osmtogeojson.

geojson

A JSON-encoded GeoJSON object or a URL to a GeoJSON file.

raster

A line delimited list of tile URLs for a raster source or a TileJSON url

vector

A line delimited list of tile URLs for a vector source or a TileJSON url

options

When an Overpass Ultra query is run in "interactive map" mode, you can specify the MapOptions that are passed to the MapLibre constructor.

For example, you can use this to fit to bounds rather than relying on the z/x/y URL parameters, making for a more consistent experience across screen sizes. EG:

---
options:
  bounds: [-77.64656066894544,37.577235791111384,-76.92558288574232,38.13563674858875]
---

controls

When an Overpass Ultra query is run in "interactive map" mode, you can specify controls to be added to the map with the controls key in the YAML-front matter. The key should contain a list of objects. Each object must specify a type key containing the name of a control present in MapLibre. It can optionally contain an options key who's contents are passed to the control's constructor and a position key that is passed to map.addControl.

For example, to add a NavigationControl to your map:

---
controls:
  - type: NavigationControl
    options:
      visualizePitch: true
    position: bottom-left
---

querySources

Specify which sources can be queried by mouse-click

---
querySources: [ultra] # this is the default
---