Answers for "@react-google-maps/api npm"

3

npm google map api react

import {Map, InfoWindow, Marker, GoogleApiWrapper} from 'google-maps-react';

export class MapContainer extends Component {
  render() {
    return (
      <Map google={this.props.google} zoom={14}>

        <Marker onClick={this.onMarkerClick}
                name={'Current location'} />

        <InfoWindow onClose={this.onInfoWindowClose}>
            <div>
              <h2>{this.state.selectedPlace.name}</h2>
            </div>
        </InfoWindow>
      </Map>
    );
  }
}

export default GoogleApiWrapper({
  apiKey: (YOUR_GOOGLE_API_KEY_GOES_HERE)
})(MapContainer)
Posted by: Guest on June-01-2020
1

@react-google-maps/api npm

npm i -S @react-google-maps/api
Posted by: Guest on November-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language