goomap

0.0.12 • Public • Published

GooMap

  1. Include the Google Map API.
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&">
</script>
  1. 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.

Readme

Keywords

none

Package Sidebar

Install

npm i goomap

Weekly Downloads

4

Version

0.0.12

License

none

Last publish

Collaborators

  • colshacol