Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. onMapClick = (map,maps,e) => {
  2. const { latLng } = e;
  3. const latitude = e.latLng.lat();
  4. const longitude = e.latLng.lng();
  5. console.log(latitude + ", " + longitude);
  6.  
  7. var marker = new window.google.maps.Marker({
  8. position: e.latLng,
  9. setMap: map,
  10. });
  11. }
  12.  
  13. <Marker
  14. onClick={this.onMarkerClick}
  15. name={storedLocations[0]}
  16. position={{lat:listLatitude[0], lan:listLongitude[0]}}
  17. />
  18.  
  19. <InfoWindow
  20. marker={this.state.activeMarker}
  21. visible={this.state.showingInfoWindow}
  22. onClose={this.onClose}
  23. >
  24. <div>
  25. <h4>{this.state.selectedPlace.name}</h4>
  26. </div>
  27. </InfoWindow>
  28. </Map>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement