Book Image

Developing Mobile Web ArcGIS Applications

Book Image

Developing Mobile Web ArcGIS Applications

Overview of this book

Table of Contents (14 chapters)
Developing Mobile Web ArcGIS Applications
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The Geolocation API


One of the most fundamental requirements of any mobile ArcGIS app is its ability to enable users to find and show their current location on a map. This is where the Geolocation API comes in handy.

Note

The Geolocation API is a browser API that's part of JavaScript, but it is not related to ArcGIS.

On mobile devices, current location is derived from either GPS or cell tower triangulation. The Geolocation API taps into this data. Built-in security means that users need to provide permission before this functionality can be used in an application. Usually a popup will be displayed that will ask "The website x would like to use your current location". Clicking on the Allow button will give permission to the application. Building apps with the Geolocation API allows users to see and track their position on a map, and it is shown in the following screenshot:

Showing current location using the Geolocation API

Most modern mobile browsers support the Geolocation API.