osm_flutter
osm_flutter copied to clipboard
How to Update the route on Users location change
Hi,
Is there any method or anyway by which we can update the route depending on the location of the user?
I am using the below code to set a route from the user's current location to a specific cordinates, but when the user changes location the route doesn't update. Is there any way I can update the route when the user changes location.
The Code
await controller.enableTracking();
GeoPoint geoPoint = await controller.myLocation();
print (geoPoint.latitude);
print(geoPoint.longitude);
RoadInfo roadInfo = await controller.drawRoad(
GeoPoint(latitude: geoPoint.latitude, longitude: geoPoint.longitude),
GeoPoint(latitude: 24.913608364530518, longitude: 67.03123161285491),
interestPoints : [GeoPoint(latitude: 24.913608364530518, longitude: 67.03123161285491)],
roadOption: RoadOption(
roadWidth: 20.0,
roadColor: Colors.red,
showMarkerOfPOI: true
),
);
print("${roadInfo.distance}km");
print("${roadInfo.duration}sec");
I've also tried using
await controller.enableTracking().then((value) => {
GeoPoint geoPoint = await controller.myLocation();
...
});
But it doesn't work.
Can someone help me out on this issue?
turn by turn navigation
not implement yet it need specific implementation (infrastruction + code )
drawRoad in the map is just static and we using open source routing server
you can change it manually every 1 min for example and adjust camera
Just out of curiosity, Do you plan to implement turn-by-turn navigation in the future, or it's not the scope of this project?
I already think about a lot but for next 3 months i will focus on ios and web support but when i will find greate solution for it of course i will added but it will be as external library
Just out of curiosity, Do you plan to implement turn-by-turn navigation in the future, or it's not the scope of this project?
Even I am looking out for navigation support using OSM