layout.setMargin(5);
// ---------------------------------------------------------------------
// Create the left-side (map and tabs):
// ---------------------------------------------------------------------
final MapWidget map = new MapWidget("mapMain", "app");
final Toolbar toolbar = new Toolbar(map);
toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
VLayout mapLayout = new VLayout();
mapLayout.setShowResizeBar(true);
mapLayout.setResizeBarTarget("tabs");
mapLayout.addMember(toolbar);
mapLayout.addMember(map);
mapLayout.setHeight("65%");
tabSet.setTabBarPosition(Side.TOP);
tabSet.setWidth100();
tabSet.setHeight("35%");
tabSet.setID("tabs");
VLayout leftLayout = new VLayout();
leftLayout.setShowEdges(true);
leftLayout.addMember(mapLayout);
leftLayout.addMember(tabSet);
layout.addMember(leftLayout);
// ---------------------------------------------------------------------
// Create the right-side (overview map, layer-tree, legend):
// ---------------------------------------------------------------------
final SectionStack sectionStack = new SectionStack();
sectionStack.setShowEdges(true);
sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
sectionStack.setCanReorderSections(true);
sectionStack.setCanResizeSections(false);
sectionStack.setSize("300px", "100%");
// LayerTree layout:
SectionStackSection section2 = new SectionStackSection("Layer tree with legend");
section2.setExpanded(true);
layerTree = new LayerTreeWithLegend(map);
section2.addItem(layerTree);
sectionStack.addSection(section2);
// Putting the right side layouts together:
layout.addMember(sectionStack);
// ---------------------------------------------------------------------
// Create the right-side (overview map, layer-tree, legend):
// ---------------------------------------------------------------------
final SectionStack originalSectionStack = new SectionStack();
originalSectionStack.setShowEdges(true);
originalSectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
originalSectionStack.setCanReorderSections(true);
originalSectionStack.setCanResizeSections(false);
originalSectionStack.setSize("250px", "100%");
// Overview map layout:
SectionStackSection osection1 = new SectionStackSection("Overview map");
osection1.setExpanded(true);
overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
osection1.addItem(overviewMap);
originalSectionStack.addSection(osection1);
// LayerTree layout:
SectionStackSection osection2 = new SectionStackSection("Layer tree");
osection2.setExpanded(true);
LayerTree lt = new LayerTree(map);
osection2.addItem(lt);
originalSectionStack.addSection(osection2);
// Legend layout:
SectionStackSection osection3 = new SectionStackSection("Legend");
osection3.setExpanded(true);
Legend l = new Legend(map.getMapModel());
osection3.addItem(l);
originalSectionStack.addSection(osection3);
// Putting the right side layouts together:
layout.addMember(originalSectionStack);
// ---------------------------------------------------------------------
// Bottom left: Add tabs here:
// ---------------------------------------------------------------------
FeatureListGridPage page1 = new FeatureListGridPage(map);
addTab(new SearchPage(map, tabSet, page1.getTable()));
addTab(page1);
// ---------------------------------------------------------------------
// Theme
// ---------------------------------------------------------------------
themes = new ThemeWidget(map);
themes.setParentElement(map);
themes.setSnapTo("BL");
themes.setSnapOffsetTop(-50);
themes.setSnapOffsetLeft(10);
themes.setWidth(150);
exthemes = new ExpandingThemeWidget(map);
exthemes.setParentElement(map);
exthemes.setSnapTo("BR");
exthemes.setSnapOffsetTop(-50);
exthemes.setSnapOffsetLeft(-20);
// ---------------------------------------------------------------------
// Finally draw everything:
// ---------------------------------------------------------------------
mainLayout.addMember(layout);
mainLayout.draw();
// Install a loading screen
// This only works if the application initially shows a map with at least 1 vector layer:
LoadingScreen loadScreen = new LoadingScreen(map, "Simple GWT application using Geomajas "
+ Geomajas.getVersion());
loadScreen.draw();
// Then initialize:
initialize();
// -- Filter layer to show filterIcon
map.getMapModel().addMapModelHandler(new MapModelHandler() {
public void onMapModelChange(MapModelEvent event) {
VectorLayer countries = map.getMapModel().getVectorLayer("clientLayerCountries");
countries.setFilter("NAME NOT like 'France'");
}
});
}