Google地图地理位置API [英] Google Maps Geolocation API

查看:220
本文介绍了Google地图地理位置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/#authrel =nofollow> https://developers.google.com/maps/documentation/business/geolocation/#auth

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

我找回的是地理坐标的结果:
经度:-6.3150542
纬度:53.3603142
这是独立于Mac我进入。
是否有人成功实现了使用此API的客户端?

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 ?

推荐答案

您正在使用的Geolocation Maps API会返回由经度,纬度和准确度组成的JSON。如果你得到这个回应,那么你的实现是正确的。确保将接入点的MAC地址,而不是您的设备的WifiAccessPoint对象是POST请求的主体。

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.

稍后,您可以解析JSON坐标显示在地图上或显示为烤面包或文本视图。 Geolocation API根据您的互联网数据/连接的位置,通过定位手机信号塔或Wi-Fi接入点来确定设备的大致位置。

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.

这篇关于Google地图地理位置API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆