GithubHelp home page GithubHelp logo

isabella232 / google-maps-image-api-url Goto Github PK

View Code? Open in Web Editor NEW

This project forked from experience-monks/google-maps-image-api-url

0.0 0.0 0.0 14 KB

This module will return a string which is a url to load an image from the Google Maps Image API

License: MIT License

JavaScript 100.00%

google-maps-image-api-url's Introduction

google-maps-image-api

Allows you to easily get Google Maps Image API urls.

Google Maps Image API allows you to get static images of a 2d map or streetview. This module will return the url of such an image. The options correlate to those in the API.

usage

const image = require('google-maps-image-api')
image({
	type: 'staticmap',
	center: '40.714728,-73.998672'
}) // -> url

static maps

required parameters

{
	type: 'staticmap',
	center: '40.714728,-73.998672' // can also be a street address
}

optional parameters

{
	key: '<your api key>', // your Google API Key
	zoom: 14, // 0 = entire world, 21 = streets
	size: '320x240', // size of the image
	scale: 1, // for retina screens this should be 2
	format: 'JPEG', // or 'PNG' or 'GIF'
	maptype: 'roadmap', // or 'satellite' or 'hybrid' or 'terrain'
	language: 'en', // language of the map

 	region: 'us', // country code in ccTLD
 	// defines the appropriate borders to display, based on geo-political sensitivities

	markers: 'color:blue|label:S|11211|11206|11222', // add markers to the map
	// see https://developers.google.com/maps/documentation/staticmaps/index#Markers

	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.
	// see https://developers.google.com/maps/documentation/staticmaps/index#Paths

	visible: 'Toronto', // a location that should be visible
	// This can be either long,lat or a location name.

	style: 'feature:administrative|element:labels|weight:3.9|visibility:on|inverse_lightness:true',
	// how features are rendered eg. roads, parks, etc.
	// see https://developers.google.com/maps/documentation/staticmaps/index#StyledMaps
}

streetview pictures

required parameters

{
	type: 'streetview',
	// You must define either location or pano.
	location: 'Toronto', // location name or long,lat
	pano: '<pano id>', // id of a specific panorama
}

optional parameters

{
	key: '<your api key>', // your Google API key
	size: '320x240', // size of the image
	heading: 45, // bearing (direction) of the camera. 0 - 360. 0 == North
	fov: 90, // field of view in degrees.
	pitch: 0, // up/down angle of the camera. 90 = straight up. -90 = straight down
}

google-maps-image-api-url's People

Contributors

derhuerst avatar mikkoh avatar romuloctba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.