U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you're on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Skip to page content

Wherever You Go, There We Are: the Geolocation API

No matter how you go mobile, you can meet your user’s needs. Recommendations based on location are plentiful, particularly on native apps. But don’t fret, agencies with mobile websites: you can also get in the location customization game.

Mobile phone gps navigation, travel destination, location and positioning concept of a map and single marker over a smart phone

Geolocation is a W3C scripting API that can be used with JavaScript in Web browsers. In the past, geolocation could only be done in native apps through a mobile programming API. With the Geolocation API, a mobile web app can request a user’s location.

Screen capture of the Find Your Park service on an iPhone asking for permission to use the phone's Current Location.
There are numerous ways federal agencies could use this API. For example, the National Park Service (NPS)’s FindYourPark.com provides customized recommendations based on a user’s location. As noted in a previous DigitalGov article, NPS metadata from NPS.gov is pulled over to the FindYourPark website, including information about Centennial Rvents and the maps for the find feature.

Geolocation is not part of W3C HTML5 or the WHATWG HTML. However, W3C has published specifications to standardize this API to retrieve the geographical location information for a client-side device.

Additional Resources:

Tags: , , ,

GitHub LogoEdit
Top