Package org.geomajas.gwt.client.map.cache.tile

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


   *            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


   *            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

   *
   * @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

    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

    // 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

      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

TOP

Related Classes of org.geomajas.gwt.client.map.cache.tile.VectorTile$ContentHolder

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.