Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google Map Tracks 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 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.

like image 576
Sobia Idrees Avatar asked Dec 13 '13 15:12

Sobia Idrees


People also ask

Can Google Maps be used as a tracker?

If you want to track someone using Google Maps in a web browser on a computer, the process is essentially the same. Open Google Maps in a browser and then click the three horizontal lines at the top left of the web page (the "hamburger menu"). Then click "Location sharing" to see your contacts on the map.

Can you use Google Maps API for free?

You won't be charged until your usage exceeds $200 in a month. Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).

Is there an API for Google Maps?

The Google Maps API is one of those clever bits of Google technology that helps you take the power of Google Maps and put it directly on your own site. It lets you add relevant content that is useful to your visitors and customise the look and feel of the map to fit with the style of your site.


1 Answers

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.

like image 93
kylemclaren Avatar answered Sep 23 '22 04:09

kylemclaren