Google Apps Script API
    Preparing search index...

    Allows for the creation and decoration of static map images.

    The example below shows how you can use this class to create a map of New York City's Theatre District, including nearby train stations, and display it in a simple web app.

    // Create a map centered on Times Square.
    var map = Maps.newStaticMap()
        .setSize(600, 600)
        .setCenter('Times Square, New York, NY');
    
    // Add markers for the nearbye train stations.
    map.setMarkerStyle(Maps.StaticMap.MarkerSize.MID, Maps.StaticMap.Color.RED, 'T');
    map.addMarker('Grand Central Station, New York, NY');
    map.addMarker('Penn Station, New York, NY');
    
    // Show the boundaries of the Theatre District.
    var corners = [
      '8th Ave & 53rd St, New York, NY',
      '6th Ave & 53rd St, New York, NY',
      '6th Ave & 40th St, New York, NY',
      '8th Ave & 40th St, New York, NY'
    ];
    map.setPathStyle(4, Maps.StaticMap.Color.BLACK, Maps.StaticMap.Color.BLUE);
    map.beginPath();
    for (var i = 0; i < corners.length; i++) {
      map.addAddress(corners[i]);
    }
    // All static map URLs require an API key.
    var url = map.getMapUrl() + "&key=YOUR_API_KEY";
    

    See also

    Google Static Maps API

    interface StaticMap {
        addAddress(address: string): StaticMap;
        addMarker(latitude: number, longitude: number): StaticMap;
        addMarker(address: string): StaticMap;
        addPath(points: number[]): StaticMap;
        addPath(polyline: string): StaticMap;
        addPoint(latitude: number, longitude: number): StaticMap;
        addVisible(latitude: number, longitude: number): StaticMap;
        addVisible(address: string): StaticMap;
        beginPath(): StaticMap;
        clearMarkers(): StaticMap;
        clearPaths(): StaticMap;
        clearVisibles(): StaticMap;
        endPath(): StaticMap;
        getAs(contentType: string): Blob;
        getBlob(): Blob;
        getMapImage(): number[];
        getMapUrl(): string;
        setCenter(latitude: number, longitude: number): StaticMap;
        setCenter(address: string): StaticMap;
        setCustomMarkerStyle(imageUrl: string, useShadow: boolean): StaticMap;
        setFormat(format: string): StaticMap;
        setLanguage(language: string): StaticMap;
        setMapType(mapType: string): StaticMap;
        setMarkerStyle(size: string, color: string, label: string): StaticMap;
        setMobile(useMobileTiles: boolean): StaticMap;
        setPathStyle(weight: number, color: string, fillColor: string): StaticMap;
        setSize(width: number, height: number): StaticMap;
        setZoom(zoom: number): StaticMap;
    }
    Index

    Methods