Package org.geomajas.gwt.client.spatial

Examples of org.geomajas.gwt.client.spatial.Bbox


    Marker marker = (Marker) paintable;
    context.getVectorContext().drawImage(
        group,
        marker.getId(),
        marker.getImageSrc(),
        new Bbox(marker.getLocation().getX(), marker.getLocation().getY(), marker.getWidth(), marker
            .getHeight()), marker.getStyle());
  }
View Full Code Here


    return getClass().getName();
  }

  public void paint(Paintable paintable, Object group, MapContext context) {
    context.getVectorContext().drawImage(group, getId(), imageSrc,
        new Bbox(transformed.getX(), transformed.getY(), width, height), style);
  }
View Full Code Here

    IButton bboxBTN = new IButton(I18nProvider.getSampleMessages().navigationBtnBbox());
    bboxBTN.setWidth100();
    bboxBTN.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getMapModel().getMapView().applyBounds(new Bbox(1200000, 4600000, 1400000, 1400000),
            ZoomOption.EXACT);
      }
    });

    // Create a button that zooms out:
View Full Code Here

    button5.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        ShapeStyle style = new ShapeStyle("#337788", 0.5f, "#337766", 1, 2);
        map.getVectorContext().drawRectangle(group2, "rectangle", new Bbox(50, 200, 200, 50), style);
      }
    });
    button5.setWidth100();
    column2.addMember(button5);

    // Button6: Draw Image
    IButton button6 = new IButton(I18nProvider.getSampleMessages().renderingDrawImage());
    button6.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        Image image = new Image("image");
        image.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
        image.setBounds(new Bbox(250, 70, 48, 48));
        image.setStyle(new PictureStyle(0.5));
        // map.render(image, "all");
        map.getVectorContext().drawImage(group1, image.getId(), image.getHref(), image.getBounds(),
            (PictureStyle) image.getStyle());
      }
View Full Code Here

      return new MaxBoundsToggleSample();
    }
  };

  public Canvas getViewPanel() {
    final Bbox belgiumBounds = new Bbox(135977.5229612165, 6242678.930647222, 679887.6148060877, 625824.2623034349);

    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();
    layout.setMembersMargin(10);
View Full Code Here

    IButton button1 = new IButton(I18nProvider.getSampleMessages().screenWorldBTNScreen());
    button1.setWidth("50%");

    final Image screenImage = new Image("imageInScreenSpace");
    screenImage.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
    screenImage.setBounds(new Bbox(60, 60, 48, 48)); // Pixel coordinates
    screenImage.setStyle(new PictureStyle(0.6));

    button1.addClickHandler(new ClickHandler() {

      // Draw an image in screen space:
      public void onClick(ClickEvent event) {
        map.render(screenImage, RenderGroup.SCREEN, RenderStatus.ALL);
      }
    });
    buttonLayout.addMember(button1);

    IButton button2 = new IButton(I18nProvider.getSampleMessages().screenWorldBTNWorld());
    button2.setWidth("50%");

    // An image
    final Image worldImage = new Image("imageInWorldSpace");
    worldImage.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
    worldImage.setBounds(new Bbox(-2000000, -2000000, 4000000, 4000000)); // Mercator coordinates
    worldImage.setStyle(new PictureStyle(0.8));

    // And some geometries
    final GfxGeometry worldGeometry = new GfxGeometry("MultiPolygonInWorldSpace");
    final GeometryFactory gf = new GeometryFactory(map.getMapModel().getSrid(), map.getMapModel().getPrecision());
    Polygon p1 = gf.createPolygon(gf.createLinearRing(new Bbox(10000000d, 1000d, 1000000d, 1000000d)), null);
    Polygon p2 = gf.createPolygon(gf.createLinearRing(new Bbox(12000000d, 1000d, 500000d, 500000d)), null);
    MultiPolygon mp = gf.createMultiPolygon(new Polygon[] {p1, p2});
    worldGeometry.setStyle(new ShapeStyle("#FF0000", 0.5f, "#FF0000", 1.0f, 2));
    worldGeometry.setGeometry(mp);

    final GfxGeometry worldGeometry2 = new GfxGeometry("MultiPointInWorldSpace");
View Full Code Here

  };

  public Canvas getViewPanel() {

    // Drawing information:
    final Bbox rectangle = new Bbox(100, 100, 300, 100);
    final ShapeStyle style = new ShapeStyle("#66AA00", 0.7f, "#667700", 0.8f, 3);
    final ShapeStyle hoverStyle = new ShapeStyle("#66AA00", 0.5f, "#667700", 0.7f, 3);

    VLayout layout = new VLayout();
    layout.setWidth100();
View Full Code Here

  }

  public void onMapViewChanged(MapViewChangedEvent event) {
    // assume google coordinates here
    if (googleMap != null) {
      Bbox latLon = convertToLatLon(event.getBounds());
      fitGoogleMapBounds(googleMap, latLon.getX(), latLon.getY(), latLon.getMaxX(), latLon.getMaxY());
    }
  }
View Full Code Here

  private Bbox convertToLatLon(Bbox bounds) {
    // convert corners
    Coordinate orig = convertToLatLon(bounds.getOrigin());
    Coordinate end = convertToLatLon(bounds.getEndPoint());
    return new Bbox(orig.getX(), orig.getY(), end.getX() - orig.getX(), end.getY() - orig.getY());
  }
View Full Code Here

      }
    }
  }

  private void onZoomClick() {
    Bbox bounds = null;
    for (VectorLayer layer : mapWidget.getMapModel().getVectorLayers()) {
      if (layer.isShowing()) {
        VectorLayerStore store = layer.getFeatureStore();
        for (String featureId : layer.getSelectedFeatures()) {
          Feature f = store.getPartialFeature(featureId);
          if (bounds == null) {
            bounds = f.getGeometry().getBounds();
          } else {
            bounds = bounds.union(f.getGeometry().getBounds());
          }
        }
      }
    }
    if (bounds == null) {
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.spatial.Bbox

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.