Draw and update zones
A zone marks an area with something to say about it: a closure, an avalanche bulletin, a permit boundary. It carries a severity level and an optional validity window, and is published as an itinerary is.
Writes act as a member, so mint a session token that names one, as in the quickstart:
Send the area as a GeoJSON Feature holding one Polygon, with a level that sets how a map styles it:
A new zone is a draft that only your members see. Its level is info, warning, danger or resolved. Leave out start_at and end_at for a zone in force from now on, with no end.
PATCH the fields that change. A field you leave out keeps its value:
Send a new geojson to redraw the area, and null to clear the description or either end of the window.
Send a source in place of geojson, and Mountaya computes the area: here, the ground reachable on foot within an hour of a trailhead.
The zone keeps its source. Send it again in a PATCH to compute the area afresh.
active_at lists the zones whose window holds that instant. With a member's token, the listing holds drafts and private zones too:
The public sees a zone once you publish it. A zone publishes the way an itinerary does: see publishing. Share it through a collection, since a zone has no share link of its own.