<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\758211560\46blogName\75Tech+Tips,+Tricks+%26+Trivia\46publishMode\75PUBLISH_MODE_BLOGSPOT\46navbarType\75BLUE\46layoutType\75CLASSIC\46searchRoot\75http://mvark.blogspot.com/search\46blogLocale\75en\46v\0752\46homepageUrl\75http://mvark.blogspot.com/\46vt\75-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
A seasoned developer's little discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


Display region, route or location with Google Static Maps

Unlike a regular Google Map that requires JavaScript to fetch the tiles that make up a map, Google Static Maps returns a single map image, is faster to load and does not need JavaScript. To get started, you can use the Static Maps Wizard or use the Static Maps API to customize the map with markers, lines & shaded areas to highlight a location, route or region. Like Google Charts, Google Static Maps API accepts inputs to generate a map through querystring values.


The following URL shows the location of the British Library in Hyderabad as a map image -
http://maps.google.com/maps/api/staticmap?center=17.407256,78.472274
&zoom=16
&markers=17.407256,78.472274
&path=color:0x0000FF80|weight:5|17.42340,78.45685
&size=300x300
&sensor=false

The URL parameters like maptype (optional), center, zoom, markers, path, size, format (optional), sensor are all well-documented.

I learnt about this tool from Christian Heilmann's interesting article on Geo Location. Christian Heilmann is a Web Developer Evangelist working for the Yahoo Developer Network and author of The Developer Evangelist handbook.

Labels: ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment