google-static-maps-styler-query

6.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.

Installation

To install with npm, run:

npm install google-static-maps-styler-query

Examples

How to create a styled static map URL:

import googleStaticMapsStylerQuery from "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}`;

Requirements

  • Node.js: ^12.22.0 || ^14.17.0 || >= 16.0.0
  • Browsers: > 0.5%, not OperaMini all, not IE > 0, not dead

Exports

These ECMAScript modules are published to npm and exported via the package.json exports field:

Package Sidebar

Install

npm i google-static-maps-styler-query

Weekly Downloads

5

Version

6.0.0

License

MIT

Unpacked Size

6.03 kB

Total Files

4

Last publish

Collaborators

  • jaydenseric