How to handle the mouseover on mapview, map any object and use event.x and y to display the map info
i tried the following
view.container.onmouseover = function (event) {
var sp = new ScreenPoint();
sp.x = event.x;
sp.y = event.y;
view.hitTest(sp).then(function (response) {
var graphics = response.results;
graphics.forEach(function (graphic) {
console.log(graphic);
});
});
}
but if the map is contained on page.that has header or another html element the event of x ,y is not correct
This is what I do before calling 'toMap()'...
toMapPoint: function (evt) {
var adjustedX = evt.clientX - this.view.position[0];
var adjustedY = evt.clientY - this.view.position[1];
return this.view.toMap(adjustedX, adjustedY);
}