I want to pass several parameters to this url and generate the map from it and show it in my java application. I know the code to download the image and show it in the java application. I want to know how to pass parameters to this address:
http://maps.google.com/maps/api/staticmap?center=Nugegoda&zoom=14&size=1000×312&maptype=roadmap&markers=color:blue|label:S|size=tiny|Mirihana&markers=size:mid|color:0xFFFF00|label:C|Udahamulla&sensor=false
In this link Nugegoda and Mirihana and Udahamulla is the one that i should pass from the application. And then it will generate a image and i do need to show it. Even if u check this link. It’s a image.
Can someone help me?
The Static Maps API can do geocoding for you if you pass a valid address to the
centerparameter:The parameters that you can pass are all listed here. As is standard in URLs, all parameters are separated using the ampersand
&character. Therefore if you want to add themaptypeparameter and set it tohybridfor example, you can simply add&maptype=hybridto the above URL:Then if you want to show the Udahamulla map, simply replace Nugegoda with Udahamulla for the
centerparameter:UPDATE:
Further to the comments below, you can add a polyline on a static map by using the
pathparameter, as follows:Note how the API geocodes the addresses “Maharagama” and “Nugegoda”, so you do not need to pass the latitude and longitude coordinates of the localities.
Currently the Static Maps API does not do driving directions. However if you have the points of a complex route, you could plot the path as an encoded polyline.