Base Config

 

Before diving into the complex configuration of attribute, snapping rules, styledefinitions and such, let us start with the base attributes that all layers need. Raster- and vector alike!

We will start with the basic XML tag for a vector layer. Note that it holds an ID-tag, which should always be unique!

<layer xmlns="http://geomajas.org/schemas/configuration/"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        id="unique_id"
	xsi:type="vectorLayerInfo">
...

 

We will now go over all the parameters one by one. Note that all parameters are case sensitive! We start with the general parameters. You will find that a vector layer starts with the same parameters.

  • label: The visual name of a layer.
  • visible: Should this layer be visible on startup or not? (true or false)
  • layerType: Geometry type of a layer. The following values are allowed: (value 1 is for rasters)
    • 2: The layer is a point layer
    • 3: The layer is a lineString / polyline layer
    • 4: The layer is a polygon layer
    • 6: The layer is a multilinestring layer
    • 7: The layer is a multipolygon layer
  • crs: Coordinate reference system. Always starts with "EPSG:". For example: "EPSG:4326" means lon-lat.
  • viewScale: Viewing scales between which this layer is visible. When a maps zooms in or out beyond the minimum and maximum viewScale, the layer will automatically be invisible. This scale is expressed in pixels per units. These units depend in the chosen CRS.
    • min: The minimun viewScale.
    • max: The maximum viewScale.
  • maxExtent: The maximum viewing extent for a layer. Beyond these borders, the layer will not be visible. Expressed in units from the previously chosen CRS.
    • minX: Minimum X value for the maximum viewing extent.
    • maxX: Maximum X value for the maximum viewing extent.
    • minY: Minimum Y value for the maximum viewing extent.
    • maxY: Maximum Y value for the maximum viewing extent.
  • maxTileLevel: The maximum numbers of levels the tilecache can go deep.