Using the latest version of OpenLayers with React. Trying to change the cursor to pointer in the following way:
function mapOnMove(evt) {
if (evt.dragging) return;
const pixel = map.getEventPixel(evt.originalEvent);
const hit = map.hasFeatureAtPixel(pixel);
evt.map.getTargetElement().style.cursor = hit ? 'pointer' : '';
}
In development everything works as expecting. Cursor turns into pointer on feature hover. However, after using build script, and serving static files - cursor pointer doesn't work. Tried to look for the reasons and couldn't find anything appropriate. Maybe someone has any ideas.