Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
426 views
in Technique[技术] by (71.8m points)

Google Maps Geolocation API

Im writing an application that gets the geolocation from a given MAC address I implemented a client as shown on the tutorial:

https://developers.google.com/maps/documentation/business/geolocation/#auth

all I get back is a result of geocoordinates: Longitude: -6.3150542 Latitude: 53.3603142 this is independent from the Mac I enter. Has anyone successfully implemented a client that works with this API ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The Geolocation Maps API you are using return JSON which consist of Latitude, Longitude and accuracy. If you are getting this response then your implementation is correct. Make sure to put the MAC address of the access point and not your device in the WifiAccessPoint Object is the body of the POST request.

Later you can parse the JSON for the coordinates to display on the maps or display as toast or textview. The Geolocation API figures out the approximate location your device by location the cell tower or the Wi-Fi access point from where you are getting your internet data/connection.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...