Package org.geomajas.layer.tile

Examples of org.geomajas.layer.tile.VectorTile


  @Test
  public void testToDto() throws GeomajasException {
    InternalTileImpl internalTile = new InternalTileImpl(0, 0, 0, new Envelope(0, 0, 10, 10), 0);
    internalTile.setContentType(VectorTileContentType.STRING_CONTENT);
    VectorTile tile = converterService.toDto(internalTile);
    Assert.assertNotNull(tile);
  }
View Full Code Here


        GetVectorTileRequest.COMMAND, request, null, "en");
    if (response.isError()) {
      response.getErrors().get(0).printStackTrace();
    }
    Assert.assertFalse(response.isError());
    VectorTile tile = response.getTile();
    Assert.assertNotNull(tile);
    Assert.assertNotNull(tile.getFeatureContent());
    Assert.assertEquals(
        "<g id=\"countries.features.0-0-0\">" +
            "<g style=\"fill:#995500;fill-opacity:0.6;stroke:#995500;stroke-opacity:0.3;stroke-width:1px;\" " +
            "id=\"countries.features.0-0-0.0\">" +
            "<path fill-rule=\"evenodd\" d=\"M0 1l1 0 0 -1 -1 0 0 1 Z\" id=\"4\">" +
            "</path><path fill-rule=\"evenodd\" d=\"M-1 0l1 0 0 -1 -1 0 0 1 Z\" id=\"3\">" +
            "</path><path fill-rule=\"evenodd\" d=\"M-1 1l1 0 0 -1 -1 0 0 1 Z\" id=\"2\">" +
            "</path><path fill-rule=\"evenodd\" d=\"M0 0l1 0 0 -1 -1 0 0 1 Z\" id=\"1\"/></g></g>",
        tile.getFeatureContent());
    Assert.assertEquals(171, tile.getScreenHeight());
    Assert.assertEquals(171, tile.getScreenWidth());
  }
View Full Code Here

   *            The server-side representation of a tile.
   * @return Returns the DTO version that can be sent to the client.
   */
  public VectorTile toDto(InternalTile tile) throws GeomajasException {
    if (null != tile) {
      VectorTile dto = new VectorTile();
      dto.setClipped(tile.isClipped());
      dto.setCode(tile.getCode());
      dto.setCodes(tile.getCodes());
      dto.setScreenHeight(tile.getScreenHeight());
      dto.setScreenWidth(tile.getScreenWidth());
      dto.setFeatureContent(tile.getFeatureContent());
      dto.setLabelContent(tile.getLabelContent());
      dto.setContentType(tile.getContentType());
      return dto;
    }

    return null;
  }
View Full Code Here

    deferred = service.execute(command, new CommandCallback() {

      public void onSuccess(CommandResponse response) {
        if (!(deferred != null && deferred.isCancelled()) && response instanceof GetVectorTileResponse) {
          GetVectorTileResponse tileResponse = (GetVectorTileResponse) response;
          VectorTile tile = tileResponse.getTile();
          for (TileCode relatedTile : tile.getCodes()) {
            siblings.add(relatedTile);
          }
          if (tile.getContentType() == VectorTileContentType.STRING_CONTENT) {
            display = new VectorTileObject();
            display.setContent(tile.getFeatureContent());
            renderer.getVectorContainer().add((VectorTileObject) display);
          } else {
            Coordinate position = getTilePosition(tile);
            display = new RasterTileObject(tile.getFeatureContent(), tile.getScreenWidth(), tile
                .getScreenHeight(), (int) position.getY(), (int) position.getX());
            display.setContent(tile.getFeatureContent());
            renderer.getHtmlContainer().add((RasterTileObject) display);
          }
          if (renderSiblings) {
            renderSiblings();
          }
View Full Code Here

TOP

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

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.