使用 Google Map Tracks API [英] Using Google Map Tracks API

查看:33
本文介绍了使用 Google Map Tracks API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须开发一个车辆跟踪系统.我已经阅读了谷歌地图 API"和谷歌地图轨道 API 教程.即;

I have to develop a vehicle tracking system. I have gone through 'Google Map API' and Google Map Tracks API' tutorials. i-e;

Google 地图 API(网络).

Google Map Tracks API.

我的基本情况如下:

我们必须跟踪在车辆中移动的手机.移动设备上应该有一些应用程序来获取其当前位置并将此信息发送到某个服务器上的 Web 应用程序以进行监控.

We have to track the phone moving in a vehicle. There should be some application on mobile to get its current location and send this info to the web application on some server for monitoring purpose.

我不是要代码.我只是想知道

I am not asking for the code. I just want to know that

对于手机应用程序:我应该使用哪个部分(Google Map Tracks API 或其他)?开发电话应用程序的最佳语言是什么?

For phone application: What part should I use (Google Map Tracks API or something else)? What is the best language to develop a phone application?

对于 Web 应用程序:我应该使用 Google Map API 吗?开发 Web 部件的最佳语言是什么?

For Web Application: Should I use the Google Map API? What is the best language to develop the web part?

我唯一的困惑是为正确的设备选择正确的技术?我不确定 Google Map Tracks API(它应该是手机应用程序或网络应用程序的一部分,或者如何使用它?)

My only confusion is selection of right technology for right device? I am not sure about Google Map Tracks API (it should be part of phone application or web application or how to use this?)

还有一件事,我试图在 php 中设置 google map track api 的身份验证部分,并使用 google+ acount 凭据在我的本地主机(台式机)上成功地进行了身份验证.这也可以(php)在移动设备上运行吗?

One more thing, I was trying to set the authentication part of google map tracks api in php and successfully authenticated on my localhost (desktop machine) using google+ acount credentials. Will this also (php) work on mobile?

注意:我愿意用任何语言进行开发.

Note: I am open to develop in any language.

推荐答案

如果你想在手机上运行原生应用程序,你可以使用 适用于 iOS 或 Android 的 Google Maps SDK.(如何开发 iOS 和 Android 应用超出了本文的范围,但基本上 Android 使用 Java,iOS 使用 Objective-C.)

If you want a native app running on the phone you would use the Google Maps SDKs for either iOS or Android. (How to develop iOS and Android apps is beyond the scope of this but basically Android uses Java, iOS uses Objective-C.)

您应该能够使用 SDK 获取设备的当前位置.

You should be able to use the SDK to get the current location of the device.

对于网络跟踪应用程序/界面(您将在其中查看设备移动/位置),我可能会使用 Node.js/Express/Google Maps JavaScript API 堆栈和 Firebase (firebase.com) 处理数据 -原因我将在下面解释.

For the web tracking application/interface (where you will view the devices movement/location) I'd maybe use a Node.js/Express/Google Maps JavaScript API stack with Firebase (firebase.com) handling the data - the reason for which I will explain below.

您可能可以绕过 Google Tracks API 并从 Firebase 查看 GeoFire.它允许基于被编码为Geohashes"(在维基百科上阅读更多关于它们的更多信息)的纬度/经度值来实时跟踪资产,以提高速度和便利性.纬度/经度坐标被编码为单个字符串,使单个位置/点易于在客户端解析.您应该能够创建多个实体".

You can probably bypass the Google Tracks API and check out GeoFire from Firebase. It allows realtime tracking of assets based on lat/long values that are encoded into "Geohashes" (read more about them on Wikipedia) for speed and convenience. Lat/long coordinates are encoded into a single string making a single position/point easy to parse on the client side. You should be able to create multiple "entities".

但是,如果您需要访问 Tracks API 的收藏"或地理围栏"功能;你可能需要坚持下去.面包屑"功能也很不错,但您可以使用 Maps JavaScript v3 API 以某种方式复制它.

If, however, you need to access the "Collections" or "GeoFencing" features of the Tracks API; you may need stick with that. The "Breadcrumbs" feature is nice too but you could probably replicate it in some fashion with the Maps JavaScript v3 API.

因此,您的应用将以给定的时间间隔输出纬度/对数坐标(根据您的实现,可能会占用大量数据/资源,但我会说每 3-5 秒一次),将它们存储(在 Firebase 上)并将它们转换为 Geohashes.当 Geohash 被写入数据库时​​,geoFire.js 应该在客户端解码字符串并且它应该立即更新位置.当它用新值更新时,它会给出实时"效果(无需重新加载页面等)

So your app would output lat/log coordinates at given intervals (could be data/resource intensive depending on your implementation but I would say every 3-5 seconds), store them (on Firebase) and convert them to Geohashes. When the Geohash is written to the database, geoFire.js should decode the string on the client side and it should update the position instantaneously. When it updates with a new value, it will give the "realtime" effect (without reloading the page etc.)

这是一个相当高级的概述,但我希望它对一些人有所帮助.

This is quite a high level overview but I hope it helped some.

一切顺利.

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

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