Skip to main content

Map Coordinates

The coordinates card (MapCoordinatesPopover) shows the point under the cursor in every format an operator might be asked for. There are three ways to open it, and they all open the same card:

EntryWhereNotes
Get Coordinates map buttonMap action buttons (the + stack)Arms one map click. Added because right-click was invisible to anyone who had not been told about it.
Right-clickDesktopUnchanged.
Long-pressTouchUnchanged (ArcGIS hold, touch pointers only).

The button's pick mode​

Pressing Get Coordinates arms useMapCoordinatePickStore (stores/mapCoordinatePickStore.ts). While armed, useCoordinateMapPick (hooks/featureMap/useCoordinateMapPick.ts, mounted by FeatureMap):

  • swaps the map cursor for a crosshair with a blue centre dot (an inline SVG cursor with the stock crosshair as fallback), so the mode is visible at the pointer itself;
  • shows an info toast, "Click the map to get coordinates. Esc to cancel.";
  • holds ArcGIS popups back and takes the next click with stopPropagation, so a camera pin, an alert or a boundary under the cursor does not also react (FeatureMap.onLayerClicked checks the store as well, because handler order between separately registered view listeners is not ours to rely on);
  • reports the map point and its client coordinates to FeatureMap, which sets the same coordPopover* state the right-click handler sets, then disarms.

One pick per arming, like the right-click it mirrors. Esc or a second press of the button disarms it, and unmounting the map disarms it too, so a hidden map never comes back swallowing clicks. It and the area filter's "tap a boundary" mode are mutually exclusive: arming one disarms the other, since two modes cannot both own the next click.

Lit buttons​

MapButtonsOpenState marks a button whose mode is on or armed with floatingActionbuttonActive: a filled accent button with a white icon and aria-pressed="true": Get Coordinates, while armed. (The Real-Time Cameras toggle that also used it was removed when the Velocity layers became the only camera source.) Note that an inline icon colour never shows here, because the stylesheet's icon colour rule outranks it — put the state on the Fab's class.