Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onMapClick = (map,maps,e) => {
- const { latLng } = e;
- const latitude = e.latLng.lat();
- const longitude = e.latLng.lng();
- console.log(latitude + ", " + longitude);
- var marker = new window.google.maps.Marker({
- position: e.latLng,
- setMap: map,
- });
- }
- <Marker
- onClick={this.onMarkerClick}
- name={storedLocations[0]}
- position={{lat:listLatitude[0], lan:listLongitude[0]}}
- />
- <InfoWindow
- marker={this.state.activeMarker}
- visible={this.state.showingInfoWindow}
- onClose={this.onClose}
- >
- <div>
- <h4>{this.state.selectedPlace.name}</h4>
- </div>
- </InfoWindow>
- </Map>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement