简体   繁体   English

将地理点与 map 上的道路匹配

[英]Matching Geopoints to road on map

I tried to create an app which track the current user position and I want to display it on a map.我试图创建一个跟踪当前用户 position 的应用程序,我想在 map 上显示它。

The problem is, when I drive by car I get 2 geopoints and if there was a curve between, then it only draws a straight line.问题是,当我开车时,我得到 2 个地理点,如果两者之间有曲线,那么它只会画一条直线。 But I would like to draw the line on the road because of logical thinking, a car only drive on a road.但我想在道路上画一条线,因为逻辑思维,汽车只能在道路上行驶。 How can I realize that?我怎么能意识到这一点?

Here is my backgroundGeolocationConfig where I tried to set the to the lowest but it also does not work, the result is in the screenshot below.这是我的 backgroundGeolocationConfig 我尝试将其设置为最低但它也不起作用,结果在下面的屏幕截图中。

const config: BackgroundGeolocationConfig = {
        desiredAccuracy: 5,
        stationaryRadius: 5,
        distanceFilter: 5,
        activitiesInterval: 1000,
        activityType: 'AutomotiveNavigation'
      };
    ```

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/OS2VM.png

I strongly recommend Google Direction API.我强烈推荐谷歌方向 API。 It is free until a certain point, but it will fit your needs.它在一定程度上是免费的,但它会满足您的需求。 Check out more here 在这里查看更多

https://developers.google.com/maps/documentation/directions/overview https://developers.google.com/maps/documentation/directions/overview

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

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