Google Maps Image API allows you to get static images of a 2d map or streetview.
This module will return a promise or you can call it via a callback.
The callback will return an error (if an error occured) and and HTMLImageElement.
Options passed in correlate to properties you can pass to Google Maps Image API.
Here are parameter's you can pass through opts to render a static map:
//// REQUIRED ////type: 'staticmap' // This value is required if you want to render a static mapcenter: '40.714728,-73.998672' // This will be the center of your image.// It can also be a street address//// OPTIONAL ////key: 'your api key' // Your Google API Keyzoom: 14 // This will be how zoomed in the map will be. 0 is where you// can see the entire world, 21 is where you see streets. 14 is defaultsize: '320x240' // This is the pixel size of your map. Default 320x240scale: 1 // This property is meant for rendering maps with high pixel// resolutions eg. iphone 4+ is retina this value should be set to 2format: 'JPEG' // Possible valuse 'PNG', 'GIF', 'JPEG',maptype: 'roadmap' // What type of map you want to render// 'roadmap', 'satellite', 'hybrid', and 'terrain'language: 'en' // Language in which you want the map to be renderedregion: 'us' // Country code in: ccTLD. defines the appropriate borders to display,// based on geo-political sensitivitiesmarkers: 'color:blue|label:S|11211|11206|11222'// Add markers to the map. For docs://path: 'color:0x0000ff|weight:5|40.737102,-73.990318|40.749825,-73.987963'// Add a path to the map. A path can be filled or just a line. For docs://visible: 'Toronto' // you can specify locations that should be visible on the// rendered map. This can be either lat,long or a location namestyle: 'feature:administrative|element:labels|weight:3.9|visibility:on|inverse_lightness:true'// this property will change how features are rendered eg. roads, parks, etc.// For docs://
Here are the parameters you'd pass in to render a streetview:
//// REQUIRED ////type: 'streetview'location: 'Toronto' // Location name or long,lat.// if you ommit location you must define panopano: 'pano id' // An id for a specific panorama. If you omit// you must define a location//// OPTIONAL ////key: 'your api key' // Your Google API Keysize: '320x240' // The size of your render in pixelsheading: 45 // This is the compass heading which the camera is pointing at// between 0 and 360. 0 == Northfov: 90 // field of view expressed in degrees. (angle which determines how much you see)// default is 90pitch: 0 // up down angle the camera is pointing at. 90 is straight up and -90 is straight down
Object- These are options that will be used to render streetview and map images
function- Optionally you can use a callback over a promise. See above for details
Scope: inner member of google-maps-image-api
Promise - A promise is returned which will return an HTMLImageElement