Package org.geomajas.gwt.client.widget

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


    layout.setMembersMargin(10);
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID beansMap is defined in the XML configuration. (contains any type of attribute)
    final MapWidget map = new MapWidget("mapBeansCustomForm", "gwt-samples");
    map.setVisible(false);
    layout.addMember(map);
    map.init();

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

      public void onMapModelChange(MapModelEvent event) {
        VectorLayer layer = (VectorLayer) map.getMapModel().getLayer("beansLayerCustomForm");
        FeatureAttributeEditor editor = new FeatureAttributeEditor(layer, false, myFactory);
        layout.addMember(editor);
      }
    });
View Full Code Here


    VLayout mapLayout = new VLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setShowResizeBar(true);

    // Map with ID editLineLayerMap is defined in the XML configuration.
    final MapWidget map = new MapWidget("mapEditMultiLine", "gwt-samples");
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      // When the map is initialized: select the cities layer - so that new features are created in this layer:
      public void onMapModelChange(MapModelEvent event) {
        map.getMapModel().selectLayer(map.getMapModel().getLayer("editableRoadtrl020LayerML"));
        map.registerMapAddon(new GoogleAddon("google", map, GoogleAddon.MapType.SATELLITE, false));
      }
    });

    // Create a tool-bar for this map:
    final Toolbar toolbar = new Toolbar(map);
View Full Code Here

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

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

    // Create the custom controller:
    final GraphicsController customController = new AbstractGraphicsController(map) {

      public void onMouseOver(MouseOverEvent event) {
        // When the mouse hovers over the image, make it transparent:
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle,
            hoverStyle);
      }

      public void onMouseOut(MouseOutEvent event) {
        // When the mouse moves away from the image, make it visible again:
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle, style);
      }

      public void onMouseDown(MouseDownEvent event) {
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle,
            new ShapeStyle("#AA0000", 0.8f, "#990000", 1.0f, 3));
      }

      public void onMouseUp(MouseUpEvent event) {
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle,
            hoverStyle);
      }
    };

    // After map initialization we draw an image on the map:
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        GraphicsContext graphics = map.getVectorContext();
        graphics.drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle, style);
        map.getVectorContext().setController(map.getGroup(RenderGroup.SCREEN), "rectangle", customController);
      }
    });

    layout.addMember(map);
    return layout;
View Full Code Here

    // Create map with OSM layer, and add a PanController to it:
    VLayout mapLayout = new VLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");

    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");
    map.setController(new PanController(map));
    mapLayout.addMember(map);

    VLayout opacityLayout = new VLayout();
    Slider slider = new Slider("Opacity");
    slider.setWidth(300);
    slider.setVertical(false);
    slider.setMinValue(0);
    slider.setMaxValue(100);
    slider.setNumValues(101);
    slider.setValue(100);
    slider.addValueChangedHandler(new ValueChangedHandler() {

      public void onValueChanged(ValueChangedEvent event) {
        int intValue = event.getValue();
        double value = 0;
        if (intValue != 0) {
          value = (double) intValue / (double) 100;
        }

        RasterLayer layer = (RasterLayer) map.getMapModel().getLayer("clientLayerOsm");
        if (layer != null) {
          layer.setOpacity(value);
        }
      }
    });
View Full Code Here

    layout.setMembersMargin(10);
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID beansMap is defined in the XML configuration. (contains any type of attribute)
    final MapWidget map = new MapWidget("mapBeans", "gwt-samples");
    map.setVisible(false);
    layout.addMember(map);
    map.init();

    // Create a layout with a FeatureListGrid in it:
    final FeatureListGrid grid = new FeatureListGrid(map.getMapModel());
    grid.setShowEdges(true);

    // Create a search widget that displays it's results in the FeatureListGrid:
    final FeatureSearch search = new FeatureSearch(map.getMapModel(), true);
    search.addSearchHandler(new DefaultSearchHandler(grid) {

      public void afterSearch() {
      }
    });
View Full Code Here

    VLayout mapLayout = new VLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setShowResizeBar(true);

    // Map with ID editMultiPointLayerMap is defined in the XML configuration.
    final MapWidget map = new MapWidget("mapEditMultiPoint", "gwt-samples");
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      // When the map is initialized: select the cities layer - so that new features are created in this layer:
      public void onMapModelChange(MapModelEvent event) {
        map.getMapModel().selectLayer(map.getMapModel().getLayer("clientLayerEditableMultiCities"));
      }
    });

    // Create a toolbar for this map:
    final Toolbar toolbar = new Toolbar(map);
View Full Code Here

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

    // Create the map, using the wmsMap configuration (mapOsm.xml):
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");

    VLayout mapLayout = new VLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("50%");
    mapLayout.addMember(map);
    layout.addMember(mapLayout);

    final PortalLayout portalLayout = new PortalLayout(3);
    portalLayout.setWidth100();
    portalLayout.setHeight("50%");
    portalLayout.setShowColumnMenus(false);

    HLayout buttonLayout = new HLayout(10);
    buttonLayout.setAlign(Alignment.CENTER);
    buttonLayout.setHeight(30);
    buttonLayout.setWidth100();
    Button add = new Button(I18nProvider.getSampleMessages().multipleListenersBtn());
    add.setLayoutAlign(VerticalAlignment.CENTER);
    add.setAutoFit(true);
    add.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        final Portlet portlet = new Portlet();
        portlet.setTitle(I18nProvider.getSampleMessages().multipleListenersPortletTitle());

        final Label label = new Label();
        label.setHeight(30);
        label.setContents(I18nProvider.getSampleMessages().multipleListenersPortletText() + " = ?");
        portlet.setHeight(70);
        portlet.addItem(label);
        portalLayout.addPortlet(portlet, (column++) % 3, 0);

        final Listener listener = new AbstractListener() {

          public void onMouseMove(ListenerEvent event) {
            label.setContents(I18nProvider.getSampleMessages().multipleListenersPortletText() + " = "
                + event.getScreenPosition());
          }
        };
        map.addListener(listener);
        portlet.addCloseClickHandler(new CloseClickHandler() {

          public void onCloseClick(CloseClientEvent event) {
            map.removeListener(listener);
            if (map.getListeners() != null) {
              SC.say(I18nProvider.getSampleMessages().multipleListenersCount(map.getListeners().size()));
            }
            portlet.destroy();
          }
        });
        SC.say(I18nProvider.getSampleMessages().multipleListenersCount(map.getListeners().size()));
      }
    });
    buttonLayout.addMember(add);
    layout.addMember(buttonLayout);
    layout.addMember(portalLayout);
View Full Code Here

    // Create a layout for the main map:
    HLayout mapLayout = new HLayout();
    mapLayout.setShowEdges(true);

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

    // Create a layout for the overview map:
    HLayout bottomLayout = new HLayout();
    bottomLayout.setHeight(300);
View Full Code Here

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

    // Map with ID duisburgMap is defined in the XML configuration. (mapDuisburg.xml)
    map = new MapWidget("mapBeans", "gwt-samples");
    map.setVisible(false);
    layout.addMember(map);
    map.init();

    // Create login handler that re-initializes the map on a successful login:
    final BooleanCallback initMapCallback = new BooleanCallback() {

      public void execute(Boolean value) {
        if (value) {
          map.destroy();
          map = new MapWidget("mapBeans", "gwt-samples");
          map.setVisible(false);
          layout.addMember(map);
          map.init();
        }
      }
View Full Code Here

    // Map with ID duisburgMap is defined in the XML configuration. (mapDuisburg.xml)
    final VLayout mapLayout = new VLayout();
    mapLayout.setShowEdges(true);
    mapLayout.setHeight("60%");
    map = new MapWidget("mapVectorSecurity", "gwt-samples");
    map.setController(new PanController(map));
    mapLayout.addMember(map);

    // Create horizontal layout for login buttons:
    HLayout buttonLayout = new HLayout();
    buttonLayout.setMembersMargin(10);

    // Create login handler that re-initializes the map on a successful login:
    final BooleanCallback initMapCallback = new BooleanCallback() {

      public void execute(Boolean value) {
        if (value) {
          map.destroy();
          map = new MapWidget("mapVectorSecurity", "gwt-samples");
          mapLayout.addMember(map);
          map.setController(new PanController(map));
        }
      }
    };
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.