Closed goranskular closed 3 years ago
Do you mean the points are out, or you want the line to be a curve to account for it, screenshot may be useful.
Yes, I mean a projected curved line like this:
this geodesic: true would be perfect (snippet from google_maps_flutter):
Polyline(
polylineId: PolylineId(
'uniqueid'),
geodesic: true,
points: [originLatLng, destinationLatLng],
width: 3,
color: Theme.of(context).primaryColor,
)
Can u upload flutter_map image version which is now incorrect?
Incorrect Polyline(LatLng A, LatLng B):
Correct Polyline(LatLngA,...... much more points on bearing to B, LatLng B):
p.s. I made the correct one myself with a method that generates XY points on a route from point A to point B.. so polyline is not with two points: [LatLng A, LatLng B], but with XY points: [LatLng A, LatLngXY1,....LatLngB]
Nice workaround.
I encountered a new problem, but I already saw some issues about it :) So, this approach is not so simple.
I am using a similar solution in my app for nearly a year right now:
Drawing Geodetic Polyline.: https://github.com/S-Man42/GCWizard/blob/master/lib/widgets/tools/coords/base/gcw_map_geometries.dart#L39
I am splitting the real way into several substeps, project from start to all substeps and then I draw a polyline. The same algorithm can be used for drawing better circles keeping their radius on the projected map:
Drawing "Geodetic" Circles : https://github.com/S-Man42/GCWizard/blob/master/lib/widgets/tools/coords/base/gcw_map_geometries.dart#L81
Surely, it's not the most efficient way to do this, espessially for more general purposes. But if you like, feel free to use the code.
The problem with the... I call it overflow..., I reported this already some months ago. I would be glad to see this problem solved! https://github.com/fleaflet/flutter_map/issues/630
Maybe this could be a solution? https://github.com/fleaflet/flutter_map/issues/468
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Hi, it would be great if polylines were projected on the globe. Now polyline is a straight line from one latlng to a second one. It is ok for greater zoom levels, but very inaccurate when zoomed out.
Is it possible that we get projected polylines?