google-static-maps-styler-query
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: