It enables to use all features of Google Maps API from parent component.
It has only a few features on startup:
- Passing markers as props
- Passing initial position and zoom
- Informing parent component when Google Maps API is ready
Firstly
npm install react-minimal-google-maps --save
Then
import Map from 'react-minimal-google-maps'
and in render function use something like this:
<Map
initialZoom={5}
initialCordinates={{lat: -34.397, lng: 150.644}}
markers={this.state.markers}
styles={{height: "500px"}}
updateLoadState={this.handleLoadUpdate}
/>
See example