Open moovida opened 6 years ago
This is possible with some CSS today:
VAADIN/customstyles.css:
.v-leaflet.crosshair .leaflet-grab {
cursor:crosshair;
}
Following annotation to your UI/map component:
@StyleSheet("vaadin://customstyles.css")
And in you Java code if you want to enable the crosshair (or whatever cursor) for the time your click listener is valid:
map.addStyleName("crosshair");
mapClickListener = map.addClickListener(e-> {
// do your thing
// remove listener and crosshair style name
mapClickListener.remove();
map.removeStyleName("crosshair");
}
});
That's pretty easy for me and those who are comfortable with CSS, but I guess a Java API would be nice for most v-leaflet users. Which cursors should be supported?
Hello there.
@mstahv, it would be nice to support at least these type of cursors:
Regards.
I agree that a Java API would be amazing for the non-CSS champs as myself :-)
I am not sure if this is ok as issue, maybe more a feature request.
I need to change the cursor to crosshair to make the user pick informations on a tiles layer. Teh logic is handled ok by the onClick listener.
I have tried many css things at vaadin and component and window and whatever level, but I have not been able to change the mouse cursor in the map window.
Is there such a possibility?
(tested with vaadin 8)