There is a mapbox scrollytelling https://demos.mapbox.com/scrollytelling/. I need to acceess map(mouse click and mousemove), but can't access it.
I have tried with pointer-events:none
to parent layer(does not work for me, I applied it to almost every layer, but the map still does not receive the click event), but this one is fine but I need mouseover, mouseenter events too
document.addEventListener('click', function(e) {
console.log('e', e);
map.fire("click", {
lngLat: map.unproject([e.x, e.y]),
});
});
And there is a z-index:-5
for map layer, that affects click too somehow.
Actualy map.fire is fine, but how to pass mouseover, mouseenter etc.? Or any thoughts on pointer-events:none and z-index? All I need is to pass the evnts to map
Thanks