Geomajas Community Documentation

7.2. VectorLayerService

Vector layers and the data contained within are accessible using the vector layer service. You should not try to access the layers directly. This service assures that the security constraints are adhered. Following access methods are available

  • void saveOrUpdate(String layerId, CoordinateReferenceSystem crs, List<InternalFeature> oldFeatures, List<InternalFeature> newFeatures) throws GeomajasException : allows creating or updating several features. You have to pass both the old features (null or the feature before it was modified) and the new value of the feature. The two are at compared to determine whether to create, update or delete.

  • List<InternalFeature> getFeatures(String layerId, CoordinateReferenceSystem crs, Filter filter, NamedStyleInfo style, int featureIncludes) throws GeomajasException : read all features from the layer which match the filter. You can specify which aspects of the feature need to be set.

  • List<InternalFeature> getFeatures(String layerId, CoordinateReferenceSystem crs, Filter filter, NamedStyleInfo style, int featureIncludes, int offset, int maxResultSize) throws GeomajasException : read a batch of features from the layer which match the filter. You can specify which aspects of the feature need to be set..

  • Envelope getBounds(String layerId, CoordinateReferenceSystem crs, Filter filter) throws GeomajasException : get the bounds of the visible features which match the filter. This can be useful for fit-to-page like functionality.

  • List<Attribute<?>> getAttributes(String layerId, String attributeName, Filter filter) throws GeomajasException : get the list of possible attribute values.

  • InternalTile getTile(TileMetadata tileMetadata) throws GeomajasException : get a vector tile.