Select to view content in your preferred language

Mouse move

1004
2
05-17-2022 12:40 AM
Wade
by
Occasional Contributor

ArcGIS API 3.X can use mouse-move events get the coordinates, how does API 4.X get the coordinates?

// API 3.X
map.on('mouse-move', (evt) => {
       let evtMapPoint = evt.mapPoint;
       let lastPosition.X = evt.pageX;
       let lastPosition.Y = evt.pageY;
}
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

This is how in 4.x 

 

view.on('pointer-move', (event)=>{
 let point = view.toMap({x: event.x, y: event.y});
}

 

Wade
by
Occasional Contributor

Thank you so much!

0 Kudos