Package org.geomajas.layer.tile

Examples of org.geomajas.layer.tile.RasterTile


  @Test
  public void testNormal() throws Exception {
    List<RasterTile> tiles = google.paint(google.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here


    Assert.assertEquals(4, tiles.size());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8196&y=8188&z=14", tiles.get(0).getUrl());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8196&y=8189&z=14", tiles.get(1).getUrl());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8197&y=8188&z=14", tiles.get(2).getUrl());
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8197&y=8189&z=14", tiles.get(3).getUrl());
    RasterTile tile = tiles.get(3);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8197&y=8189&z=14", tile.getUrl());
    Assert.assertEquals(14, tile.getCode().getTileLevel());
    Assert.assertEquals(8197, tile.getCode().getX());
    Assert.assertEquals(8189, tile.getCode().getY());
    Assert.assertEquals(1223, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-733.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(245.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(245.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

  @Test
  public void testSatellite() throws Exception {
    List<RasterTile> tiles = satellite.paint(geoService.getCrs("EPSG:900913"),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://khm0.google.com/kh?v=87&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

        Bbox screenBox = new Bbox(Math.round(scale * worldBox.getX()), -Math.round(scale * worldBox.getMaxY()),
            Math.round(scale * worldBox.getMaxX()) - Math.round(scale * worldBox.getX()), Math.round(scale
            * worldBox.getMaxY())
            - Math.round(scale * worldBox.getY()));

        RasterTile image = new RasterTile(screenBox, getId() + "." + bestResolution.getLevel() + "." + i
            + "," + j);

        image.setCode(new TileCode(bestResolution.getLevel(), i, j));
        String url = formatUrl(bestResolution.getTileWidthPx(), bestResolution.getTileHeightPx(), layerBox);
        image.setUrl(url);
        result.add(image);
      }
    }

    return result;
View Full Code Here

  @Test
  public void testTerrain() throws Exception {
    List<RasterTile> tiles = physical.paint(geoService.getCrs("EPSG:900913"),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?lyrs=t@127,r@156000000&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

  @Test
  public void testNormalDs() throws Exception {
    List<RasterTile> tiles = googleDs.paint(googleDs.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?v=w2.95&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

  @Test
  public void testSatelliteDs() throws Exception {
    List<RasterTile> tiles = satelliteDs.paint(satelliteDs.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://khm0.google.com/kh?v=87&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

  @Test
  public void testTerrainDs() throws Exception {
    List<RasterTile> tiles = physicalDs.paint(physicalDs.getCrs(),
        new Envelope(10000, 10010, 4000, 4010), ZOOMED_IN_SCALE);
    Assert.assertEquals(1, tiles.size());
    RasterTile tile = tiles.get(0);
    Assert.assertEquals("http://mt0.google.com/vt?lyrs=t@127,r@156000000&x=8&y=7&z=4", tile.getUrl());
    Assert.assertEquals(4, tile.getCode().getTileLevel());
    Assert.assertEquals(8, tile.getCode().getX());
    Assert.assertEquals(7, tile.getCode().getY());
    Assert.assertEquals(0.0, tile.getBounds().getX(), DELTA);
    Assert.assertEquals(-250.0, tile.getBounds().getY(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getHeight(), DELTA);
    Assert.assertEquals(250.0, tile.getBounds().getWidth(), DELTA);
  }
View Full Code Here

  }

  @Test
  public void testMaxLevel() throws Exception {
    Envelope envelope = new Envelope(10000, 10002, 5000, 5002);
    RasterTile tile;
    List<RasterTile> tiles;
    tiles = osm.paint(osm.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://a.tile.openstreetmap.org/14/8196/8189.png", tile.getUrl());
    tiles = osmMaxLevel.paint(osmMaxLevel.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://a.tile.openstreetmap.org/12/2049/2047.png", tile.getUrl());
  }
View Full Code Here

  }

  @Test
  public void testConfigUrlStrategy() throws Exception {
    Envelope envelope = new Envelope(10000, 10002, 5000, 5002);
    RasterTile tile;
    List<RasterTile> tiles;
    tiles = osmCycleMap.paint(osmCycleMap.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://c.tile.opencyclemap.org/14/8196/8189.png", tile.getUrl());
    tiles = osmCycleMap.paint(osmCycleMap.getCrs(), envelope, MAX_LEVEL_SCALE);
    Assert.assertEquals(1, tiles.size());
    tile = tiles.get(0);
    Assert.assertEquals("http://c.tile.opencyclemap.org/14/8196/8189.png", tile.getUrl());
  }
View Full Code Here

TOP

Related Classes of org.geomajas.layer.tile.RasterTile

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.