Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Developing Mobile Web ArcGIS Applications

You're reading from   Developing Mobile Web ArcGIS Applications Learn to build your own engaging and immersive geographic applications with ArcGIS

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784395797
Length 156 pages
Edition 1st Edition
Tools
Arrow right icon
Toc

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:

The Geolocation API

Showing current location using the Geolocation API

Most modern mobile browsers support the Geolocation API...

You have been reading a chapter from
Developing Mobile Web ArcGIS Applications
Published in: Feb 2015
Publisher:
ISBN-13: 9781784395797
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image