googlemaps / transport-tracker

Applications for tracking moving assets on a live map
Apache License 2.0
574 stars 442 forks source link

Tracker Map running locally #29

Closed anish-sekar closed 6 years ago

anish-sekar commented 6 years ago

I'm running the tracker example locally on my computer.

Set up the backend, in trial mode the firebase database is being updated with the simulated data. So that seems to be working fine.

I tried setting up the map app and running it from npm. It was successfully served at localhost:8080, however the page isn't loading. Its stuck and won't load the google map, or display any of the data from the firebase db.

Has anyone done this on their local machine? I'm not sure what I'm missing out.

screen shot 2017-12-17 at 8 39 17 pm

ibstelix commented 6 years ago

same problem here

domesticmouse commented 6 years ago

What is being shown on the browser console? I'm guessing you haven't put in a Google Maps API key, at a guess.

Badenjki commented 6 years ago

Hello, I'm having the same problem. I've tried to delete the whole project and start from the beginning few times, but still no map. the browser console only shows one error, which is not relevant to the problem:

image

Any help will be so appreciated.

lakshaykakkarr commented 6 years ago

same problem with me @anish-sekar @anish-sekar I need some help, kindly allow me to reach you by providing me with your email address or with your WhatsApp if it suits you.

rosaiz commented 6 years ago

I manage to get some progress by following this: https://codelabs.developers.google.com/codelabs/transport-tracker-map/#0

leonharbour commented 6 years ago

Firebase Database Rules read access might be your issue. It should be. "rules": { ".read": true, ".write": "auth != null" } instead of "rules": { ".read": "auth != null", ".write": "auth != null" }

@anish-sekar @quarky912 @Badeechi @ibstelix

ghzoan commented 6 years ago

same issue and the api is working

any help

kbihani commented 6 years ago

Even i was facing the same issue, but the solution provided by @leonharbour works.

ghzoan commented 6 years ago

Hi

@kbihani there is no database.rules.json in the directory

it must be

{ "rules": { ".read": "true != null", ".write": "auth != null" } }

in the main folder?

I will use firebase init and choose database option

Right?

ghzoan commented 6 years ago

same issue in the main directory and map folder

"initMap is not a function" name "InvalidValueError" stack : "Error↵ at new Qb (https://maps.googleapis.com/maps/api

Uncaught SyntaxError: Unexpected token < index.js 24

leonharbour commented 6 years ago

@ghzoan

I believe there are 2 main tutorial/guide for transport tracker.

1- The one used for the Google I/O 2016. https://developers.google.com/maps/solutions/transport-tracker/start

2- And the codelabs based on the Cloud Console platform. https://codelabs.developers.google.com/codelabs/transport-tracker-backend/ https://codelabs.developers.google.com/codelabs/transport-tracker-map/

Either way, you end up setting up a Firebase project, which can be manage and created at https://console.firebase.google.com/

If you are lost in the process of deploying firebase via npm on Cloud console. Get a look at the Firebase Console link above.

kbihani commented 6 years ago

@ghzoan instead of creating database.rules.json, try updating the rules in firebase console. Goto firebase console -> your app -> develop tab -> database -> rules In this, change the value of .read from "auth != null" to true Now publish and refresh your map app. It should start showing data.

ghzoan commented 6 years ago

@leonharbour Thank you for your response,

All the link above I test them, one of them showing the map but it's without tracking App from Android, I want to read from client App

But I will try to link with the same Android App

ghzoan commented 6 years ago

@kbihani

Thank you for your help.

I did your steps, but it's not working.

It's seems "npm run main" for backend folder and map.... because they stuck on install process.

Really I don't know how to solve this

ghzoan commented 6 years ago

In the MAP step the shell stuck !

transport-tracker-server@1.0.0 main /home/ghzoan/transport-tracker/backend

node main.js

module.js:529 throw err; ^

Error: Cannot find module './paths.json' at Function.Module._resolveFilename (module.js:527:15) at Function.Module._load (module.js:476:23) at Module.require (module.js:568:17) at require (internal/module.js:11:18) at Object. (/home/ghzoan/transport-tracker/backend/main.js:53:26) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:201:16) at bootstrap_node.js:626:3 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! transport-tracker-server@1.0.0 main: node main.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the transport-tracker-server@1.0.0 main script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. when open map index got

index.js:24 Uncaught SyntaxError: Unexpected token <

maps.googleapis.com/…raries=geometry:101 Uncaught Qb message "initMap is not a function"

"InvalidValueError"

ghzoan commented 6 years ago

@kbihani @leonharbour Error when try run the application

ghzoan@jernas-193723:~/backend$ npm run main

transport-tracker-server@1.0.0 main /home/ghzoan/backend node main.js module.js:529 throw err; ^ Error: Cannot find module './paths.json' at Function.Module._resolveFilename (module.js:527:15) at Function.Module._load (module.js:476:23) at Module.require (module.js:568:17) at require (internal/module.js:11:18) at Object. (/home/ghzoan/backend/main.js:53:26) at Module._compile (module.js:624:30) at Object.Module._extensions..js (module.js:635:10) at Module.load (module.js:545:32) at tryModuleLoad (module.js:508:12) at Function.Module._load (module.js:500:3) at Function.Module.runMain (module.js:665:10) at startup (bootstrap_node.js:201:16) at bootstrap_node.js:626:3 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! transport-tracker-server@1.0.0 main: node main.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the transport-tracker-server@1.0.0 main script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Badenjki commented 6 years ago

@leonharbour thank you for your solution. I've tried and my problem is solved.