Examples of VectorTile


Examples of org.geomajas.gwt.client.map.cache.tile.VectorTile

   *            The group where the object resides in (optional).
   * @param context
   *            A MapContext object, responsible for actual drawing.
   */
  public void paint(Paintable paintable, Object group, MapContext context) {
    VectorTile tile = (VectorTile) paintable;
    boolean labeled = tile.getCache().getLayer().isLabelsShowing();
    switch (tile.getContentType()) {
      case STRING_CONTENT:
        // Paint the feature content:
        if (tile.getFeatureContent().isLoaded()) {
          drawData(tile.getCache().getLayer().getFeatureGroup(), tile, tile.getFeatureContent(), context);
        }
        // Paint the label content:
        if (tile.getLabelContent().isLoaded()) {
          drawData(tile.getCache().getLayer().getLabelGroup(), tile, tile.getLabelContent(), context);
        }
        break;
      case URL_CONTENT:
        // paint the label url (includes features)
        if (labeled && tile.getLabelContent().isLoaded()) {
          drawImage(tile, tile.getLabelContent(), context);
          // or Paint the feature url
        } else if (tile.getFeatureContent().isLoaded()) {
          drawImage(tile, tile.getFeatureContent(), context);
        }
        break;
    }

  }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.VectorTile

   *            The group where the object resides in (optional).
   * @param context
   *            The context to paint on.
   */
  public void deleteShape(Paintable paintable, Object group, MapContext context) {
    VectorTile tile = (VectorTile) paintable;
    context.getVectorContext().deleteGroup(tile.getFeatureContent());
    context.getVectorContext().deleteGroup(tile.getLabelContent());
    context.getRasterContext().deleteElement(tile.getCache().getLayer(), tile.getCode().toString());
  }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.VectorTile

   *
   * @param tileCode
   *            A {@link TileCode} instance.
   */
  public VectorTile addTile(TileCode tileCode) {
    VectorTile tile = tiles.get(tileCode.toString());
    if (tile == null) {
      tile = new VectorTile(tileCode, calcBoundsForTileCode(tileCode), this);
      tiles.put(tileCode.toString(), tile);
    }
    return tile;
  }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.VectorTile

    return tile;
  }

  public void getFeaturesByCode(TileCode code, int featureIncludes, LazyLoadCallback callback) {
    if (code != null) {
      VectorTile tile = tiles.get(code.toString());
      if (tile != null) {
        tile.getFeatures(featureIncludes, callback);
      }
    }
  }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.VectorTile

    // Create the full list of tile on which to operate:
    List<TileCode> tileCodes = calcCodesForBounds(bbox);
    for (TileCode tileCode : tileCodes) {
      if (tiles.containsKey(tileCode.toString())) {
        VectorTile tile = tiles.get(tileCode.toString());
        if (!setTiles.contains(tile)) {
          setTiles.add(tile);
        }
        // Also process tiles of features that partly lie in this tile but were assigned to another tile.
        List<TileCode> codesExtraFeatures = tile.getCodes();
        for (TileCode extraCode : codesExtraFeatures) {
          VectorTile extraTile = tiles.get(extraCode.toString());
          if (!setTiles.contains(extraTile)) {
            setTiles.add(extraTile);
          }
        }
      }
View Full Code Here

Examples of org.geomajas.gwt.client.map.cache.tile.VectorTile

      List<TileCode> tileCodes = calcCodesForBounds(bbox);

      // Make a clone, as we are going to modify the actual node map:
      Map<String, VectorTile> currentNodes = new HashMap<String, VectorTile>(tiles);
      for (TileCode tileCode : tileCodes) {
        VectorTile tile = currentNodes.get(tileCode.toString());
        if (null == tile) {
          tile = addTile(tileCode); // Add the node
        }
        tile.apply(filter, onUpdate);
        tile.applyConnected(filter, onUpdate);
      }
    }
  }
View Full Code Here

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

Examples of org.geomajas.layer.tile.VectorTile

        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

Examples of org.geomajas.layer.tile.VectorTile

   *            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

Examples of org.geomajas.layer.tile.VectorTile

    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
Copyright © 2018 www.massapi.com. 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.