Package org.geomajas.layer.tile

Examples of org.geomajas.layer.tile.TileCode


   */
  private boolean addTileCode(InternalTile tile, Envelope tileBounds, Geometry geometry) {
    if (log.isDebugEnabled()) {
      log.debug("addTileCode {} {}", tileBounds, geometry);
    }
    TileCode tileCode = tile.getCode();
    int tileX = tileCode.getX();
    int tileY = tileCode.getY();
    for (Coordinate coordinate : geometry.getCoordinates()) {
      if (tileBounds.contains(coordinate)) {
        // We jump through some hoops to (try to) avoid rounding problems.
        // This may result in having the feature in two adjacent tiles, but that should still be better than
        // loosing the feature. Just hope the tolerance is small enough.
View Full Code Here


    Assert.assertFalse(left.equals("bla"));
    Assert.assertFalse(left.equals(null));
  }

  private void set(GetVectorTileRequest obj) {
    obj.setCode(new TileCode(1, 0, 0));
    obj.setCrs("EPSG:900913");
    obj.setFeatureIncludes(GeomajasConstant.FEATURE_INCLUDE_GEOMETRY);
    obj.setFilter("bla");
    obj.setLayerId("beans");
    obj.setPaintGeometries(true);
View Full Code Here

  @Test
  public void testGetVectorTile() throws Exception {
    GetVectorTileRequest request = new GetVectorTileRequest();
    request.setCrs(CRS);
    request.setLayerId(LAYER_ID);
    request.setCode(new TileCode(0, 0, 0));
    request.setPanOrigin(new Coordinate(0, 0));
    request.setRenderer(GetVectorTileRequest.PARAM_SVG_RENDERER);
    request.setScale(1.0);
    GetVectorTileResponse response = (GetVectorTileResponse) dispatcher.execute(
        GetVectorTileRequest.COMMAND, request, null, "en");
View Full Code Here

            - 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);
      }
    }
View Full Code Here

    this.code = code;
    init(maxExtent, scale);
  }

  public InternalTileImpl(int x, int y, int tileLevel, Envelope maxExtent, double scale) {
    this(new TileCode(tileLevel, x, y), maxExtent, scale);
  }
View Full Code Here

  public void addFeature(InternalFeature feature) {
    features.add(feature);
  }

  public void addCode(int level, int x, int y) {
    TileCode c = new TileCode(level, x, y);
    if (!codes.contains(c)) {
      codes.add(c);
    }
  }
View Full Code Here

          int x = xScreenUpperLeft + (i - iMin) * screenWidth;
          int y = yScreenUpperLeft - (j - jMin) * screenHeight;

          RasterTile image = new RasterTile(new Bbox(x, -y, screenWidth, screenHeight),
              tileServiceState.getId() + "." + zoomLevel + "." + i + "," + j);
          image.setCode(new TileCode(zoomLevel, i, j));
          String url = tileServiceState.getUrlSelectionStrategy().next();
          url = url.replace("${level}", Integer.toString(zoomLevel));
          url = url.replace("${x}", Integer.toString(i));
          url = url.replace("${y}", Integer.toString(j));
          image.setUrl(url);
View Full Code Here

  }

  private TileMetadata getTileMetadata() {
    TileMetadata tileMetadata = new TileMetadataImpl();
    tileMetadata.setCrs("EPSG:4326");
    tileMetadata.setCode(new TileCode(0,0,0));
    tileMetadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
    tileMetadata.setLayerId(LAYER_ID);
    tileMetadata.setPaintGeometries(true);
    tileMetadata.setScale(1.0);
    NamedStyleInfo styleInfo = new NamedStyleInfo();
View Full Code Here

  @Test
  public void testRasterizeFromCache() throws Exception {
    InternalTile tile;
    // create metadata
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeans.getId());
    metadata.setPanOrigin(new Coordinate(0, 0));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
View Full Code Here

  @Test
  public void testRasterizeFromRebuildCache() throws Exception {
    InternalTile tile;
    // create metadata
    GetVectorTileRequest metadata = new GetVectorTileRequest();
    metadata.setCode(new TileCode(4, 8, 8));
    metadata.setCrs("EPSG:4326");
    metadata.setLayerId(layerBeansPoint.getId());
    metadata.setPanOrigin(new Coordinate(1, 1));
    metadata.setScale(16);
    metadata.setRenderer(TileMetadata.PARAM_SVG_RENDERER);
View Full Code Here

TOP

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

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.