Skip to content

Repository files navigation

React Google Maps Build Status

A declarative React interface to Google Maps.

Check it out:

Important Notes

This is an alpha release. The API and organizational structure are subject to change. Comments and contributions are much appreciated.

Installation

npm install react-googlemaps --save

This library is written with CommonJS modules. If you are using browserify, webpack, or similar, you can consume it like anything else installed from npm.

Usage

varReact=require('react');varReactGoogleMaps=require('react-googlemaps');varGoogleMapsAPI=window.google.maps;varMap=ReactGoogleMaps.Map;varMarker=ReactGoogleMaps.Marker;varOverlayView=ReactGoogleMaps.OverlayView;functionhandleClick(e){console.log('Clicked at position',e.latLng);}React.render(<MapinitialZoom={10}initialCenter={newGoogleMapsAPI.LatLng(-41.2864,174.7762)}><MarkeronClick={handleClick}position={newGoogleMapsAPI.LatLng(-41.2864,174.7762)}/><OverlayViewstyle={{backgroundColor: '#fff'}}position={newGoogleMapsAPI.LatLng(-41.2864,174.7762)}><p>Some content</p></OverlayView></Map>,mountNode);

Checkout the API docs or the examples directory for more detailed usage.

License

Licensed under MIT. Full license here »

About

A declarative React interface to Google Maps

Resources

Stars

226 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages