How does google map location works?

て烟熏妆下的殇ゞ 提交于 2019-12-06 05:55:43
Matej P.

It's a bit inaccurate question to ask "How does google map location works", because Google Maps app (as well as any application leveraging google maps API) is just a consumer of location services on your device and is not used to determine the current location itself.

Because Google Maps is just an application, it can be run inside browser, or as native application. Depending on that, the way how it gets to your location information may also vary.

If you run the Google Maps from web browser (or WebView, or UIWebView,..) it usually uses HTML 5 geolocation API to determine your location and then use that to show your position on Google Maps. HTML5 geolocation then uses some lower level services to get your location, like GPS sensor, WIFI, network etc. There are already questions on how HTML 5 geolocation determines your position on SO, like this one or this one.

If your app is run as standalone application, it depends on your platform, your device sensors, your network,.. how the location is determined. So for example on Android with GPS sensor, LocationManager is used, which retrieves the location again using GPS, or from network provider, or returns last known location, etc. There's a lot of various interesting techniques behind this, which you can look up yourself (For example to determine your location using Wifi, Google has a database of WIFI SSIDs and their locations retrieved using anonymous device tracking and is able to roughly tell your location only from Wifi networks around you.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!