Skip to content

MapBlockSchema

const MapBlockSchema: z.ZodObject<any>

Defined in: packages/core/src/schemas/map.schema.ts:871

Standard map block.

Creates a map within a page layout. Can be sized using CSS via className and style properties.

Basic Map Block

- type: map
id: main-map
config:
center: [-74.006, 40.7128]
zoom: 12
mapStyle: "https://demotiles.maplibre.org/style.json"
layers:
- id: points
type: circle
source:
type: geojson
url: "https://example.com/points.geojson"
paint:
circle-radius: 8
circle-color: "#ff0000"

Map with Controls and Legend

- type: map
id: interactive-map
config:
center: [-74.006, 40.7128]
zoom: 12
mapStyle: "https://demotiles.maplibre.org/style.json"
layers:
- $ref: "#/layers/bikeLayer"
- $ref: "#/layers/parkLayer"
controls:
navigation: true
scale: true
legend:
title: "Map Features"
position: top-left

Sized Map

- type: map
id: small-map
className: "map-container"
style: "height: 400px; width: 100%;"
config:
center: [0, 0]
zoom: 2
mapStyle: "https://demotiles.maplibre.org/style.json"