Are ride requests waypoints updated according to their progress?
Here's what I would expect when picking up and dropping off another rider:
Pickup and dropoff waypoints added for that rider added to waypoints
Once rider is picked up, his pickup waypoint is removed from waypoints
Once rider is dropped off, his dropoff waypoint is removed from waypoints
Are my expectations matching actual behavior? Or would all the waypoints stay populated in the list?
Yes, we believe your understanding is correct, but this only applies to POOL trips.
Related
Can we implement google maps in a flutter application which runs once and fetches route from location1 to location2 and then we can move over the route without placing any new request to google API console?
Like, for the hikers and travelers who is supposed to be in a part where they may not have internet access then can user offline routes saved on device.
Thanks
I have tried google console APIs but it requires timely requests and costs a lot.
In my case, I use Flutter Map with Google Map Tile layer. When performing routing, API server sends me a list of Coordinates that make up a path from start to end. Then I just add them to Polyline layer to display on the map.
yes, you can do it. You have to hit the direction API to get the direction from point A to Point B. In JSON response you will get all the required data, like polyline points, steps, routes, and Lat, Lng. Save the polyLine points and draw polylines on GoogleMaps. And when you move, simply get your latLng from GPS using a geolocator or Location package and set a listener on it for every movement. And now it will work without the internet. But for another request, you will need internet.
I'm currently making a map with roads that I have driven in the past. Right now, for one route I enter a few waypoints, and the route is calculated through these waypoints using OSRM.
It works fine, but the problem is that on every pageload this route will be recalculated (which makes sense, cause that's how routing works). Let's say I have 50 routes, that'll be a lot of requests. However, I want to be able to calculate the route once, and save the line that is generated as a polyline, which essentially caches the route forever.
Since the routes all stay the same, and no recalculation is necessary, this would be the best way, because then I don't need to setup my own OSRM server or pay for a routing service. (I might need to recalculate routes every once in a while, but that's alright).
Is this way of converting/cachine routes possible? It would be great if I could get this project working live without any routing attached to it.
Thanks for your help in advance!
How to integrate live tracking with flutter_map. Does anyone know which library is integrated into it? or How to implement it?
In order to do this, we need to understand what live location tracking is. Mainly it consists of these:
The location being broadcasted (the one being tracked) => 1st party.
The listener for these location updates (observer) => 2nd party.
A place to store these changes, which acts as a middle ground between the two parties. This is your database. Could be FireStore, or a traditional database.
Your 1st party will have to be aware or location changes, and when it's coordinates change, it will post the new coordinates to your database. This can be done using your location package, either Location or Geolocator or other dependancies. You listen to onLocationChanged.
Your 2nd party will be monitoring your database, for any new coordinates being posted. Ideally, it would be by utilizing a streambuilder in Flutter, which listen to a stream of events coming from your database via your server, or more practically, via FirebaseFirestore streams.
When your 2nd party receives these new coordinates, it will updated the map with the newly received data. You implement this by using two things:
Add a marker to the map, the marker takes a required LatLng argument. This is the LatLng you just received.
You also have to animate the camera, to point at the newly received LatLng.
Now, you have 1st party uploading it's data whenever location changes, and 2nd party getting the data as soon as it is being uploaded, and you have live tracking. Implementing it isn't as hard as you imagine.
Use Flutter google maps.
Enable google maps API in google cloud console for your platform(s), Android, iOS, JavaScript if you want web.
Install your location dependency.
Update your database with the new coords when they change.
Build your map widget on your 2nd party's device, as per the documentation, which is crystal clear,and put it in a streambuilder.
Update this map with the new coords.
You get a location tracking system.
It uses user_location_plugin
I don't think you want to implement it yourself.
I'm working with Directions API, trying to get the best route from one point, pass through another places and return to the origin. But the max waypoints the API allows me to put is 25, and I need 120 on average.
Is there a way to change this restriction? Or maybe another service that allows more than 25 waypoints?
It's not currently possible to add more than 25 waypoints for Directions API.
However, there is an open feature request in Google's Issue Tracker which I suggest starring to increase visibility and subscribe to future notifications:
https://issuetracker.google.com/issues/35824756
Hope this helps!
I am currently working on a location-based reminder app and I am trying to understand iOS 4/5 location services and some of the core location features. Since I want to use geo-fences of different sizes (user can choose the size), I was wondering if I need to combine Significant-Change Location Service with region monitoring or if it is enough to simply use Region Monitoring by itself to make those reminders go off.
As far as I understand Significant-change Location Service, my app would only get a location update if I switch cell towers. Would that mean that in case the geo-fence was somewhere in between that the reminder would not go off?
Compared to that how does Region Monitoring work, other than of course monitoring regions? Will the reminder always go off or are there any blind spots? If so, does DistanceFilter play a role here?
Thanks for the help.
Your use case should be covered with region monitoring.
As far as I understand Significant-change Location Service, my app would only get a location update if I switch cell towers. Would that mean that in case the geo-fence was somewhere in between that the reminder would not go off?
This might happen and is an edge case that you would have to cover. I really depends on many things, location accuracy being one of them. You would definitely have to test that one thoroughly.
Compared to that how does Region Monitoring work, other than of course monitoring regions? Will the reminder always go off or are there any blind spots? If so, does DistanceFilter play a role here?
Last time I checked (> 10 months) region monitoring wasn't always accurate enough. It worked but used cell towers more than the current position to monitor for regions. What that means: Don't rely on region changes alone and dont' expect them to be accurate to the meter.