Using Google Map Tracks API

☆樱花仙子☆ 提交于 2019-12-03 05:18:10

问题


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

Google Map API (Web).

Google Map Tracks API.

My basic scenario will be as follows:

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

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?

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

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?)

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.


回答1:


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.)

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

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.

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".

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.

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.

All the best.



来源:https://stackoverflow.com/questions/20569979/using-google-map-tracks-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!