0

I am making an application where one person can watch all the other users of the app driving on the streets. I am using google maps and I am animating markers on the map, as the location of the users is changed in real time using socket.io.

The problem is that most of the phones have not so accurate gps, and the pins are moved all across the map, not only on the streets, the sometimes jump on the grass, water, they are rotated in the wrong direction, etc... Is it somehow possible to move the markers on the street only?

1 Answers1

1

I guess this can be done using google's direction API. You can request google direction api for the point you have to another point on the road. Google's response first point can be taken as on the nearest road point. I had look on the similar solutions people done on the web. Have a look on this.

Community
  • 1
  • 1
Sanjeet A
  • 5,171
  • 3
  • 23
  • 40