-
-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How about routing? #461
Comments
also would like to know that, how can i implement routing with this package? |
After some research, you ll need to create a A* by yourself, if you use public routes i suggest move to google map implementation of flutter |
I think it depends on what your goal is. You can certainly interface with a routing API like mapbox, and get directions and then draw them in flutter_map, that type of thing. But it's not clear really from the original issue what is needed, and that doesn't really need to be included as part of maps (i.e it's a separate entity really). |
I would need to do the same as in google maps like so : `List result = await polylinePoints.getRouteBetweenCoordinates(
|
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. |
I know this issue is closed, however I'd like to bring attention to http://project-osrm.org/. It's a free routing machine based on Open Street Maps. I'm currently in the process of making a plugin for this (or a separate package with extra support for |
I hope the plugin will be available soon |
@volethanh For now you can use the GitHub Experimental Alpha. Please don't use it in anything production-wise yet though. https://github.com/JaffaKetchup/flutter_osrm Here's a small example line just for now: import 'package:flutter_osrm/flutter_osrm.dart';
// Get a 'nearby' point
OSRM(OSRMProfile.car).nearby(LatLng());
// Get a route between two points
OSRM(OSRMProfile.car).route([LatLng(), LatLng()]); apart from that, you'll have to figure it out yourself for now, as I'm not really dedicating my time to it at the moment (I'm maintaining another plugin for |
May I ask something just about this osrm as you mentioned above ? I use this Then add it to Widget but the map cannot show the route instead of it show a line between 2 point. Thanks for your help. |
Hi there, this should be drawing a route (it did in my testing), I think you're using it incorrectly, but I'll need to double check. Give me a bit of time and I'll be back.
PS. Just to check whilst I'm checking, can you put your waypoints through `.nearby()` before using `.route()`?
…________________________________
From: volethanh ***@***.***>
Sent: Friday, August 13, 2021 5:34:54 PM
To: fleaflet/flutter_map ***@***.***>
Cc: Luka S ***@***.***>; Comment ***@***.***>
Subject: Re: [fleaflet/flutter_map] How about routing? (#461)
@volethanh<https://github.com/volethanh> For now you can use the GitHub Experimental Alpha. Please don't use it in anything production-wise yet though.
https://github.com/JaffaKetchup/flutter_osrm
Here's a small example line just for now:
import 'package:flutter_osrm/flutter_osrm.dart';
// Get a 'nearby' point
OSRM(OSRMProfile.car).nearby(LatLng());
// Get a route between two points
OSRM(OSRMProfile.car).route([LatLng(), LatLng()]);
apart from that, you'll have to figure it out yourself for now, as I'm not really dedicating my time to it at the moment (I'm maintaining another plugin for flutter_map, I am writing new docs for flutter_map, and I've got my own personal project).
May I ask something just about this osrm as you mentioned above ?
I use this var osrmRoute = await OSRM(OSRMProfile.car).route(polylineCoordinates); to get osRMRoute and then I use nodesLocations to simple create Polyline
[Screen Shot 2021-08-13 at 11 28 02 PM]<https://user-images.githubusercontent.com/46510130/129390862-852cf601-58b8-441f-bda8-d3e0bceceb01.png>
[Screen Shot 2021-08-13 at 11 28 10 PM]<https://user-images.githubusercontent.com/46510130/129390877-267af36f-90b6-4cdf-80f2-f6d5eba3c06a.png>
Then add it to Widget
[Screen Shot 2021-08-13 at 11 28 32 PM]<https://user-images.githubusercontent.com/46510130/129390879-09bfe645-4a22-4256-a531-6795dd024d7b.png>
but the map cannot show the route instead of it show a line between 2 point.
[Screen Shot 2021-08-13 at 11 32 26 PM]<https://user-images.githubusercontent.com/46510130/129390882-46c50c7e-b937-4e4b-972c-9a1ca52ecd20.png>
Thanks for your help.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#461 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AN3MM4WSDTMJUDVANSLWVVLT4VCS5ANCNFSM4JMDUNIA>.
|
Ah sorry, I found what make it wrong. Firstly, the api I've used is Secondly, I think the api https://routing.openstreetmap.de is the problem and it is only use for routing in Germany, I've changed it to my built api using OSRM project backend and I've changed to my api and it worked but it didn't draw a route. Currently, I don't know why the routing is a bit difference. this is my api link And this this the link from routing.openstreetmap.de After reversed all the code and use what you guide. Now it work
thanks for your time to help me |
I set it to use the German routing because it supports car, walk and bike, and it routed correctly when I tested it in my local area in the United Kingdom, so not sure why that's a difference? But glad it works now! If you don't mind, apart from the ability to change the routing server URL, what other options would you like to see, if any? |
@JaffaKetchup is it possible to add waypoints or only A to B ? |
Hi @thorizer, |
@JaffaKetchup, thanks can't wait! |
Good to hear! Hope it all meets your expectations! |
You can use this package for the routing: |
@nkdkhanh46 Hi, can we see the github repo? In pub.dev it does not link to gh. Thanks |
(Also see #461 (comment). I still plan to work on it at some point!) |
The github repo has been added to pub.dev |
The leaflet has a pretty good routing machine with a way to calculate custom routes based on a GeoJson named pathfinder, there some roadmap for that ?
The text was updated successfully, but these errors were encountered: