A declarative React interface to Google Maps
JavaScript
Latest commit feb6e71 Mar 5, 2016 @petehunt petehunt Merge pull request #36 from bopinto/react-0.14
Update project to be compatible with React 0.14
Permalink
Failed to load latest commit information.
carview.php?tsp= docs Added Frag component Sep 15, 2014
carview.php?tsp= examples Update project to be compatible with React 0.14 Oct 8, 2015
carview.php?tsp= src Fix tests Oct 9, 2015
carview.php?tsp= .gitignore First! Sep 4, 2014
carview.php?tsp= .npmignore First! Sep 4, 2014
carview.php?tsp= .travis.yml First! Sep 4, 2014
carview.php?tsp= CHANGELOG.md Release 0.4.0 Jan 11, 2015
carview.php?tsp= LICENSE First! Sep 4, 2014
carview.php?tsp= README.md Release 0.4.0 Jan 11, 2015
carview.php?tsp= index.js Update to 0.12 Dec 25, 2014
carview.php?tsp= package.json Put dependencies in the right place Oct 9, 2015
carview.php?tsp= preprocessor.js First! Sep 4, 2014
carview.php?tsp= webpack.config.js First! Sep 4, 2014

README.md

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

var React = require('react');
var ReactGoogleMaps = require('react-googlemaps');
var GoogleMapsAPI = window.google.maps;
var Map = ReactGoogleMaps.Map;
var Marker = ReactGoogleMaps.Marker;
var OverlayView = ReactGoogleMaps.OverlayView;
function handleClick(e) {
  console.log('Clicked at position', e.latLng);
}
React.render(
  <Map
    initialZoom={10}
    initialCenter={new GoogleMapsAPI.LatLng(-41.2864, 174.7762)}>
    <Marker
      onClick={handleClick}
      position={new GoogleMapsAPI.LatLng(-41.2864, 174.7762)} />
    <OverlayView
      style={{backgroundColor: '#fff'}}
      position={new GoogleMapsAPI.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 »