Closed JosueAshton closed 1 year ago
Hi,
To get the latitude/longitude just to a function callback like:
const onDragEnd = (e) => { console.log(e.latLng.lng(), e.latLng.lat()) }
On e.latLng.lng() you'll let longitude, e.latLng.lat() you'll get Latitude.
Thanks @JosueAshton for your question, and thanks @michaelmota for answering.
Hi, the function callback gives me zero results
In the render:
<Marker lat={this.state.coords.lat} lng={this.state.coords.lng} draggable={true} onDragEnd={(e)=>{console.log(e)}} />
the result per console `onDragEnd .$k {latLng: .R, wa: undefined, pixel: .P, ra: undefined} latLng: .R lat: ƒ () lng: ƒ () arguments: null caller: null length: 0 name: "" prototype: {constructor: ƒ} proto: ƒ ()
proto: Object pixel: _.P {x: -90, y: -39} ra: undefined wa: undefined proto: Object`