Allow a cached position
A fresh measurement is not always necessary. maximumAge lets a request accept a recent cached position, which can reduce waiting and device work.
What you will learn
- How
maximumAgeis measured in milliseconds - When a recent result is good enough
- Why a cached position still needs a visible timestamp or explanation
No request has been made.
Here maximumAge: 300000 allows a result up to five minutes old. Choose the age that matches the feature: a delivery map may need fresh data, while a broad local recommendation may not.