Guest User

Untitled

a guest
Dec 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <Marker
  2. ref={(ref) => { this.marker = ref; }}
  3. draggable
  4. onDragEnd={(t, map, coords) => this.setDestination(coords)}
  5. coordinate={destination}
  6. position={destination}
  7. centerOffset={{ x: -18, y: -60 }}
  8. anchor={{ x: 0.69, y: 1 }}
  9. pinColor={COLOR.marker}
  10. onDragStart={() => this.setMarkerPosition()}
  11. />
  12.  
  13. setDestination(coords) {
  14. const { destination } = this.props;
  15. const lat = coords.lat();
  16. const long = coords.lng();
  17. console.log('seperate:', lat, long);
  18. console.log('destina:', coords);
  19. this.props
  20. .dispatch($setDestination(coords.lat(), coords.lng()))
  21. .catch((error) => this.props.dispatch(Activity.$toast('failure', error.message)));
  22.  
  23. this.setState((prevState) => ({
  24. isVisible: !prevState.isVisible,
  25. destination: destination[0].fullAddress,
  26. }));
  27. }
Add Comment
Please, Sign In to add comment