如何使用 Uber API 获取我当前的位置?

How do I get my current location using Uber API?

假设我是 user/Uber driver,我如何使用优步 API 获取我的当前位置并在地图上标出位置?我想在地图上跟踪用户。所有这些都可以使用 Python API.

来完成

API 端点 /requests/current responds with a location object including lat & lng values. You could use these for your mapping feature. Otherwise, there's another method /requests/{request_id}/map 以 URL 响应 API 提供的地图。

至于Python,the SDK为您提供上述方法:

通过Python你可以通过他们的IP地址来追踪他们的位置。 This question talks about how to use FreeGeoIP to track their location. Using the IP address won't be perfectly accurate, so if you need a more accurate representation, you'll need a way to interact with the GPS system on a device. This question has an example of using Android and Python together, and agraebe mentioned you can use the HTML5 Geolocation features in his comment. Pythonista looks like a Python IDE for IOS that has a locations 服务。我对这些没有太多经验,但我希望其中一些资源能有所帮助。