Apia saysThe Geolocation API returns the device’s coordinates after permission.
navigator.geolocation.getCurrentPosition(onSuccess, onError, options) prompts and, if allowed, returns coords.latitude/longitude/accuracy. watchPosition tracks live movement (clear with clearWatch). Requires HTTPS. Always provide the error callback — users deny, and devices fail.
Power-ups you unlock
getCurrentPosition(success, error, options)
coords.latitude/longitude/accuracy
watchPosition/clearWatch for live tracking
HTTPS required; always handle denial
Legacy Larry attacks — common mistakes
No error callback (silent failure)
Expecting it on http:// pages
Polling getCurrentPosition instead of watchPosition
Boss battleRequest the position and print lat/lon, with a graceful denial message.