Reputation: 519
I change the mouse cursor to "pointer" on features the following way:
// change mouse cursor when over marker
map.on('pointermove', function(e) {
var pixel = map.getEventPixel(e.originalEvent);
var hit = map.hasFeatureAtPixel(pixel);
map.getTarget().style.cursor = hit ? 'pointer' : '';
});
The problem is, when I open a popup, the cursor changes even if the feature is covered by the popup (see https://jsfiddle.net/Ld9rup3v/2/: click on the lower point and you can hover over the upper point through the popup). How can I prevent that?
Upvotes: 2
Views: 629