Skip to content

Instantly share code, notes, and snippets.

@zpratt
Created March 29, 2015 06:53
Show Gist options
  • Save zpratt/8833c6f4b4b83437b411 to your computer and use it in GitHub Desktop.
Save zpratt/8833c6f4b4b83437b411 to your computer and use it in GitHub Desktop.
React Google Maps Overlay Component
/**
* @jsx React.DOM
*/
'use strict';
var OverlayFactory = require('async-google-maps').BaseOverlayFactory,
React = require('react');
module.exports = React.createClass({
componentDidMount: function () {
var element = this.getDOMNode();
OverlayFactory.create({
point: this.props.point,
el: element,
map: this.props.map
});
},
render: function () {
var overlayStyle = {
backgroundColor: '#FFF',
border: '1px solid #000'
};
return (
<div className="overlay" style={overlayStyle}>
<p>
{this.props.message}
</p>
</div>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment