简体   繁体   English

Android Google Maps标记运动问题

[英]Android Google Maps Marker Movement Issue

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. 我正在使用google地图,并且正在对地图上的标记进行动画处理,因为使用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? 问题是大多数电话的gps不够准确,并且图钉不但在街道上移动,而且在地图上都移动了,不仅在街道上,有时在草地,水面上跳跃,它们也朝错误的方向旋转等。 。是否有可能仅在街道上移动标记?

I guess this can be done using google's direction API. 我想这可以使用Google的Direction API来完成。 You can request google direction api for the point you have to another point on the road. 您可以向道路上的另一点请求Google Direction API。 Google's response first point can be taken as on the nearest road point. Google的响应第一点可以视为最近的道路点。 I had look on the similar solutions people done on the web. 我看过人们在网络上完成的类似解决方案。 Have a look on this . 看看这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM