How to get KML of route with waypoints? - google-maps

I need to draw routes in my android app's MapView and to do so I'm using the coordinates listed in the KML output file of Google Maps.
The problem is: when I add a waypoint to a route, the KML file doesn't contain the complete route details and only shows the coordinates/directions from the source to the waypoint.
Here is an example. As you can see, the route is drawn correctly and all the directions are shown, but the KML output only has the details from the source to waypoint.
A solution is making two requests, one for source->waypoint and other for waypoint->destination, but I would like to avoid that if possible.
Thanks.

Multistep routing is only supported in google maps directly.
See
http://groups.google.com/group/kml-support-advanced/browse_thread/thread/1d57c9f0bc879141
and
http://groups.google.com/group/kml-support-getting-started/msg/e3d15213ac4ae9ed

Related

how to get google maps route by sending the two latitudes and longitudes

Basically what I want is to use a webView to show google map but an URL wish I could send both the position of origin and destination so that when the page is loaded the route is displayed.
I have a list of positions of different branches and would like to do is to select a branch is displayed on the map the shortest route from the position where the device is located and the selected branch.
There is an option that is the Google Maps URL Scheme, but not how it works.
https://developers.google.com/maps/documentation/ios/urlscheme
You have to use Google Directions API to calculate the route. If you are showing the map using Google Maps JavaScript API you can use Direction Service that is included in the Map itself.
I found a solution that turned me perfect for what I needed and use a webView and link to google maps route with two positions as follows:
https://www.google.cl/maps/?saddr=origin_latitude,origin_longitude&daddr=destination_latitude,destination_longitude&directionsmode=transit

Providing KML data in embedded Google Map, but how to hide the KML to the user

I've embedded google maps several times, only doing basic stuff though.
Now I need to overlay districts over a city. I worked hard to get, parse and adjust all the coordinates for all districts and I don't want others to copy my coordinates.
Can I display the overlays, but prevent users from reading the KML coordinates ? Is there a way to embed them other than having the path visible for everyone in the javascript api block ?
Try using a FusionTablesLayer. You can import your KML into a FusionTable, and prevent it from being downloaded, but display it on a map. People will be able to look at your coordinates, but it will be difficult (but probably not impossible) to grab them.

URL to dynamic Google Map with path

I want to build a URL to a dynamic map (i.e., to the normal Google Maps interface where you can pan and zoom, rather than an image of a static map) that has a path drawn on it from lat-long coordinates.
Similar questions have been asked with answers that won't solve my problem:
How to obtain a dynamic map from a static map URL? : This guy wanted to add some markers on the map (lines between them would make a path like I want), and was told it was not possible with URL parameters.
How to obtain a dynamic map from a static map URL? : Yes, this guy asked the same question. He was told to change the URL just slightly, but if you follow the URL to the dynamic map, you can see it does not draw what is seen in the static map (e.g., many of the parameters are ignored and stripped).
For KML output, how can I add waypoints between source and destination addresses in a Google Maps URL? : I understand I can ask for driving directions with saddr, daddr, and +to:, but I just want a poly-line path, not driving directions.
I've seen many links to http://mapki.com/wiki/Google_Map_Parameters documenting the URL parameters, but that site has since disappeared, and no other documentation (even the official one) seems to come close to this guy's tedious work.
So is it just not possible? Are driving directions the best I can do?
Thank you for your consideration.
The best you can do you've already found here: http://www.seomoz.org/ugc/everything-you-never-wanted-to-know-about-google-maps-parameters
Create a KML which contains the desired features(markers, polylines,markers etc.)and pass the URL of the KML-file as q-parameter to google-maps.
The KML-file may be created on the fly, so you may pass details for the features to your script that creates the KML.

Get list of My Places from Google Maps

I'm making a website that has an embedded google map (iFrame) that has multiple place names on it that I set up in My Places. What I want is to be able to list the place names and addresses down the side of the map like it does in My Places.
Obviously I can just export the KML data of the map but I want the page to automatically update when a new place is added to the My Places map without having to export a new file.
If Google still supported RSS feeds I would probably use that, but the current API seems to need to rely on URL requests.
Any help or suggestions are appreciated!
I don't think you can do this with an embedded map. You can add a sidebar to a map from MyPlaces using the Google Maps API v3, a third party KML parser like geoxml3 and a proxy.
example

Can I draw a straight line in Google Maps?

Is there an API I can use to draw a straight line between two points in a Google map, and to show the line in different colors?
Example: draw a straight line between NYC and Los Angeles with green or red line?
Yes. Have you checked out the Google Maps APIs?
For example check out the source code for this example
Check this out, http://www.birdtheme.org/useful/v3tool.html. This application uses the Google Maps API Version 3 (V3). When you draw the line between two cities, this tool will auto generate kml or javascript code for you, and you can import it into your website and load the map
Using Polylines, you can draw a straight line.
You can see an example here
This worked for me. With the method mentioned here I was able to draw polylines on Google Maps V2. You can easily change color and width of these polylines. I drew a new line whenever the user location got changed, so the the polyline looks like the path followed by user on map.
Source code at. Github Repository: prasang7/eTaxi-Meter
Please ignore other modules of this project related to distance calculation and User Interface if you are not interested in them.