I've been trying to add a contextmenu to a marker, but I can't figure out how to get the contextmenu to appear.
marker.addEventListener("rightclick", new MapMouseEvent() {
@Override
public void onEvent(MouseEvent event) {
contextMenu.show(
marker, marker.getPosition().getLat(),
marker.getPosition().getLng()
);
}
});
I tried to cast marker as Node, but that didn't work, help?
To display a popup menu on JxMaps you have to do the next actions:
Please take a look at the following example: