What is missing
A way to give a <Map> its overlays as data. Today they can only be child
nodes — MapProps has no polylines, markers or annotations array — so a
map of N shapes is N nodes in the document.
Why it matters
Wildloop's territory map asks the API for up to 500 zones and draws one boundary each:
<Map testID="territory-map" :fitToBounds="true" mapType="standard">
<MapPolyline :for="shape in shapes()" :key="shape.id"
:geometry="shape.geometry" :strokeColor="shape.color" :strokeWidth="3" />
</Map>Each of those is a createNode plus an insertChild plus an updateNode
carrying a flat coordinate array, through the mutation protocol, for something
the host immediately flattens back into [CLLocationCoordinate2D]. The node
tree gains hundreds of children that exist only to be read once as geometry.
It also makes the overlay set harder to reason about from the outside. Tracing
why a map was not framing its content, I had to establish from the operation
stream whether looped children were reaching configure at all:
RENDER map children: ["MapPolyline"] ← the :for template
INSERTS INTO MAP: n54, n55 ← the real ones, later
MAP NODE PATCHES: [] ← the Map itself never patchedThat turned out to be fine — insertChild adds the parent to affectedNodeIds
and the map is reconciled — but a data prop would make it a non-question.
What would help
Accept arrays alongside the children, the way the underlying SDKs do:
export interface MapProps extends BaseProps {
polylines?: Array<{ id: string, geometry: number[], strokeColor?: string, strokeWidth?: number }>
markers?: Array<{ id: string, geometry: number[], title?: string, bearing?: number }>
}Children stay for the handful-of-shapes case; the array is for the hundreds
case. configure already builds nextPolylines / nextMarkers dictionaries
keyed by id, so the shape of the data matches what the host wants.
Versions
craft-native 0.0.237, @stacksjs/stx 0.2.563, iOS 26.5 simulator.