MapMouseEvent misses lngLat property on drag
@mourner is already working on this.
Since Jul 9, 2021.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**browser**:
Chrome@72.0
### Steps to Trigger Behavior
1.Listento drag Event
2. Try access Latlng property from MapMouseEvent
3.
### Link to Demonstration
[demonstration](https://jsbin.com/tizemukuna/edit?html,console,output )
```
Display a map
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
mapboxgl.accessToken = 'pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4M29iazA2Z2gycXA4N2pmbDZmangifQ.-g_vE53SD2WrJ6tFX7QHmA';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v9', // stylesheet location
center: [-74.50, 40], // starting position [lng, lat]
zoom: 9 // starting zoom
});
map.on('drag', function(e){
console.log(e)
});
```
### Expected Behavior
According to the [docs](https://docs.mapbox.com/mapbox-gl-js/api/#mapmouseevent)
the MapMouseEvent Object should contain following properties:
- type
- target
- originalEvent
- point
- lngLat
- preventDefault()
- defaultPrevented
### Actual Behavior
- type
- originalEvent
- target
**accessing lngLat would result in** `undefined`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.