YOUR_API_KEY
withyour API key.MODE
and parameters
options in the code above, see Forming the URL for the Maps Embed API.Data store | A Firebase Realtime Database that stores the vehicle locations, snapped to the road with the Roads API. Firebase provides realtime data synchronization to the backend and map. |
Vehicle locator | An Android app that uses the fused location provider, in the Google Play services location APIs, to report its location to the Firebase Realtime Database. |
Backend | The backend built in Node.js, that processes locations from the Firebase Realtime Database and predicts travel times using the Directions API. |
Map | A web application that uses the Maps JavaScript API to display a styled map showing the bus locations and routes. |
Administrator's overview | A web interface for administrators, giving an overview of the assets being tracked. It displays a map using the Maps Static API, with vehicle and location data from the Firebase Realtime Database. |
read
to true
: adminsdk
JSON file containing your service account credentials. Store this file for later use.transport-tracker
directory for your application, and copy across the backend
directory from the cloned GitHub repo:serviceAccountKey.json
, and paste in your Firebase adminsdk
service account credentials from the file you downloaded earlier. Hint: If you're using the Google Cloud Shell, you can use Cloud's code editor.tracker_configuration.json
file and add the following values:mapsApiKey
- your Maps API key. If you don't have one yet, follow the guide to getting an API key.databaseURL
- the address of your Firebase Realtime Database. You can find the URL in the Admin SDK configuration snippet on the Firebase Service Accounts tab. simulation
- a configuration setting that determines whether to use the vehicle simulator or real location data from the vehicle locator. While developing and testing, set this value to true
.npm install
to install your dependencies. This may take a few minutes.transport-tracker-map
directory for your application on your server, and copy across all the files from the map
directory in the cloned repo:index.html
file, find the <script>
element at the bottom of the file, and replace YOUR_API_KEY
with your Google Maps API key. If you don't have an API key yet, follow the guide to getting an API key.config
object that appears on the Firebase console. The config
object contains the Firebase authentication values that you need in the next step.js/index.js
file and populate the firebaseConfig
object with the Firebase authentication fields and values from the config
object that you copied in the previous step. See the Firebase documentation for more information.npm install
to install your dependencies.android
directory in Android Studio.google-services.json
file in your project's app
directory.google-services.json
file as directed.transport-tracker-admin
directory for your application on your server, and copy across all the files from the admin
directory in the cloned repo: main.js
file:mapsApiKey
. If you don't have an API key yet, follow the guide to getting an API key. firebaseApiKey
and the URL of your Firebase Realtime Database into firebaseDatabaseURL
.