I managed to add interactivity to a feature layer added from a remote GeoJSON resource. When I click on a feature I get its ID, fire an AJAX request and display some relevant info about the feature, on the page outside of the map area.
I used a Select
interaction.
I would like to make it even clearer to the user that he can click on the features on the map. Is there any way I can change the mouse cursor to "cursor" of "hand" when the mouse hovers a feature contained in a ol.layer.Vector
?
I couldn't find anything in the doc, on this site or by googling.
getTarget
gives you what to give to the map target: either string or HTMLElement. Should be HTMLElement, like in the example, if you want to change its style. – Heterogonymap.getTargetElement().style.cursor = 'pointer';
worked for me – Regulation