diff --git a/.agents/skills/astro-scripts/SKILL.md b/.agents/skills/astro-scripts/SKILL.md index 64a2cbe00..8dd800c96 100644 --- a/.agents/skills/astro-scripts/SKILL.md +++ b/.agents/skills/astro-scripts/SKILL.md @@ -66,6 +66,7 @@ const selector = `#wysiwyg-${id}` - `BEGIN … / END …` comments mark the block in the copied HTML. Use the component name in caps. - A named `init…` function plus the `readyState` guard, never a bare call: the script may be parsed after `DOMContentLoaded` has already fired. +- No `await` (and no `async` function) inside a captured ` +
{ mapEntries.map(([mapId, data]) => @@ -93,6 +158,201 @@ const places = [
+
+ + + Route + Draw a path with a GeoJSON line layer, and mark its ends with markers. + +
+
+
+ + + +
+
+
+ +
+ + + Area + Show a zone with a GeoJSON polygon: a fill layer and a line layer for its outline. + + + + + + +
+ +
+ + + Clusters + Group many points into clusters that split as you zoom in. Click a cluster to zoom to it. + + + + + + +
+ +
+ + + City switcher + Move the map to a place with flyTo when a button is clicked. +
+ { + cities.slice(0, 4).map((city, index) => ( + + )) + } +
+ + + + +
+
+
+ +
+ + + Bubble map + Size circles by a value, for example users per city. Hover a circle to see the number. + + + + + + +
+
diff --git a/shared/components/demo/Map.astro b/shared/components/demo/Map.astro index 310d78110..056cb5202 100644 --- a/shared/components/demo/Map.astro +++ b/shared/components/demo/Map.astro @@ -16,9 +16,10 @@ interface Props { zoom?: number; title?: string; style?: string; + controls?: boolean; } -const { mapId, ratio, center: centerProp, zoom: zoomProp, title, style: styleProp } = Astro.props; +const { mapId, ratio, center: centerProp, zoom: zoomProp, title, style: styleProp, controls: controlsProp } = Astro.props; type MapData = { title?: string | undefined; @@ -29,13 +30,13 @@ type MapData = { /** style used in dark mode, `dark` by default */ darkStyle?: string; /** adds the zoom and compass buttons */ - controls?: boolean; + controls?: boolean | undefined; zoom?: number | undefined; center?: [number, number]; markers?: { name?: string; center: [number, number] }[]; }; -const data: MapData | undefined = (maps as unknown as Record)[mapId] ?? (centerProp ? { title, center: centerProp, zoom: zoomProp, style: styleProp } : undefined); +const data: MapData | undefined = (maps as unknown as Record)[mapId] ?? (centerProp ? { title, center: centerProp, zoom: zoomProp, style: styleProp, controls: controlsProp } : undefined); const hasHtmlMarkers = Astro.slots.has('default'); const mapContainerId = `map-${mapId}`;