O'Reilly logo

Programming the Mobile Web by Maximiliano Firtman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Geolocation and Maps

One of the great features of mobile devices is that they can go everywhere with us. That is why the where is a very important context to be considered by our websites. Knowing the user’s location can help us to show useful contextual information. If I live in London, why should I receive a banner promotion from a shop in New York? Likewise, if I am on holiday in Singapore and I search for “pizza,” I would like to receive relevant information about where I can get it.

Location-based services (LBS) are one of the key features of modern mobile web applications. From our mobile websites, we can get the user’s location using many techniques. Mapping and LBS services are very popular right now, so it is easy to find web services and APIs from different providers and integrate them into our mobile websites.

Location Techniques

There are different techniques that we can use to determine the geographical location of a device, based on the platform, the browser, the operator, and so on. Most technologies involve server detection, but others depend on client detection, and we may even rely on the user’s input.

Accuracy

Every location technology has some accuracy error. This is usually specified in a distance metric, like meters or kilometers, but in some techniques accuracy is defined according to levels such as city accuracy or country accuracy.

Indoor Location

When we think about geolocation, we tend to think about the outside location—that is, where on the planet ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required