Locations stay ordinary records
Every store carries identity, coordinates, label, and revenue in one row source.
Canonical Grid model
Show store locations on a map.
What this model gives you
10 min to study · Source reviewed 2026-08-25
Continue with guided practiceExpected checkpoint
After loading the authored San Francisco, Oakland, and San Jose rows.
Every store carries identity, coordinates, label, and revenue in one row source.
The layer maps latitude, longitude, and name without moving calculations into the renderer.
Changing a row updates model totals and the same bound layer.
MODEL "Store Map"
DESCRIPTION "Show store locations on a map."
VERSION "1.0.0"
AUTHOR "AI Agent"
TAGS "surface-template", "map", "locations", "surfaces"
Stores = [
{ id: "SFO", name: "San Francisco", latitude: 37.7749, longitude: -122.4194, revenue: 125000 },
{ id: "OAK", name: "Oakland", latitude: 37.8044, longitude: -122.2712, revenue: 92000 },
{ id: "SJC", name: "San Jose", latitude: 37.3382, longitude: -121.8863, revenue: 111000 }
]
TotalRevenue IS currency = SUM(MAP(Stores, store => store.revenue))
Store_Map!type = "map"
Store_Map!config = """
version = 1
kind = "map"
title = "Store Map"
[layout]
basemap = "streets"
center = [37.7749, -122.4194]
zoom = 9
[[layers]]
name = "Stores"
bind = "Stores"
lat = "latitude"
lng = "longitude"
label = "name"
color = "#2563eb"
"""
Store_Map!data = ""
END MODEL