Created
March 29, 2015 06:53
-
-
Save zpratt/8833c6f4b4b83437b411 to your computer and use it in GitHub Desktop.
React Google Maps Overlay Component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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