Return to Snippet

Revision: 49624
at July 27, 2011 00:46 by ddavidd


Updated Code
/* Returns a static Google map image
 * 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
 */
function getStaticMap(location, zoom, size, maptype, mcolor, mlabel, mlocation) {
    return "http://maps.googleapis.com/maps/api/staticmap?" +
           "center=" + location +
           "&zoom=" + zoom +
           "&size=" + size +
           "&maptype=" + maptype +
           "&sensor=true" +
           "&markers=color:" + mcolor +
             "|label:" + mlabel +
             "|" + mlocation";
}

Revision: 49623
at July 27, 2011 00:45 by ddavidd


Updated Code
/* Returns a static Google map image
 * 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
 */
function getStaticMap(location, zoom, size, maptype, mcolor, mlocation, mlabel) {
    return "http://maps.googleapis.com/maps/api/staticmap?" +
           "center=" + location +
           "&zoom=" + zoom +
           "&size=" + size +
           "&maptype=" + maptype +
           "&sensor=true" +
           "&markers=color:" + mcolor +
             "|label:" + mlabel +
             "|" + mlocation";
}

Revision: 49622
at July 27, 2011 00:45 by ddavidd


Initial Code
/* Returns a static Google map
 * 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
 */
function getStaticMap(location, zoom, size, maptype, mcolor, mlocation, mlabel) {
    return "http://maps.googleapis.com/maps/api/staticmap?" +
           "center=" + location +
           "&zoom=" + zoom +
           "&size=" + size +
           "&maptype=" + maptype +
           "&sensor=true" +
           "&markers=color:" + mcolor +
             "|label:" + mlabel +
             "|" + mlocation";
}

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

Initial Description


Initial Title
Google Static Maps

Initial Tags
google, api

Initial Language
JavaScript