
Description
react-google-maps is a set of React components that wrap the Google Maps JavaScript API v3. It handles prop passing, turns map events into callbacks, manages the lifecycle of map objects and mounts child components onto the map automatically. Anything you render inside a map component appears on the map, and it is removed from the map when you stop rendering it. The library provides a GoogleMap component and a Marker component, plus a withGoogleMap higher-order component that creates the DOM instances the map needs, and withScriptjs, which loads the Google Maps script. The documentation site lists the props and public methods of each component and includes live demos you can edit in the browser. Its guide shows the install with npm or yarn and walks through building a custom map component in five steps. Limits that come from Google Maps itself are not handled by the library, since it is a thin wrapper around the API. The documentation was built with react-styleguidist.…
Highlights
- React components for Google Maps JavaScript API v3
- GoogleMap and Marker components
- Event handlers passed as callbacks
- withGoogleMap and withScriptjs higher-order components
- Live editable demos for each component
Ratings & Reviews
No ratings yet
Be the first to rate react-google-maps.
People also visit
react-google-maps FAQ
What is react-google-maps?
It is a library of React components that wrap the Google Maps JavaScript API, so you can build maps with React components.
How do I install it?
Run npm install --save react-google-maps or yarn add react-google-maps in your project.
How does a marker get on the map?
Render a Marker inside your GoogleMap component. It is mounted on the map while rendered and removed when you stop rendering it.
Why do I need withGoogleMap?
Wrapping a component with withGoogleMap creates the DOM instances the map needs. The guide shows this as step two of building a custom map.
What does withScriptjs do?
It loads the Google Maps script before the map component renders, so you do not have to add the script tag yourself.
Can I see examples before I install?
Yes. The documentation site has live demos for each component, and you can edit the code in the browser.
Is it a Google product?
No. It is a community library that wraps Google's API. Limits that come from Google Maps itself are not changed by the library.
What are the best react-google-maps alternatives?
Popular alternatives to react-google-maps include google-map-react, google-map-react and google-maps-react-markers. See all react-google-maps alternatives
















