Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Marker Right click event in Open Layers Map
Hi,
Is there any way i can catch a right click event over a Marker?
i added a MouseEvents.ClickListener to the marker but it only catches the left clicks, the right ones are ignored.
I noticed that the OpenLayersMap have an action handler that can be used for right click events but it's usuless for me as i need it on marker level.
Any Suggestions???
Thanks,
Dany
Hey did you find a solution for this ?
i Tried this but the event return a null point exception
marker.addClickListener(new ClickListener() {
/**
*
*/
private static final long serialVersionUID = 1L;
public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
if(event.getButton() == com.vaadin.event.MouseEvents.ClickEvent.BUTTON_RIGHT){
//Do something
}
}
}
});
Nope!!!
i just used the left mouse click.
if you debug your code nothing happens, coz only left mouse click is supported for markers.
you can always make a custom context menu with the left mouse click when the item is clicked.
BR
Dany
Ok thanks , yes i tried the handler but the problem with the contextMenu is you can get just the position X and Y But me I want the Object Marker cause i save some beans at the Marker.