I noticed that the google maps api has a option "sensor".
The approach to "get user's position in Google maps" is dependent on which devices you are targeting.
The HTML 5 Approach is meant for Androids, iPhones and other mobile platforms that have support for HTML5. In this case the browser is able to obtain the co-ordinates directly from the GPS without you having to write the code in the native language.
However if you are developing on say QT to target Symbians and the like, you'll need to write the code in the native language (C++ in my case) to acquire the co-ordinates from your GPS and post it to the server to update the user's current location. You'll find details about retrieving co-ordinates using Qt Mobility API here.
"sensor" in GMaps API is not an option, it is an information parameter. Here is what docs say:
Use of the Google Maps API(s) requires that you indicate whether your application is using a sensor (such as a GPS locator) to determine the user's location in any Maps API library or service requests.
Google Maps doesn't know anything of your users, so it cannot provide their location. It is the other way around: you can determine user's location and give it to Google Maps to place a location pointer and so on.
You have several options to get user's location in JS:
If you're developing for a sensor-equipped device (like a mobile phone with GPS reciever) there should be some vendor-specific ways to get the location directly from the device.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With