Maps
Store geographic data in collections, filter it with spatial operators, and display records on interactive maps.
#Maps
EmuView has built-in geospatial support. Add a geo field to any collection and you can store points, lines, polygons and their multi-part forms as GeoJSON, query them with spatial filter operators, edit them on a map in the record form, and browse them on an interactive map view — all backed by Cloudflare D1 with no external GIS database.
Maps render with MapLibre GL JS, loaded on demand so non-map pages pay no bundle cost.
#What you can do
| Action | How |
|---|---|
| Store geographic data | Add one of the seven geo field types to a collection |
| Query spatially | Use the seven _geo_* filter operators in the records API or SDK |
| Edit on a map | Place markers, draw lines and polygons, or paste GeoJSON in the record form |
| Browse on a map | Switch a collection's record list from table view to map view |
| Import and export | Import GeoJSON, CSV, KML, and GPX files; export CSV, JSON, and GeoJSON |
| Publish and embed | Share a read-only map at a public URL or embed it in an iframe |
#Key concepts
| Concept | What it means |
|---|---|
| Geo field | A collection field that stores one GeoJSON geometry per record, expanded into indexed columns |
| GeoJSON | The storage and interchange format for all geometries. Coordinates are [longitude, latitude] |
| Spatial index | Every geometry is indexed with S2-style cell IDs so spatial queries run as ordinary SQL range scans |
| Spatial operator | A filter operator such as _geo_near or _geo_within that selects records by location |
| Post-filter | A precise geometry test applied after the coarse index scan, so results are exact |
| Published map | A saved, shareable map view with its own URL, access control, and embed code |
#How it fits together
Geo data flows from collection fields, through the filter pipeline, to map rendering:
flowchart LR
Field["Geo field<br>point · line · area<br>and their multi-part forms"] -->|indexed on write| Store[("D1 columns<br>+ S2 cell index")]
Store -->|"filter with _geo_* operators"| API["Records API<br>coarse scan + precise post-filter"]
API --> View["Map view<br>in the dashboard"]
API --> Published["Published map<br>/embed/:slug"]Writing a record with geo data computes its centroid, bounding box, and index cells automatically. Reading it back through a spatial filter uses the index for a coarse match, then verifies each candidate with an exact geometry test. The dashboard map view and published maps both consume the same records API.
#Guides in this section
- Geo fields — the seven geo field types, how storage works, and importing and exporting data
- Spatial queries — reference for the seven
_geo_*filter operators with HTTP and SDK examples - Map views — style the map view, configure popups and clustering, and publish an embeddable map