Dev Helpers

React / Coordinates and maps

Geo URI anchor

Dev Helpers · October 17, 2025

A geographic link passes coordinates to a compatible map application. Give the link readable place information for browsers that handle the scheme differently.

Worked example

// components/GeoURIAnchor.tsx

export default function GeoURIAnchor({
  lat = 43.65,
  lon = -79.38,
}: { lat?: number; lon?: number } = {}) {
  return <a href={"geo:" + lat + "," + lon}>Open coordinates in maps</a>;
}

Implementation notes

A geo URI is an enhancement for devices with a compatible handler. Provide enough human-readable location detail to remain useful without one.

Try it yourself

Try negative longitude and inspect the generated destination.

Open the React example →

Editorial date October 17, 2025 · Published December 6, 2026

Related articles

Percentage meter

A percentage meter needs both a bounded visual fill and a meaningful textual value. Handle a zero denominator before dividing.

Vertical typesetting sample

Vertical typesetting changes the reading direction and available inline space. Treat the sample text as content so it remains selectable and accessible.

Square cover crop

A square image crop gives a card grid consistent geometry. The crop anchor determines whether the most important part of a photo survives.