Skip to content

location

A location represents a geographical position and accepts one of three forms:

( [ <real>, <real> ] | [] | null )
  • Two-dimensional coordinate — a pair of reals giving a position within the topography.
  • Empty array [] — the location is inferred or calculated when needed.
  • null — no location supplied or required; the resource could be anywhere.

This accommodates scenarios where precise coordinates aren’t immediately available, letting Spiral determine positioning dynamically from context.

In the Helix client a stop’s at is stored as a small object that carries the coordinate above plus the human-readable place it was resolved from. Spiral only ever receives the coordinate (at.at); the area and address fields are a Helix presentation extension.

at: { at: ( [ <real>, <real> ] | [] | null ), area: string | null, address: string | null }
  • at — the coordinate (or [] / null) exactly as above.
  • area — a short locality name (e.g. town / district) shown in the stop editor and used for a general address search.
  • address — a full formatted address; present only for a precise location and searched with the accurate geocoding provider.

The combination of these fields expresses one of four location modes, which the stop editor rotates through. Which modes a stop offers is controlled by helix.locationType:

ModeStored asMeaning
anyat: []Anywhere — no fixed position; Spiral places it freely.
derivedat: nullInherited / computed from context (e.g. a child stop taking its parent’s position).
areaat: [lat,lng] + areaA general locality (area search).
preciseat: [lat,lng] + area + addressAn exact address (accurate geocoding).

helix.locationType is an array of the modes a stop type allows. When unset it defaults to ["any","derived","area"]; destination / incident stops typically use ["derived","precise"].