Package org.geomajas.gwt.client.widget

Examples of org.geomajas.gwt.client.widget.MapWidget


    layout.setMargin(10);

    // ---------------------------------------------------------------------
    // 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);
    toolbar.setBackgroundColor("#647386");
    toolbar.setBackgroundImage("");
    toolbar.setBorder("0px");

    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        Label title = new Label("Geomajas GWT: hello world");
        title.setStyleName("appTitle");
        title.setWidth(260);
        toolbar.addFill();
        toolbar.addMember(title);
      }
    });

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");

    VLayout leftLayout = new VLayout();
    leftLayout.setBorder("10px solid #777777");
    leftLayout.setStyleName("round_corner");
    leftLayout.addMember(mapLayout);

    layout.addMember(leftLayout);

    // Add a search panel to the top-right of the map:
    SearchPanel searchPanel = new SearchPanel(map.getMapModel(), mapLayout);
    mapLayout.addChild(searchPanel);
   
    // ---------------------------------------------------------------------
    // Create the right-side (overview map, layer-tree, legend):
    // ---------------------------------------------------------------------
    final SectionStack sectionStack = new SectionStack();
    sectionStack.setBorder("10px solid #777777");
    sectionStack.setStyleName("round_corner");
    sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    sectionStack.setCanReorderSections(true);
    sectionStack.setCanResizeSections(false);
    sectionStack.setSize("250px", "100%");

    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    overviewMap.setTargetMaxExtentRectangleStyle(new ShapeStyle("#888888", 0.3f, "#666666", 0.75f, 2));
    overviewMap.setRectangleStyle(new ShapeStyle("#6699FF", 0.3f, "#6699CC", 1f, 2));
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
    section2.setExpanded(true);
    LayerTree layerTree = new LayerTree(map);
    section2.addItem(layerTree);
    sectionStack.addSection(section2);

    // Legend layout:
    SectionStackSection section3 = new SectionStackSection("Legend");
    section3.setExpanded(true);
    legend = new Legend(map.getMapModel());
    legend.setBackgroundColor("#FFFFFF");
    section3.addItem(legend);
    sectionStack.addSection(section3);

    // Putting the right side layouts together:
View Full Code Here


    layout.setMargin(10);

    // ---------------------------------------------------------------------
    // 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);
    toolbar.setBackgroundColor("#647386");
    toolbar.setBackgroundImage("");
    toolbar.setBorder("0px");

    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        Label title = new Label("Geomajas GWT: hello world");
        title.setStyleName("appTitle");
        title.setWidth(260);
        toolbar.addFill();
        toolbar.addMember(title);
        GetMapImageAction getMapImage = new GetMapImageAction(map);
        toolbar.addSeparator();
        toolbar.addActionButton(getMapImage);
        GetLegendImageAction getLegendImageAll = new GetLegendImageAction(map, true);
        toolbar.addSeparator();
        toolbar.addActionButton(getLegendImageAll);
        GetLegendImageAction getLegendImage = new GetLegendImageAction(map, false);
        toolbar.addSeparator();
        toolbar.addActionButton(getLegendImage);
        // switch all labels on
        for (Layer layer : map.getMapModel().getLayers()) {
          layer.setLabeled(true);
        }
      }
    });
   
    map.getMapModel().addLayerSelectionHandler(new LayerSelectionHandler() {

      public void onSelectLayer(LayerSelectedEvent event) {
        for (Layer layer : map.getMapModel().getLayers()) {
          if (layer.isSelected()) {
            layer.setVisible(true);
          } else {
            layer.setVisible(false);
          }
        }
      }

      public void onDeselectLayer(LayerDeselectedEvent event) {
      }
    });

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
    mapLayout.addMember(map);
    mapLayout.setHeight("65%");

    VLayout leftLayout = new VLayout();
    leftLayout.setBorder("10px solid #777777");
    leftLayout.setStyleName("round_corner");
    leftLayout.addMember(mapLayout);

    layout.addMember(leftLayout);

    // Add a search panel to the top-right of the map:
    SearchPanel searchPanel = new SearchPanel(map.getMapModel(), mapLayout);
    mapLayout.addChild(searchPanel);

    // ---------------------------------------------------------------------
    // Create the right-side (overview map, layer-tree, legend):
    // ---------------------------------------------------------------------
    final SectionStack sectionStack = new SectionStack();
    sectionStack.setBorder("10px solid #777777");
    sectionStack.setStyleName("round_corner");
    sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    sectionStack.setCanReorderSections(true);
    sectionStack.setCanResizeSections(false);
    sectionStack.setSize("250px", "100%");

    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    overviewMap.setTargetMaxExtentRectangleStyle(new ShapeStyle("#888888", 0.3f, "#666666", 0.75f, 2));
    overviewMap.setRectangleStyle(new ShapeStyle("#6699FF", 0.3f, "#6699CC", 1f, 2));
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
    section2.setExpanded(true);
    LayerTree layerTree = new LayerTree(map);
    section2.addItem(layerTree);
    sectionStack.addSection(section2);

    // Legend layout:
    SectionStackSection section3 = new SectionStackSection("Legend");
    section3.setExpanded(true);
    legend = new Legend(map.getMapModel());
    legend.setBackgroundColor("#FFFFFF");
    section3.addItem(legend);
    sectionStack.addSection(section3);

    // Putting the right side layouts together:
View Full Code Here

    layout.setMargin(5);

    // create the map and toolbar

    // @extract-start createGwtWidget, Create GWT widget in toolbar
    MapWidget map = new MapWidget("mapOsm", "app");
    Toolbar toolbar = new Toolbar(map);
    // @extract-skip-start
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);
    // @extract-skip-end
View Full Code Here

  private Canvas getExample1() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapOsm", "widget-utility");
    final RibbonBarLayout ribbonBar = new RibbonBarLayout(mapWidget, "ribbon-bar-1");
    ribbonBar.setSize("100%", "94px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
View Full Code Here

  private Canvas getExample2() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapWmsCountries", "widget-utility");
    final RibbonTabLayout ribbon = new RibbonTabLayout(mapWidget, "ribbon-1");
    ribbon.setSize("100%", "120px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
View Full Code Here

  private Canvas getExample3() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapCountries", "widget-utility");
    final RibbonBarLayout ribbon = new RibbonBarLayout(mapWidget, "ribbon-bar-2");
    ribbon.setSize("100%", "80px");

    layout.addMember(ribbon);
    layout.addMember(mapWidget);
View Full Code Here

  private Canvas getExample4() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapWms", "widget-utility");
    final RibbonBarLayout ribbon = new RibbonBarLayout(mapWidget, "ribbon-bar-3");
    ribbon.setStyleName("myRibbon");
    ribbon.setSize("100%", "94px");

    layout.addMember(ribbon);
View Full Code Here

    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("250px", "100%");

    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
    section2.setExpanded(true);
    LayerTree layerTree = new LayerTree(map);
    section2.addItem(layerTree);
    sectionStack.addSection(section2);

    // Legend layout:
    SectionStackSection section3 = new SectionStackSection("Legend");
    section3.setExpanded(true);
    legend = new Legend(map.getMapModel());
    section3.addItem(legend);
    sectionStack.addSection(section3);

    // Putting the right side layouts together:
    layout.addMember(sectionStack);
View Full Code Here

    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);

    // Build the LayerTree:
    final LayerTree layerTree = new LayerTree(map);
    layerTree.setHeight(180);
View Full Code Here

    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID crsMap is defined in the XML configuration. (mapOsm.xml)
    final MapWidget map = new MapWidget("mapCrs", "gwt-samples");

    // Set a panning controller on the map:
    map.setController(new PanController(map));
    layout.addMember(map);

    return layout;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.widget.MapWidget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.