Package org.geomajas.puregwt.client.spatial

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


  @Test
  public void testLayerUnion() {
    mapInfo.setMaxBounds(org.geomajas.geometry.Bbox.ALL);
    mapInfo.getLayers().get(0).setMaxExtent(new org.geomajas.geometry.Bbox(0, 0, 500, 500));
    viewPort.initialize(mapInfo, eventBus);
    Bbox maxBounds = viewPort.getMaximumBounds();
    Assert.assertEquals(maxBounds.getX(), -100.0);
    Assert.assertEquals(maxBounds.getY(), -100.0);
    Assert.assertEquals(maxBounds.getMaxX(), 500.0);
    Assert.assertEquals(maxBounds.getMaxY(), 500.0);
  }
View Full Code Here


  private ZoomStrategy zoomStrategy;

  @PostConstruct
  public void initialize() {
    GeometryFactory factory = new GeometryFactoryImpl();
    Bbox maxBounds = factory.createBbox(mapInfo.getMaxBounds());
    zoomStrategy = new FreeForAllZoomStrategy(mapInfo, maxBounds);
    zoomStrategy.setMapSize(100, 100);
  }
View Full Code Here

    Assert.assertEquals(10, transformed.getY(), DELTA);
  }

  @Test
  public void testTransformBbox() {
    Bbox bbox = factory.createBbox(-10, -10, 20, 20);
    Bbox transformed = viewPort.transform(bbox, RenderSpace.WORLD, RenderSpace.SCREEN);
    Assert.assertEquals((MAP_WIDTH / 2) - (viewPort.getScale() * 10), transformed.getX(), DELTA);
    Assert.assertEquals((MAP_HEIGHT / 2) - (viewPort.getScale() * 10), transformed.getY(), DELTA);
    Assert.assertEquals((MAP_WIDTH / 2) + (viewPort.getScale() * 10), transformed.getMaxX(), DELTA);
    Assert.assertEquals((MAP_HEIGHT / 2) + (viewPort.getScale() * 10), transformed.getMaxY(), DELTA);

    transformed = viewPort.transform(transformed, RenderSpace.SCREEN, RenderSpace.WORLD);
    Assert.assertEquals(-10.0, transformed.getX(), DELTA);
    Assert.assertEquals(-10.0, transformed.getY(), DELTA);
    Assert.assertEquals(10.0, transformed.getMaxX(), DELTA);
    Assert.assertEquals(10.0, transformed.getMaxY(), DELTA);

    // Test identity transformations:
    transformed = viewPort.transform(bbox, RenderSpace.WORLD, RenderSpace.WORLD);
    Assert.assertEquals(-10.0, transformed.getX(), DELTA);
    Assert.assertEquals(-10.0, transformed.getY(), DELTA);
    Assert.assertEquals(10.0, transformed.getMaxX(), DELTA);
    Assert.assertEquals(10.0, transformed.getMaxY(), DELTA);

    transformed = viewPort.transform(bbox, RenderSpace.SCREEN, RenderSpace.SCREEN);
    Assert.assertEquals(-10.0, transformed.getX(), DELTA);
    Assert.assertEquals(-10.0, transformed.getY(), DELTA);
    Assert.assertEquals(10.0, transformed.getMaxX(), DELTA);
    Assert.assertEquals(10.0, transformed.getMaxY(), DELTA);
  }
View Full Code Here

  private ZoomStrategy zoomStrategy;

  @PostConstruct
  public void initialize() {
    GeometryFactory factory = new GeometryFactoryImpl();
    Bbox maxBounds = factory.createBbox(mapInfo.getMaxBounds());
    zoomStrategy = new FixedStepZoomStrategy(mapInfo, maxBounds);
    zoomStrategy.setMapSize(100, 100);
  }
View Full Code Here

  }

  @Test
  public void testFaultyConfiguration() {
    GeometryFactory factory = new GeometryFactoryImpl();
    Bbox maxBounds = factory.createBbox(mapInfo.getMaxBounds());

    // Null value for scale levels:
    mapInfo.getScaleConfiguration().setZoomLevels(null);
    try {
      zoomStrategy = new FixedStepZoomStrategy(mapInfo, maxBounds);
View Full Code Here

TOP

Related Classes of org.geomajas.puregwt.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.