Take the 2-minute tour ×

I'm evaluation Geomajas. Apparently, there's very little info on this framework across the Internet. I've managed to create a context menu for the map (the menu that appears when you right click on the map).

I want to do the same for a map point marker (I may need to extend this to other geometry types, i.e., Polygons, Multipolygons, Lines, etc). Anyone with an idea on how to do this, please assist.

Additionally, when I add context menu, the "About Geomajas" menu item hides my first menu item. Is there a way that I can add menu items from below this menu, or make it the last item in the menu?

I'm adding context menu by adding the line:

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I think you should just create your own context menu instead of adding to the existing one (in general you have to know the type of an object in SmartGWT to know which method to use to add items.

For example (from MeasureDistanceController):

    menu = new Menu();
    menu.addItem(new CancelMeasuringAction(this));
    Layer selectedLayer = mapWidget.getMapModel().getSelectedLayer();
    if (selectedLayer instanceof VectorLayer) {
        menu.addItem(new ToggleSnappingAction((VectorLayer) selectedLayer, this));
share|improve this answer
Thanks. I'll try this out. –  okello Jun 29 '12 at 16:26
add comment

Your Answer


