"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Wednesday, January 2, 2013

Print Google Maps

Print Google Maps 


To print google maps you have to use the Google Static Maps API if you want printer friendly maps.

It should be pretty easy to build the Static Maps API URL request string from the LatLng or your markers. One caveat is that the URL is limited to 2048 characters including any character escapes, this will limit how many markers you can have on the map at one time.

In the Javascript API, markers have the class 'gmnoprint', which disables them from showing up on the printed rendering. You can iterate through the markers and remove this class, which should allow them to be printed on the page. As far as I know, this will not work for the direction lines.



Below i had given a few link with the image with different condition check out yourself.


http://maps.googleapis.com/maps/api/staticmap?center=63.259591,-144.667969&zoom=6&size=400x400
&markers=color:blue|label:S|62.107733,-145.541936
&markers=size:tiny|color:green|Delta+Junction,AK
&markers=size:mid|color:0xFFFF00|label:C|Tok,AK&sensor=false (With latitude and Longitude and address to be mapped)
Check out the url its pretty simple to understand :)

http://maps.googleapis.com/maps/api/staticmap?center=33.6039,-117.377&zoom=4&size=500x500&markers=color:blue|label:S|92530|92582|92346&markers=color:red|label:S|92535|92587|92341&sensor=false (With Zip-code to be mapped)


http://maps.googleapis.com/maps/api/staticmap?size=480x480&
markers=icon:http://chart.apis.google.com/chart?chst=d_map_pin_icon%26chld=cafe%257C996600%7C
224+West+20th+Street+NY%7C75+9th+Ave+NY%7C700+E+9th+St+NY&sensor=true (With Custom Marker Icon)





If u had any trouble just ask, Happy to help u :) 
Stay Tune... 
Have a nice day... 'N happy Coding :)

No comments: