goomap
v0.0.12
Published
1. Include the Google Map API.
Downloads
6
Readme
GooMap
- Include the Google Map API.
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&">
</script>
- Create shit.
<GooMap focus={[<LONGITUDE>, <LATITUDE>]}>
<Marker position={[<LONGITUDE>, <LATITUDE>]]}>
{InfoBox(
<div>
<h1>A place!</h1>
</div>
)}
</Marker>
</GooMap>
Unfortunately, at this point I am struggling to find a way to use a component as the InfoBox, as the Google InfoBox (infowindow) takes in a string of HTML to be inserted to the dom, so I rigged a way to still use JSX instead of a string to create your InfoBox. Don't try to use components inside of the InfoBox() function, as it will be placed directly into the DOM and not run through React to render().
This currently only supports the Map, Marker, and InfoBox, nothing more.