Basically, layers are divided into raster and vector layers. Raster layers consist of raster images, while vector layers consist of vector geometries.

To add a layer on a map declare the layers element and its configuration in the geoMap element in the XML descriptor. Here is an example of the map with one raster and one vector layer.

<maps:geoMap id="map" height="400px" width="800px" centerX="-99.755859" centerY="39.164141" zoom="4">
    <maps:layers selectedLayer="orderLayer">
        <maps:tile id="tileLayer"
                   attribution="&#169; &lt;a href=&quot;;&gt;
                       OpenStreetMap&lt;/a&gt; contributors"/>
        <maps:vector id="orderLayer" dataContainer="orderDc" editable="true"/>

selectedLayer is a layer which the map is focused on. Selected layer fires events, reacts on user clicks and can be modified by UI interaction in case the layer is editable.

Parameters are common for every type of layers:

  • id — required parameter, specifies the id of the layer.

  • visible — whether the layer is visible.

  • minZoom — minimum zoom level down to which the layer is visible (inclusive).

  • maxZoom — maximum zoom level up to which the layer is visible (inclusive).

Also, you can add layers and perform configuration of the layers in the screen controller:

private GeoMap map;

private InstanceContainer<Order> orderDc;

public void onBeforeShow(BeforeShowEvent event) {
    TileLayer tileLayer = new TileLayer("tileLayer");
    tileLayer.setAttributionString("&copy; <a href=\"\"" +
            ">OpenStreetMap</a> &copy; <a href=\"\">CARTO</a>");
    VectorLayer<Order> orderLayer = new VectorLayer<>("orderLayer", orderDc);

By default, the GeoMap UI component has a special utility layer — Canvas. Canvas provides a straightforward API to display and draw geometries on a map.