Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
451 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...