LayerDefinition

 

This is the most complex part of all of geomajas' configuration. It is the real heart of a vector layer, determining how it looks, and what it can do.

 Let us first have a look at an example:

<layerDefinition>
	<layerFactory>org.geomajas.core.application.DefaultLayerFactory</layerFactory>
	<label>
		<labelAttribute>ATTRIBUTE_NAME</labelAttribute>
	</label>
	<filter   />
	<editPermissions>
        	<creatingAllowed>false</creatingAllowed>
<updatingAllowed>true</updatingAllowed>
<deletingAllowed>false</deletingAllowed>
</editPermissions>
Now let us take on these tags, one by one.
  • layerFactory : Javaclass to the factory for this layer. Unless some very special is needed for this layer, this can always be the default factory you see in the example.
  • label : Each vectorlayer needs to have a labeling definition. For the moment it consists of one tag:
    • labelAttribute : The attribute that is used in labelling features in this layer. Later in this manual you will learn how to configure these attributes. What you will in here, is the NAME (not label) of one of those attributes.
  • filter : In some cases it may be desirable to have a recstriction on the available features. This is done by applying a filter to which features are tested. Only the ones that pass, will be actually shown on the map. This filter is expressed by the feature's attributes in a language called CQL.
    Say, for example, you have an attribute called "SOME_NUMBER" that holds for each feature a certain decimal value. A filter like this: "(SOME_NUMBER > 100)" would only allow features with a value for the attribute "SOME_NUMBER" lager then 100. The rest would be discarded.
  • editPermissions : These are the permissions for editing features in this layer. There is a subdivision to better control what is allowed and what is not:
    • creatingAllowed : Is it allowed to create new features in this layer? (true or false)
    • updatingAllowed : Is it allowed to update existing feature in this layer? (true or false)
    • deletingAllowed : Is it allowed to delete existing features in this layer? (true or false)