Geomajas Community Documentation

6.2. Provided commands

The commands are all registered in the Spring context. The "registry key" as indicated below is used to retrieve the commands. These are services, so a singleton should be sufficient for this.

The default naming for the keys is derived from the fully qualified class name. This is automatically assigned when the command is in a (sub package of) the "command" package. To determine the bean name, all parent packages of the "command" package are removed. Then the name is simplified. It will end up having "command." as prefix, optionally followed by a package, followed by the name. As there already is a "command" prefix, the "Command" suffix is removed from the name if present. When the resulting name starts or end with the sub package, then that is removed as well. For example the "org.geomajas.command.configuration.GetConfigurationCommand" class will get "command.configuration.Get" as registry key.

CopyrightCommand  
Registry key command.general.Copyright
Module which provides this command geomajas-command
Request object class org.geomajas.command.EmptyCommandRequest
Parameters none
Description This allows you to obtain copyright and license information for Geomajas, it's dependencies, the plg-ins and the dependencies of the plug-ins. This can be used to display that information in a "about" box to assure the copyright and license conditions are adhered.
Response object class org.geomajas.command.dto.CopyrightResponse
Response values List of CopyrightInfo objects for the dependencies. Any duplicates are removed based on the copyright info key.

Table 6.1. CopyrightCommand


GetConfigurationCommand  
Registry key command.configuration.Get
Module which provides this command geomajas-command
Request object class org.geomajas.command.EmptyCommandRequest
Parameters none
Description Get the client side configuration information. This returns information about all maps which have been configured.
Response object class org.geomajas.command.dto.GetConfigurationResponse
Response values
  • name : name of the application.

  • maps : list of configured maps for the application. Note that the layer information which is contained in the maps has the coordinates transformed according to the crs of the map.

  • screenDpi : screen resolution in dots per inch.

Table 6.2. GetConfigurationCommand


GetMapConfigurationCommand  
Registry key command.configuration.GetMap
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.GetMapConfigurationRequest
Parameters
  • mapId : id of map for which the information should be returned.

Description Get the client side configuration information for the specified map.
Response object class org.geomajas.command.dto.GetMapConfigurationResponse
Response values
  • mapInfo : information about the requested map. Note that the layer information which is contained in the maps has the coordinates transformed according to the crs of the map.

Table 6.3. GetMapConfigurationCommand


GetRasterTilesCommand  
Registry key command.render.GetRasterTiles
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.GetRasterTilesRequest
Parameters
  • crs : coordinate reference system that the map uses.

  • bbox : total bounding box wherein to fetch raster tiles.

  • scale : current scale in the client side map.

  • layerId : the id of the raster layer to fetch tiles for.

Description Retrieve a set of raster tiles as image links for a given layer within a certain bounding box expressed in a certain coordinate reference system.
Response object class org.geomajas.command.dto.GetRasterTilesResponse
Response values
  • rasterData : list of RasterTile objects.

  • nodeId : identifier to be used in the DOM tree.

Table 6.4. GetRasterTilesCommand


GetVectorTileCommand  
Registry key command.render.GetVectorTile
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.GetVectorTileRequest
Parameters
  • layerId : the id of the vector layer to fetch a tile in.

  • code : the unique code of the tile to retrieve.

  • scale : the current scale on the map, client side.

  • panOrigin : translation for the tile on the client-side.

  • filter : extra filter that can be used to filter out data.

  • crs : the map's coordinate reference system.

  • renderer : should the server render to SVG or VML?

  • styleInfo : extra styles that can override the originally configured styles.

  • paintGeometries : should the geometries be painted in the tile? This is true by default.

  • paintLabels : should labels be painted in the tile?

  • featureIncludes : indication of which data to include in the feature. Possible values (add to combine): 1=attributes, 2=geometry, 4=style, 8=label. Default value is to include everything.

Description Fetches a single tile for a vector layer. The tile can contain both vectors and labels. This command is used to paint vector layers in the map.
Response object class org.geomajas.command.dto.GetVectorTileResponse
Response values
  • tile : the actual resulting tile.

Table 6.5. GetVectorTileCommand


LogCommand  
Registry key command.general.Log
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.LogRequest
Parameters
  • level : log level, 0 for debug, 1 for info, 2 for warn, 3 for error.

  • statement : string which needs to be logged.

Description This allows you to send a statement to the server side which will be logged there.
Response object class org.geomajas.command.CommandResponse
Response values none

Table 6.6. LogCommand


MergePolygonCommand  
Registry key command.geometry.MergePolygon
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.MergePolygonRequest
Parameters
  • polygons : array of polygons that need to be merged

  • allowMultiPolygon : is a MultiPolygon allowed when merging multiple polygons?

Description This command allows the user to merge multiple polygons into a single polygon or multipolygon.
Response object class org.geomajas.command.dto.MergePolygonResponse
Response values
  • geometry : the resulting geometry after the merge.

Table 6.7. MergePolygonCommand


PersistFeatureTransactionCommand  
Registry key command.feature.PersistTransaction
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.PersistTransactionRequest
Parameters
  • featureTransaction : the actual transaction object. Contains a list of features as they where, and a list of features as they should be.

  • crs : the map's coordinate reference system.

Description Persist a single transaction on the backend (create, update, delete of features).
Response object class org.geomajas.command.dto.PersistTransactionResponse
Response values
  • featureTransaction : the same transaction that was sent to the server. Unless something went wrong, in which case this could be null.

Table 6.8. PersistTransactionCommand


SearchAttributesCommand  
Registry key command.feature.SearchAttributes
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.SearchAttributesRequest
Parameters
  • layerId : the layer to search in.

  • attributeName : the name of the attribute as configured in the feature info.

  • filter : a filter, to limit the list of returned features.

Description Search for attribute possible values for a certain attribute. This command is only used for many-to-one and one-to-many relationships, to search for possible values.
Response object class org.geomajas.command.dto.SearchAttributesResponse
Response values
  • attributes : list of attribute values.

Table 6.9. SearchAttributesCommand


SearchByLocationCommand  
Registry key command.feature.SearchByLocation
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.SearchByLocationRequest
Parameters
  • location : geometry which should be used for the searching.

  • queryType : specify exactly whether to search, possible values are QUERY_INTERSECTS, QUERY_TOUCHES, QUERY_WITHIN or QUERY_CONTAINS.

  • ratio : if queryType is QUERY_INTERSECTS, you can additionally specify what percentage of overlap is enough to be included in the search.

  • layerIds : array of layer ids to search in.

  • searchType : determines whether to stop searching once something in found in one of the layers (in order of course), or whether to continue searching, and include matching features from all layers.

  • crs : the map's coordinate reference system. The location geometry will also be expressed in this crs.

  • buffer : before any calculation is made, it is possible to have the location geometry expanded by a buffer of this width (in crs space).

  • featureIncludes : indication of which data to include in the feature. Possible values (add to combine): 1=attributes, 2=geometry, 4=style, 8=label. Default value is to include everything.

Description This command allows you to search for features, based on geographic location.
Response object class org.geomajas.command.dto.SearchByLocationResponse
Response values
  • featureMap : map with layer ids as key and a list of features as value. Only layers in which features were found are included in the map.

Table 6.10. SearchByLocationCommand


SearchFeaturesCommand  
Registry key command.feature.Search
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.SearchFeatureRequest
Parameters
  • layerId : id of layer in which features need to be searched.

  • max : maximum number of features to allow in the result. 0 means unlimited.

  • crs : crs which needs to be used for the geometry in the retrieved features.

  • criteria : array of criteria which need to be matched when searching. Each criterion contains the attribute name, the operator (options include "like" and "contains") and the value to compare. Note that the value usually needs to be contained in single quotes.

  • booleanOperator : operator which should be used to combine the different criteria when more than one was specified. Should be either "AND" or "OR". Default value is "AND".

  • filter : an additional layer filter which needs to be applied when searching.

  • featureIncludes : indication of which data to include in the feature. Possible values (add to combine): 1=attributes, 2=geometry, 4=style, 8=label. Default value is to include everything.

Description This command allows you to search for features, based criteria which allow matching on feature attributes. You can specify multiple search criteria and a filter.
Response object class org.geomajas.command.dto.SearchFeatureResponse
Response values
  • layerId : id of the layer which contains the features. Equals the layerId parameter from the request.

  • features : array of features which match the search criteria. Any geometry contained in the features uses the request crs.

Table 6.11. SearchFeatureCommand


SplitPolygonCommand  
Registry key command.geometry.SplitPolygon
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.SplitPolygonRequest
Parameters
  • geometry : the geometry that needs splitting.

  • splitter : the splitting geometry (usually a LineString).

Description Split up a geometry into many pieces by means of a splitting geometry.
Response object class org.geomajas.command.dto.SplitPolygonResponse
Response values
  • geometries : the list of resulting geometries after the split.

Table 6.12. SplitPolygonCommand


UserMaximumExtentCommand  
Registry key command.configuration.UserMaximumExtent
Module which provides this command geomajas-command
Request object class org.geomajas.command.dto.UserMaximumExtentRequest
Parameters
  • layerIds : list of layers to include.

  • includeRasterLayers : true when raster layers should be included. Defaults to false.

  • crs : crs which should be used for the response.

Description Get the bounding box of the visible features across the requested layers (visible area for the raster layers).
Response object class org.geomajas.command.dto.UserMaximumExtentResponse
Response values
  • bounds : bounding box.

Table 6.13. UserMaximumExtentCommand