Open pariterre opened 2 years ago
can provide me the parameter used to get that result
because Geometries.geojson
has different output than Geometries. polyline|polyline6
Here is an example that always fails (in the sense that road.polyline is always null
), while if Geometries.geojson
is used, then road.polyline
is actually filled
Future<List<LngLat>> getRoadPolyline() async {
List<LngLat> waypoints = [
LngLat(lng: 13.388860, lat: 52.517037),
LngLat(lng: 13.397634, lat: 52.529407),
LngLat(lng: 13.428555, lat: 52.523219),
];
final manager = OSRMManager();
final road = await manager.getRoad(
waypoints: waypoints, geometrie: Geometries.polyline);
if (road.polyline == null) return []; // With polyline, this is always null
return road.polyline!;
}
thnx i will check why thats happen sorry for late reply
ah yeah because polyline get values only when geometries are geojson
and check if you check polylineEncoded
when that geometries is polyline you find it not null
and used to share polyline easly but since this make confusion
but I will fix it for all geometries types
Hello!
Thanks for this routing interface! Really useful stuff :)
I am not sure if I am not using the API properly but ot seems that only
Geometries.geojson
returns roads in thepolyline
attribute. The other (polyline
andpolyline6
) always return null (in bothgetRoad
andgetTrip
). I had a quick look and it seems that inroad.dart
, theroute["geometry"]
variable is indeed empty for thepolyline
. I am unsure if it is intended or a change in the API, but sincepolyline
is the default value, one would expect that it actually fills the polyline attribute.If no easy fix can be find, I would suggest to use
Geometries.geojson
as default!