Package org.geomajas.gwt.client.widget

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


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

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

    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    layout.addMember(toolbar);
    layout.addMember(map);

    // wait for the map to be loaded and select the 1st layer
    // the map only has one layer so selecting the 1st one is correct
    // We need to select a layer cause the FeatureInfo works on selected layers only
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        map.getMapModel().selectLayer(map.getMapModel().getLayers().get(0));
      }
    });

    return layout;
  }
View Full Code Here


    HLayout mapLayout = new HLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");

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

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

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(10);

    // Create a button to toggle the navigation addons on and off
    final IButton butTogglePanButton = new IButton(I18nProvider.getSampleMessages().togglePanButtons());
    butTogglePanButton.setWidth100();
    buttonLayout.addMember(butTogglePanButton);

    butTogglePanButton.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.setNavigationAddonEnabled(!map.isNavigationAddonEnabled());
      }
    });

    // Create a button to toggle the scalebar on and off
    final IButton butToggleScaleBar = new IButton(I18nProvider.getSampleMessages().toggleScaleBar());
    butToggleScaleBar.setWidth100();
    buttonLayout.addMember(butToggleScaleBar);

    butToggleScaleBar.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.setScalebarEnabled(!map.isScaleBarEnabled());
      }
    });

    layout.addMember(mapLayout);
    layout.addMember(buttonLayout);
View Full Code Here

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

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

    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    layout.addMember(toolbar);
View Full Code Here

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

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

    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    layout.addMember(toolbar);
View Full Code Here

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

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

    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    layout.addMember(toolbar);
    layout.addMember(map);

    // wait for the map to be loaded and select the 1st layer
    // the map only has one layer so selecting the 1st one is correct
    // We need to select a layer cause the SelectionMode works on selected layers only
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        map.getMapModel().selectLayer(map.getMapModel().getLayer("clientLayerCountries110mGT"));
      }
    });

    return layout;
  }
View Full Code Here

    layout.setMargin(5);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    MapWidget map = new MapWidget("printingMap", "app");
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    VLayout mapLayout = new VLayout();
    mapLayout.addMember(toolbar);
View Full Code Here

    layout.setMargin(5);

    // ---------------------------------------------------------------------
    // Create the left-side (map and tabs):
    // ---------------------------------------------------------------------
    mapWidget = new MapWidget("mapMain", "app");
    final Toolbar toolbar = new Toolbar(mapWidget);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    VLayout mapLayout = new VLayout();
    mapLayout.setShowResizeBar(true);
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);

    // ---------------------------------------------------------------------
    // Bottom left: Add tabs here:
    // ---------------------------------------------------------------------
    FeatureListGridPage page1 = new FeatureListGridPage(map);
    addTab(new SearchPage(map, tabSet, page1.getTable()));
    addTab(page1);

    // ---------------------------------------------------------------------
    // 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();
   
    map.getMapModel().addMapModelHandler(new MapModelHandler() {
     
      public void onMapModelChange(MapModelEvent event) {
        VectorLayer layer = map.getMapModel().getVectorLayer("clientLayerCountries");
        layer.setFilter("NAME like '%e%'");
      }
    });
    // Then initialize:
    initialize();
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("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'");
      }
    });
  }
View Full Code Here

  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");

    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(Toolbar.BUTTON_SIZE_BIG);

    // add a button in GWT code
    toolbar.addModalButton(new ZoomToRectangleModalAction(map));

    layout.addMember(toolbar);
    layout.addMember(map);

    // wait for the map to be loaded and select the 1st layer
    // the map only has one layer so selecting the 1st one is correct
    // We need to select a layer cause the FeatureInfo works on selected layers only
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        map.getMapModel().selectLayer(map.getMapModel().getLayers().get(0));
      }
    });

    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.