Package org.geomajas.gwt.client.widget

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


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

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

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

    // Create a custom controller that will be enabled/disabled by a button in the toolbar:
    final GraphicsController customController = new AbstractGraphicsController(map) {

      public void onMouseUp(MouseUpEvent event) {
        Coordinate screenPosition = getScreenPosition(event);
        Coordinate worldPosition = getWorldPosition(event);
        SC.say(I18nProvider.getSampleMessages().customControllerScreenCoordinates() + " = " + screenPosition
            + "<br/>" + I18nProvider.getSampleMessages().customControllerWorldCoordinates() + " = "
            + worldPosition);
      }
    };

    // Add the customController to the toolbar using a custom ToolbarModalAction button
    toolbar.addModalButton(new ToolbarModalAction("[ISOMORPHIC]/geomajas/widget/target.gif", I18nProvider
        .getSampleMessages().customToolbarToolsTooltip()) {

      @Override
      public void onSelect(ClickEvent event) {
        map.setController(customController);
      }

      @Override
      public void onDeselect(ClickEvent event) {
        map.setController(null);
      }
    });

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


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

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

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

    final Toolbar toolbar = new Toolbar(map);
    // add a button in GWT code
    layout.addMember(toolbar);
    layout.addMember(map);

    // wait for the map to be loaded cause we need a correct map.getPixelPerUnit
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        ScaleSelect scaleSelect = new ScaleSelect(map.getMapModel().getMapView(), map.getPixelPerUnit());
        Double[] customScales = new Double[] { 1.0 / 100000000.0, 1.0 / 50000000.0, 1.0 / 2500000.0 };
        scaleSelect.setScales(customScales);
        toolbar.addChild(scaleSelect);
      }
    });
View Full Code Here

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

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

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

    final Toolbar toolbar = new Toolbar(map);
    // add a button in GWT code
    layout.addMember(toolbar);
    layout.addMember(map);

    // wait for the map to be loaded cause we need a correct map.getPixelPerUnit
    map.getMapModel().addMapModelHandler(new MapModelHandler() {

      public void onMapModelChange(MapModelEvent event) {
        ScaleSelect scaleSelect = new ScaleSelect(map.getMapModel().getMapView(), map.getPixelPerUnit());
        toolbar.addMember(scaleSelect);
      }
    });

    return layout;
View Full Code Here

TOP

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

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.