{"id":13481641,"url":"https://github.com/cedricdelpoux/react-google-maps-loader","last_synced_at":"2025-06-15T10:40:01.622Z","repository":{"id":38457305,"uuid":"42185167","full_name":"cedricdelpoux/react-google-maps-loader","owner":"cedricdelpoux","description":"Simple loader to use google maps services into your react applications","archived":false,"fork":false,"pushed_at":"2023-02-17T11:14:46.000Z","size":3069,"stargazers_count":53,"open_issues_count":4,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-08T21:54:41.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cedricdelpoux.github.io/react-google-maps-loader","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/cedricdelpoux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-09T14:54:06.000Z","updated_at":"2025-05-04T12:13:37.000Z","dependencies_parsed_at":"2024-06-18T15:25:29.122Z","dependency_job_id":"a739d963-b62f-42f7-852e-bd1703b97b36","html_url":"https://github.com/cedricdelpoux/react-google-maps-loader","commit_stats":{"total_commits":77,"total_committers":11,"mean_commits":7.0,"dds":0.4545454545454546,"last_synced_commit":"d8e82e7e21589585cc335495d3e1a788ac424d7d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/cedricdelpoux/react-google-maps-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricdelpoux%2Freact-google-maps-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricdelpoux%2Freact-google-maps-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricdelpoux%2Freact-google-maps-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricdelpoux%2Freact-google-maps-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedricdelpoux","download_url":"https://codeload.github.com/cedricdelpoux/react-google-maps-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricdelpoux%2Freact-google-maps-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259960819,"owners_count":22938136,"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":[],"created_at":"2024-07-31T17:00:53.599Z","updated_at":"2025-06-15T10:40:01.571Z","avatar_url":"https://github.com/cedricdelpoux.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["Misc"],"readme":"# react-google-maps-loader\n\n[![npm package][npm-badge]][npm]\n[![Travis][build-badge]][build]\n[![Codecov][codecov-badge]][codecov]\n![Module formats][module-formats]\n\nReact Component to use google maps services into your react applications using a render prop.\n\n## Getting started\n\n[![react-google-maps-loader](https://nodei.co/npm/react-google-maps-loader.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/react-google-maps-loader/)\n\nYou can download `react-google-maps-loader` from the NPM registry via the `npm` or `yarn` commands\n\n```shell\nyarn add react-google-maps-loader\nnpm install react-google-maps-loader --save\n```\n\nIf you don't use package manager and you want to include `react-google-maps-loader` directly in your html, you could get it from the UNPKG CDN\n\n```html\nhttps://unpkg.com/react-google-maps-loader/dist/react-google-maps-loader.min.js.\n```\n\nYou can also try the component's editable demo hands-on and install it from [bit.dev](https://bit.dev/cedricdelpoux/react-google-maps-loader/react-google-maps-loader?example=5d592e9f500b4e00146cca67).\n\n## Usage\n\n### Load Map Only\n\nThis renders when the map is ready, with no loading state.\n\n```javascript\nimport React from \"react\"\nimport ReactGoogleMapLoader from \"react-google-maps-loader\"\n\nconst App = () =\u003e (\n    \u003cReactGoogleMapLoader\n        params={{\n            key: YOUR_API_KEY, // Define your api key here\n            libraries: \"places,geometry\", // To request multiple libraries, separate them with a comma\n        }}\n        render={googleMaps =\u003e googleMaps \u0026\u0026 \u003cdiv\u003eGoogle Maps is loaded !\u003c/div\u003e}\n    /\u003e\n)\n```\n\n### Show Loading State\n\nYou can show a custom loading state while the user is still online by using the error values.\n\n#### Error Values\n\n-   `[String] Network Error` - if the user us offline.\n\n-   `[String] SDK Authentication Error` - if there is a problem loading Google maps due to incorrect keys, going over quota or one of the errors listed in the [Error Messages Documentation](https://developers.google.com/maps/documentation/javascript/error-messages).\n\n-   `undefined` - map loaded correctly.\n\n```js\nimport React from \"react\"\nimport ReactGoogleMapLoader from \"react-google-maps-loader\"\n\nconst App = () =\u003e (\n    \u003cReactGoogleMapLoader\n        params={{\n            key: YOUR_API_KEY, // Define your api key here\n            libraries: \"places,geometry\", // To request multiple libraries, separate them with a comma\n        }}\n        render={(googleMaps, error) =\u003e\n            googleMaps ? (\n                \u003cdiv\u003e\n                    {/*Show a custom error if SDK Authentication Error. See N/B 2 below.*/}\n                    {error ? error : \"Google Maps is loaded !\"}\n                \u003c/div\u003e\n            ) : (\n                \u003cdiv\u003e\n                    {/*Check for network error so loading state ends if user lost connection.*/}\n                    {error === \"Network Error\" ? (\n                        \u003cp\u003e{error}\u003c/p\u003e\n                    ) : (\n                        \u003cp\u003eisLoading...\u003c/p\u003e\n                    )}\n                \u003c/div\u003e\n            )\n        }\n    /\u003e\n)\n```\n\nN/B:\n\n1. The Google Maps API does not provide errors in the callback but logs them to the console. We grouped all Google Maps errors not related to network connectivity as `SDK Authentication Error`. Check the console if you get this.\n\n2. `googleMaps` always loads as long as there is no `Network Error` and the previous state is not cached. So, handle `SDK Authentication Errors` (See 1. above) in the `googleMaps` part of the conditional rendering as shown in the code above.\n\n## Demo\n\nSee [Demo page][github-page]\n\n## Contributing\n\n-   ⇄ Pull/Merge requests and ★ Stars are always welcome.\n-   For bugs and feature requests, please [create an issue][github-issue].\n-   Pull requests must be accompanied by passing automated tests (`npm test`).\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines\n\n## Changelog\n\nSee [changelog](./CHANGELOG.md)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENCE.md](./LICENCE.md) file for details\n\n[npm-badge]: https://img.shields.io/npm/v/react-google-maps-loader.svg?style=flat-square\n[npm]: https://www.npmjs.org/package/react-google-maps-loader\n[build-badge]: https://img.shields.io/travis/cedricdelpoux/react-google-maps-loader/master.svg?style=flat-square\n[build]: https://travis-ci.org/cedricdelpoux/react-google-maps-loader\n[codecov-badge]: https://img.shields.io/codecov/c/github/cedricdelpoux/react-google-maps-loader.svg?style=flat-square\n[codecov]: https://codecov.io/gh/cedricdelpoux/react-google-maps-loader\n[module-formats]: https://img.shields.io/badge/module%20formats-umd%2C%20cjs%2C%20esm-green.svg?style=flat-square\n[github-page]: https://cedricdelpoux.github.io/react-google-maps-loader\n[github-issue]: https://github.com/cedricdelpoux/react-google-maps-loader/issues/new\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedricdelpoux%2Freact-google-maps-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedricdelpoux%2Freact-google-maps-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedricdelpoux%2Freact-google-maps-loader/lists"}