how can I implement algorithms such as Dijkstra or backtracking on Google Maps integrated in Android ? For example I want to compute a route from city A to city B such that I pay the lowest price for gas.
Check this post. It has the Route finding Example. Google removes the Route finding api. But we have develop the code for the draw the route using Overlay. this is what done on that working example.
Since Google Maps doesn't provide access to the actual road data, I don't think it is possible to implement your own routing algorithm.
You could use road data from another source such as http://openstreetmap.org .
Related
I'm building a route recommendation app in Android Studio where the user can see the best route between two destinations on the map. I am using Google Maps APIs for that and I know that it's using Dijkstra's algorithm to determine the route. But I wonder if the API can update the route according to real-time traffic, I didn't find any information about that.
Google Maps is updated constantly – literally, every second of every day!
refer this page
On my Android app, I am trying to implement Dijkstra's algorithm for some cities, but I want to give weights to the streets manually. Is there any way I can get a graph of all crossroads of a given city and the streets connecting them using Google Maps Android API for implementing this? If no, is there any other service that will provide me with a similar feature?
I've been researching for a long time in finding tutorials.
This is what i want to attain/make, Credit to Voyage: Route Planner
That application itself is similar for what i want to make.
Questions are:
-How to plot multiple destination and provide Route for the user in Google map?
-Is there any books/tutorials/website that i can read/use/watch to learn more about google map?
How can i give the directions to the user after i provide the route? or how can i do this?
-I've already saw similar question like this but then it is written in Javascript.
Thank you.
To answer your questions:
How to plot multiple destination and provide Route for the user in Google map?
As far as I know, multiple destinations support hasn't been an added feature yet for Android as also discussed in this thread.
However, you can get some ideas about getting directions for multiple destinations from the given suggestion in Google Maps Help Forum and routing from this YouTube video - Google Maps Routing Multiple Destinations
Is there any books/tutorials/website that i can read/use/watch to learn more about google map?
You may use these helpful references, video and others
To plan a route through a series of up to 23 locations using the Google Maps Directions API, you can use Waypoints.
Android Location API - Tutorial
How can i give the directions to the user after i provide the route?
As discussed in Directions Requests, this can be done by sending HTTPS or HTTP requests and adding certain parameters with the following format:
https://maps.googleapis.com/maps/api/directions/outputFormat?parameters
I hope that helps.
New to Stackoverflow, did some searching and couldn't find anything that really matched what I'm looking for unless I'm using the wrong keywords. I did find guides on how to plot a route when you know the actual route, but I'm looking to do it from actually walking it, see below:
I'm fairly new to web development and am looking to plot maps of a trail on a website using an embedded Google map or some other free map platform if it's suitable (OSM?) I have an Android phone and I'd like to actually be able to:
(1) walk this route,
(2) take the GPS data somehow &
(3) match it up to a Google map to
(4) post it on my webpage.
That will help visitors know the actual route (which is not available on Google Maps in any detail) and have somewhat of a "guide" of the near-exact trail route. I imagine this can be done, as Runkeeper and other applications do this (with additional data on speed, time, etc.) for tracking your runs. I don't really want any of that additional data as much as I would like to just capture the GPS route itself, and have it in some format that I can then use to make a map out of automatically. Not sure where to start with this, or if it can be done easily. Any information or guidance would be greatly appreciated. I have no experience in Java; very limited Javascript and OK in HTML/CSS. I've never used the Google Maps API either.
Thanks!
You may use API Picker lists to help you on the most common things you may want to do on a map or with location-based data, and this also suggests the API that most suits your needs.
Listed below are the useful APIs to plot a route on a map:
Polylines in the Google Maps Android API
Polylines in the Google Maps SDK for iOS
Polylines in the Google Maps JavaScript API
Directions mode in the Google Maps Embed API
Paths in the Google Static Maps API (a web service)
Links of useful APIs for whatever you want to do on a map can be found in the documentation.
I have a problem: I need to calculate the routing within a mall that has a plan registered in google maps, but with the direction API can not get the indoor routing. To be precise if I am away from the mall and I want to calculate the route to an internal area, I am guided to the outside of the mall, while I would like my app would calculate a route for the section inside the building . To do this I currently use the Google Maps Android API v2 and the Direction api with json output. Does anyone have any suggestions for me? sorry for my bad English
I have exactly the same problem; compting a route (with mode=walking) between two points that are both inside a mall gives a path that starts, goes and ends out of the building.
The closest similar path found on Google Maps (HTML version, from a browser) is the "bike" one...