Need private packages and team management tools?Check out npm Teams »

google-static-maps-styler-query

3.0.0 • Public • Published

google-static-maps-styler-query

npm version CI status

Converts a Google Maps styler array to a Google Static Maps styler URL query string.

Setup

To install from npm run:

npm install google-static-maps-styler-query

Support

API

Table of contents

function googleStaticMapsStylerQuery

Converts a Google Maps styler array to a Google Static Maps styler URL query string.

Parameter Type Description
styles Array<object> Google Maps styler array.

Returns: string — Google Static Maps styler URL query string.

Examples

How to create a styled static map URL.

const googleStaticMapsStylerQuery = require('google-static-maps-styler-query')
 
const styles = [{ elementType: 'labels', stylers: [{ visibility: 'off' }] }]
const stylerQuery = googleStaticMapsStylerQuery(styles)
const googleStaticMapSrc = `https://maps.googleapis.com/maps/api/staticmap?center=Australia&size=250x200${stylerQuery}`

Install

npm i google-static-maps-styler-query

DownloadsWeekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

8.31 kB

Total Files

4

Last publish

Collaborators

  • avatar