我試圖創建一個跟蹤當前用戶位置的應用程式,我想在地圖上顯示它。
問題是,當我開車時,我得到 2 個地理點,如果兩者之間有曲線,那么它只會畫一條直線。但我想在道路上畫一條線,因為邏輯思維,汽車只能在道路上行駛。我怎么能意識到這一點?
這是我的 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
uj5u.com熱心網友回復:
我強烈推薦 Google Direction API。它在一定程度上是免費的,但它會滿足您的需求。在這里查看更多
https://developers.google.com/maps/documentation/directions/overview
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/412485.html
標籤:
