return new LayerOrderSample();
}
};
public Canvas getViewPanel() {
VLayout mainLayout = new VLayout();
mainLayout.setWidth100();
mainLayout.setHeight100();
// Build a map, and set a PanController:
VLayout mapLayout = new VLayout();
mapLayout.setShowEdges(true);
final MapWidget map = new MapWidget("mapLegend", "gwt-samples");
map.setController(new PanController(map));
mapLayout.addMember(map);
// Layer order panel:
VLayout orderLayout = new VLayout(10);
orderLayout.setHeight(80);
orderLayout.setShowEdges(true);
orderLayout.addMember(new HTMLFlow(I18nProvider.getSampleMessages().layerOrderTxt()));
HLayout buttonLayout = new HLayout(5);
buttonLayout.setPadding(10);
IButton upButton = new IButton(I18nProvider.getSampleMessages().layerOrderUpBtn());
upButton.setWidth(150);
upButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
VectorLayer layer = (VectorLayer) map.getMapModel().getLayer("clientLayerCountries110m");
map.getMapModel().moveVectorLayerUp(layer);
}
});
buttonLayout.addMember(upButton);
IButton downutton = new IButton(I18nProvider.getSampleMessages().layerOrderDownBtn());
downutton.setWidth(150);
downutton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
VectorLayer layer = (VectorLayer) map.getMapModel().getLayer("clientLayerCountries110m");
map.getMapModel().moveVectorLayerDown(layer);
}
});
buttonLayout.addMember(downutton);
orderLayout.addMember(buttonLayout);
orderLayout.setShowResizeBar(true);
// Add both to the main layout:
mainLayout.addMember(orderLayout);
mainLayout.addMember(mapLayout);