0

I am having some trouble understanding how the Google Maps Geolocation API can be implemented. From the intro documentation :

"The Google Maps Geolocation API returns a location and accuracy radius based on information about cell towers and WiFi nodes that the mobile client can detect."

It says 'mobile-client', does this mean I can't use it for non-mobile users? Also, how the heck am I supposed to get information on cell towers and WiFi nodes for a non-mobile user?

connected_user
  • 814
  • 1
  • 9
  • 25

1 Answers1

1

This feature has been built primarly for mobile devices, but it can be used for 'desktops'. Take a look at the request body fields (below the main introduction), there is a considerIp:

considerIp: Specifies whether to fall back to IP geolocation if wifi and cell tower signals are not available. Note that the IP address in the request header may not be the IP of the device. Defaults to true. Set considerIp to false to disable fall back.

this considerIp is per default, true. So the API will use the user's IP to geolocate it. You don't have to change anything if you want to use this as a fallback.

You can read more about this in this thread.

Christian Benseler
  • 7,907
  • 8
  • 40
  • 71
  • Thanks! Now let's say I were to implement this API for mobile devices, how do I go about getting the info for the other paramaters (cellId,locationAreaCode,mobileNetworkCode, etc.)? – connected_user Jun 26 '17 at 18:49
  • I guess that to retrieve those data you will have to access specifics APIs from the device or from HTML5. I really don't know how to answer this question. – Christian Benseler Jun 26 '17 at 19:02
  • Thanks for the reply! Yeah, I am somewhat surprised that Google talks about this awesome service they provide but leaves out information on the methods used to get the details their service requires. – connected_user Jun 26 '17 at 19:04
  • As long as those fields are optional, the service does not require them, and those info are not related to the Geolocation API itself, so I don't think this is a faul. – Christian Benseler Jun 26 '17 at 19:22