Game Development Reference
In-Depth Information
position shared with the application, any subsequent calls to get the current position
will be successful right away. Of course, the user can just as well clear the permis-
sions for a given domain right from the browser, so any subsequent calls to get the
position may fail (if the user has disabled the feature altogether) or result in a new
request for permission (in case the user simply cleared the permissions cache on the
browser).
As you can see from the following screenshot, Google Chrome displays a different
icon on the address bar when a page is using geolocation to let the user know about
it. By clicking this special icon, the user can reset the permissions, or block or allow
the application on a more long term basis.
A Google Maps example
Possibly the most common use case for geolocation these days involves rendering
a position to a map. Thankfully, Google offers a terrific, free API that we can tap
into for the purposes of doing just that. With this mapping service, we can capture a
Search WWH ::




Custom Search