Google Static Maps


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /* Returns a static Google map image
  2.  * ie: http://maps.googleapis.com/maps/api/staticmap?center=41.156677,-87.877624&markers=color:485C59|label:A|41.156677,-87.877624&zoom=16&size=900x400&maptype=roadmap&sensor=true
  3.  */
  4. function getStaticMap(location, zoom, size, maptype, mcolor, mlabel, mlocation) {
  5. return "http://maps.googleapis.com/maps/api/staticmap?" +
  6. "center=" + location +
  7. "&zoom=" + zoom +
  8. "&size=" + size +
  9. "&maptype=" + maptype +
  10. "&sensor=true" +
  11. "&markers=color:" + mcolor +
  12. "|label:" + mlabel +
  13. "|" + mlocation";
  14. }

URL: http://code.google.com/apis/maps/documentation/staticmaps

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.