Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/MicheleBertoli/react-gmaps

A Google Maps component for React.js
https://github.com/MicheleBertoli/react-gmaps

Last synced: 6 days ago
JSON representation

A Google Maps component for React.js

Lists

README

        

[![Build Status](https://travis-ci.org/MicheleBertoli/react-gmaps.svg?branch=master)](https://travis-ci.org/MicheleBertoli/react-gmaps)

React Gmaps
===========

A [Google Maps](https://developers.google.com/maps/documentation/javascript/) component for [React.js](http://facebook.github.io/react/)

Features
--------

- Lazy Google Maps loading
- Easy to use

Installation
------------

```sh
$ npm install react-gmaps --save
```

Demo
------------

[http://react-gmaps.herokuapp.com/](http://react-gmaps.herokuapp.com/)

Usage
-----

```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import {Gmaps, Marker, InfoWindow, Circle} from 'react-gmaps';

const coords = {
lat: 51.5258541,
lng: -0.08040660000006028
};

const params = {v: '3.exp', key: 'YOUR_API_KEY'};

class App extends React.Component {

onMapCreated(map) {
map.setOptions({
disableDefaultUI: true
});
}

onDragEnd(e) {
console.log('onDragEnd', e);
}

onCloseClick() {
console.log('onCloseClick');
}

onClick(e) {
console.log('onClick', e);
}

render() {
return (





);
}

};

ReactDOM.render(, document.getElementById('gmaps'));
```

Test
----

```sh
$ npm test
```