Examples of VectorLayer


Examples of org.geomajas.gwt.client.map.layer.VectorLayer

    legend.setFont(style);
    legend.setMapId(mapModel.getMapInfo().getId());
    legend.setTag("legend");
    for (Layer layer : mapModel.getLayers()) {
      if (layer instanceof VectorLayer && layer.isShowing()) {
        VectorLayer vectorLayer = (VectorLayer) layer;
        ClientVectorLayerInfo layerInfo = vectorLayer.getLayerInfo();
        String label = layerInfo.getLabel();
        List<FeatureStyleInfo> defs = layerInfo.getNamedStyleInfo().getFeatureStyles();
        for (FeatureStyleInfo styleDefinition : defs) {
          String text;
          if (defs.size() > 1) {
View Full Code Here

Examples of org.geomajas.gwt.client.map.layer.VectorLayer

      super(tree, layer);
    }

    public void init() {
      if (layer instanceof VectorLayer) {
        VectorLayer vl = (VectorLayer) layer;
        NamedStyleInfo nsi = vl.getLayerInfo().getNamedStyleInfo();
        for (FeatureStyleInfo fsi : nsi.getFeatureStyles()) {
          LayerTreeLegendItemNode tn = new LayerTreeLegendItemNode(this, vl.getServerLayerId(),
              nsi.getName(), fsi);
          tree.add(tn, this);
        }
      } else {
        RasterLayer rl = (RasterLayer) layer;
View Full Code Here

Examples of org.geomajas.gwt.client.map.layer.VectorLayer

  }

  private Canvas createLayerInfo(Layer<?> layer) {
    String layerType, layerMax, layerMin;
    if (layer instanceof VectorLayer) {
      VectorLayer vl = (VectorLayer) layer;
      layerType = messages.layerInfoLayerInfoFldLayerTypeVector();
      layerType += " (" + vl.getLayerInfo().getLayerType().name() + ")";
      layerMax = buildScale(vl.getLayerInfo().getMaximumScale());
      layerMin = buildScale(vl.getLayerInfo().getMinimumScale());

    } else {
      RasterLayer rl = (RasterLayer) layer;
      layerType = messages.layerInfoLayerInfoFldLayerTypeRaster();
      layerMax = buildScale(rl.getLayerInfo().getMaximumScale());
View Full Code Here

Examples of org.geomajas.gwt.client.map.layer.VectorLayer

    loadScreen.draw();
   
    map.getMapModel().addMapModelHandler(new MapModelHandler() {
     
      public void onMapModelChange(MapModelEvent event) {
        VectorLayer layer = map.getMapModel().getVectorLayer("clientLayerCountries");
        layer.setFilter("NAME like '%e%'");
      }
    });
    // Then initialize:
    initialize();
  }
View Full Code Here

Examples of org.geomajas.layer.VectorLayer

  private Map<VectorLayer, Filter> dtoAttributeCriterionToFilters(AttributeCriterion criterion)
      throws GeomajasException {
    Map<VectorLayer, Filter> filters = new LinkedHashMap<VectorLayer, Filter>();
    Filter f;
    VectorLayer l = configurationService.getVectorLayer(criterion.getServerLayerId());
    if (l == null) {
      throw new GeomajasException(ExceptionCode.LAYER_NOT_FOUND, criterion.getServerLayerId());
    }

    String operator = criterion.getOperator();
View Full Code Here

Examples of org.geomajas.layer.VectorLayer

    Map<VectorLayer, Filter> filters = new LinkedHashMap<VectorLayer, Filter>();
    Filter f;
    Geometry mapGeom = converter.toInternal(criterion.getGeometry());

    for (String serverLayerId : criterion.getServerLayerIds()) {
      VectorLayer vl = configurationService.getVectorLayer(serverLayerId);
      if (vl == null) {
        throw new GeomajasException(ExceptionCode.LAYER_NOT_FOUND, serverLayerId);
      }

      // Transform geometry to layer CRS:
      Geometry layerGeometry = geoService.transform(mapGeom, mapCrs, vectorLayerService.getCrs(vl));

      switch (criterion.getOperator()) {
        case SearchByLocationRequest.QUERY_INTERSECTS:
          f = filterService.createIntersectsFilter(layerGeometry, vl.getFeatureModel()
              .getGeometryAttributeName());
          break;
        case SearchByLocationRequest.QUERY_CONTAINS:
          f = filterService.createContainsFilter(layerGeometry, vl.getFeatureModel()
              .getGeometryAttributeName());
          break;

        case SearchByLocationRequest.QUERY_TOUCHES:
          f = filterService.createTouchesFilter(layerGeometry, vl.getFeatureModel()
              .getGeometryAttributeName());
          break;

        case SearchByLocationRequest.QUERY_WITHIN:
          f = filterService
              .createWithinFilter(layerGeometry, vl.getFeatureModel().getGeometryAttributeName());
          break;

        default:
          throw new GeomajasException(ExceptionCode.ATTRIBUTE_UNKNOWN, "QueryType");
      }
View Full Code Here

Examples of org.geomajas.layer.VectorLayer

    }
    ClientVectorLayerInfo vectorInfo = (ClientVectorLayerInfo) clientLayerInfo;
    VectorLayerRasterizingInfo extraInfo = (VectorLayerRasterizingInfo) vectorInfo
        .getWidgetInfo(VectorLayerRasterizingInfo.WIDGET_KEY);
    ReferencedEnvelope areaOfInterest = mapContext.getAreaOfInterest();
    VectorLayer layer = configurationService.getVectorLayer(vectorInfo.getServerLayerId());
    // need to clone the extra info object before changing it !
    VectorLayerRasterizingInfo copy = cloneInfo(extraInfo);
    // we now replace the style filters by simple filters on an artificial extra style attribute
    for (FeatureStyleInfo style : copy.getStyle().getFeatureStyles()) {
      style.setFormula(STYLE_INDEX_ATTRIBUTE_NAME + " = " + style.getIndex());
    }
    // create the style
    Style style = styleFactoryService.createStyle(layer, copy);
    // estimate the buffer
    MetaBufferEstimator estimator = new MetaBufferEstimator();
    estimator.visit(style);
    int bufferInPixels = estimator.getBuffer();
    // expand area to include buffer
    Rectangle tileInpix = mapContext.getViewport().getScreenArea();
    ReferencedEnvelope metaArea = new ReferencedEnvelope(areaOfInterest);
    metaArea.expandBy(bufferInPixels / tileInpix.getWidth() * areaOfInterest.getWidth(),
        bufferInPixels / tileInpix.getHeight() * areaOfInterest.getHeight());
    // fetch features in meta area
    Crs layerCrs = vectorLayerService.getCrs(layer);
    Envelope layerBounds = geoService.transform(metaArea, (Crs) areaOfInterest.getCoordinateReferenceSystem(),
        layerCrs);
    Filter filter = filterService.createBboxFilter(layerCrs, layerBounds,
        layer.getLayerInfo().getFeatureInfo().getGeometryType().getName());
    if (extraInfo.getFilter() != null) {
      filter = filterService.createAndFilter(filter, filterService.parseFilter(extraInfo.getFilter()));
    }
    List<InternalFeature> features = vectorLayerService.getFeatures(vectorInfo.getServerLayerId(),
        mapContext.getCoordinateReferenceSystem(), filter, extraInfo.getStyle(),
View Full Code Here

Examples of org.geomajas.layer.VectorLayer

  }

  public void execute(PipelineContext context, Object result) throws GeomajasException {
    try {
      log.debug("UpdateFeatureInvalidateStep start");
      VectorLayer layer = context.get(PipelineCode.LAYER_KEY, VectorLayer.class);

      // invalidate the area of the old feature
      InternalFeature oldFeature = context.getOptional(PipelineCode.OLD_FEATURE_KEY, InternalFeature.class);
      if (null != oldFeature) {
        // get original geometry from storage to assure not changed by transformation and available
        Object feature = layer.read(oldFeature.getId());
        context.put(PipelineCode.FEATURE_DATA_OBJECT_KEY, feature); // put in context to prevent getting twice
        FeatureModel featureModel = layer.getFeatureModel();
        Geometry oldGeometry = featureModel.getGeometry(feature);
        if (null != oldGeometry) {
          // invalidate
          recorder.record("layer", "Invalidate geometry for old version of feature");
          Envelope oldEnvelope = oldGeometry.getEnvelopeInternal();
View Full Code Here

Examples of org.geomajas.layer.VectorLayer

   * objects in the cache.
   *
   * @return true when features are not converted lazily
   */
  private boolean isCacheable(PipelineContext context) throws GeomajasException {
    VectorLayer layer = context.get(PipelineCode.LAYER_KEY, VectorLayer.class);
    return !(layer instanceof VectorLayerLazyFeatureConversionSupport &&
        ((VectorLayerLazyFeatureConversionSupport) layer).useLazyFeatureConversion());
  }
View Full Code Here

Examples of org.geomajas.layer.VectorLayer

      throw new RestException(e, RestException.PROBLEM_READING_LAYERSERVICE, layerId);
    }
    if (features.size() > 0) {
      VectorLayerInfo info = features.get(0).getLayer().getLayerInfo();
      model.addAttribute(VECTOR_LAYER_INFO, info);
      VectorLayer layer = configurationService.getVectorLayer(layerId);
      if (orderBy != null) {
        Collections.sort(features, createComparator(layer, orderBy, dir));
      }
      model.addAttribute(FEATURE_COLLECTION, features);
      model.addAttribute(ATTRIBUTES, attrs);
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.