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.
Related
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've been attempting to use the Bing traffic API to return traffic data for a specific area, but I never seem to get any traffic info back, even at peak hours when I can see several incidents listed with the BBC Travel website.
I haven't been able to find a way through the Bing API to show a bounding box on a map to verify that I'm getting the right area, but when I display the bounding rectangle on a google map, it covers the area that I'm interested in. I've also tried expanding the area considerably to include surrounding areas, and then I do sometimes get some data, but that seems quite erratic and disappears again when I expand the bounding box again??
The URL I'm using is:
http://dev.virtualearth.net/REST/v1/Traffic/Incidents/51.4,-2.8,51.7,-2.3/true?o=xml&key=MyKey
(South, West, North, East co-ordinates).
And it covers the following area on a google map, which is exactly what I'm expecting:
Am I doing something completely wrong with the API call or is this some weird behaviour that shouldn't be happening?
The BBC pulls in their Traffic incident data from a different source. Looking into the Traffic Manager Module in the Bing Maps V7 control I do see some incidents, not the same as the BBC though. The Bing Maps control also has traffic flow maps as well.
Here are a couple of other API's you can try out:
http://data.gov.uk/dataset/live-traffic-information-from-the-highways-agency-road-network
http://www.highways.gov.uk/traffic-information/
I am new to the arcgis framework for ios.I have tried out the routing sample provided by arcgis.But it work in a way that the stops are marked on the map ,then call the routing service retrive the data and add it to map.
But my purpose is a little different that I know the Latitude and Longitude information and I want to route from the current location to that point.Is it possible ? How can i achieve this?
I got a failure message when I tried .How can I achieve what I look for?
How can I receive and store user location data so that I can add it to a map?
Have been studying MapKit and the UserLocation code from Apple. What I want to do is get all user's locations and plot on a map - a worldmap with dots showing the combined user base locations - like several apps we've all seen. NOT looking for code, need to do my own work, just if someone could share how they would tackle this..Thanks! Do I gather the user location somehow - add to a plist and .... Not sure...
You should look at the Core Location APIs as well as map kit, you can find a way to get user locations there. Store the results in an array, with a plist to save them if you want, and put annotations on your map to show all locations.
If I'm understanding your question correctly, you're going to need to build a couple web services:
1) that the assorted clients can send their location data TO, and that will then store it in a database. Then
2) when any user needs to open the map view, they'll request the full set of data so that you can then use that data to plot the points
Generally speaking, how does an app like "Around Me" acquire the information it displays?
For example: the restaurants that show up in a list that are near me with the address and distance (I think I get the distance piece) where is this information extracted from? Is it Google or something?
I'm not asking how to implement this (that's over my head!) just get an idea of how it occurs.
Thanks StackOverFlow people.
I haven't seen that specific app, but most such apps either have an embedded database of locations or they dynamically query a server back-end (e.g. using HTTP) to fetch a set of locations near you. They know where you are because the app has access to location services to find out your geographic location.
The iPhone has a GPS unit which gives you your latitude and longitude, which it then sends to a backend server (Say Google Maps) and queries it for, in your case a restaurant. The server responds with a set of locations around you.