npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

google-maps-image-api-url

v1.0.3

Published

This is an easy way to consume the Google Maps Image API to render static maps or street views

Downloads

80

Readme

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
}