{"id":15673653,"url":"https://github.com/jaydenseric/google-static-maps-styler-query","last_synced_at":"2025-05-12T19:27:30.144Z","repository":{"id":57252351,"uuid":"85454289","full_name":"jaydenseric/google-static-maps-styler-query","owner":"jaydenseric","description":"Converts a Google Maps styler array to a Google Static Maps styler URL query string.","archived":false,"fork":false,"pushed_at":"2022-08-22T21:56:55.000Z","size":75,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T02:02:46.438Z","etag":null,"topics":["maintained","node","npm","typescript"],"latest_commit_sha":null,"homepage":"https://npm.im/google-static-maps-styler-query","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jaydenseric"}},"created_at":"2017-03-19T05:55:02.000Z","updated_at":"2023-08-30T14:25:11.000Z","dependencies_parsed_at":"2022-08-31T22:11:09.418Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/google-static-maps-styler-query","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgoogle-static-maps-styler-query","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgoogle-static-maps-styler-query/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgoogle-static-maps-styler-query/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgoogle-static-maps-styler-query/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/google-static-maps-styler-query/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253807573,"owners_count":21967384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maintained","node","npm","typescript"],"created_at":"2024-10-03T15:41:38.531Z","updated_at":"2025-05-12T19:27:30.113Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jaydenseric"],"categories":[],"sub_categories":[],"readme":"# google-static-maps-styler-query\n\nConverts a [Google Maps styler array](https://developers.google.com/maps/documentation/javascript/style-reference) to a [Google Static Maps styler URL query string](https://developers.google.com/maps/documentation/maps-static/styling).\n\n## Installation\n\nFor [Node.js](https://nodejs.org), to install [`google-static-maps-styler-query`](https://npm.im/google-static-maps-styler-query) with [npm](https://npmjs.com/get-npm), run:\n\n```sh\nnpm install google-static-maps-styler-query\n```\n\nFor browsers, an example import map:\n\n```json\n{\n  \"imports\": {\n    \"google-static-maps-styler-query\": \"https://unpkg.com/google-static-maps-styler-query@6.0.0/googleStaticMapsStylerQuery.mjs\"\n  }\n}\n```\n\nThen, import and use the function [`googleStaticMapsStylerQuery`](./googleStaticMapsStylerQuery.mjs).\n\n## Examples\n\nHow to create a styled static map URL:\n\n```js\nimport googleStaticMapsStylerQuery from \"google-static-maps-styler-query\";\n\nconst styles = [{ elementType: \"labels\", stylers: [{ visibility: \"off\" }] }];\nconst stylerQuery = googleStaticMapsStylerQuery(styles);\nconst googleStaticMapSrc = `https://maps.googleapis.com/maps/api/staticmap?center=Australia\u0026size=250x200${stylerQuery}`;\n```\n\n## Requirements\n\nSupported runtime environments:\n\n- [Node.js](https://nodejs.org) versions `^14.17.0 || ^16.0.0 || \u003e= 18.0.0`.\n- Browsers matching the [Browserslist](https://browsersl.ist) query [`\u003e 0.5%, not OperaMini all, not dead`](https://browsersl.ist/?q=%3E+0.5%25%2C+not+OperaMini+all%2C+not+dead).\n\nProjects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:\n\n- [`compilerOptions.allowJs`](https://typescriptlang.org/tsconfig#allowJs) should be `true`.\n- [`compilerOptions.maxNodeModuleJsDepth`](https://typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.\n- [`compilerOptions.module`](https://typescriptlang.org/tsconfig#module) should be `\"node16\"` or `\"nodenext\"`.\n\n## Exports\n\nThe [npm](https://npmjs.com) package [`google-static-maps-styler-query`](https://npm.im/google-static-maps-styler-query) features [optimal JavaScript module design](https://jaydenseric.com/blog/optimal-javascript-module-design). These ECMAScript modules are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):\n\n- [`googleStaticMapsStylerQuery.mjs`](./googleStaticMapsStylerQuery.mjs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fgoogle-static-maps-styler-query","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Fgoogle-static-maps-styler-query","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fgoogle-static-maps-styler-query/lists"}