Map

Displays a simple map with one marker.

GDPR compliant

Frontmatter

blocks:
  - type: map
    heading: {} # (optional)
      surtitle: '' # string (optional)
      title: '' # string (optional)
      text: '' # markdown (optional)
    show_places: false # boolean (optional *)
    location: {} # GeoJSON point, from the CMS map widget (optional *)
    coordinates: {} # (optional *)
      lat: '' # float
      lng: '' # float
    zoom: 13 # [1…20] (optional)
    marker_hidden: false # boolean, renders the map without its marker (optional)
    ui: {} # (optional)
      theme: '' # [accent, black, dark, highlight, light, neutral, white] (optional)
      grid: '' # [xsmall, small, medium, large, container, full] (optional)
      offset: '' # [start, center, end] (optional)
      align: '' # [start, center, end] (optional)

* Pick one: location (the CMS map widget), coordinates (an object with lat and lng), or show_places (one marker per page of your places section). show_places wins over the other two.

See Common keys for heading, footing and the full ui reference.

Demo visual renderer

Files

CMS availability

CMSHugolify Admin v2
CloudCannonWithout the map widget
Decap CMSAvailable
Netlify CMSAvailable
Pages CMSWithout the map widget
Static CMSAvailable
Sveltia CMSAvailable
Tina CMSWithout the map widget

CloudCannon, Pages CMS and Tina CMS have no map widget, so the admin gives them a coordinates object with lat and lng fields instead of the location picker. The block itself works the same.