Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 3.54 KB

publish-map.md

File metadata and controls

48 lines (31 loc) · 3.54 KB

Publishing maps

Using REST API it is possible to publish maps (map compositions) e.g. from QGIS. Let's describe how this process can be implemented in a technical way.

Two types of QGIS maps are considered:

Maps composed from WMS layers

In QGIS, you need to implement following steps.

First, compose JSON valid against map-composition schema. For Layman, especially name, title, abstract, and layers attributes are important. Each layer must have className attribute equal to HSLayers.Layer.WMS.

Then save the file to Layman using POST Workspace Maps endpoint. Well-known requests module can be used for sending HTTP requests. See especially

In response of POST Workspace Maps you will obtain

Later on, you can

Also, you can obtain list of all maps using GET Workspace Maps.

Maps composed from vector files

In case of maps composed from vector files, it is recommended first to publish each file as one WMS layer at Layman. Having each vector file as one WMS layer at Layman, you can then save map composition of WMS layers in the same way as in previous example.

Remember that Layman supports only EPSG:4326 and EPSG:3857 projections by default for publishing layers. Therefore compositions that use WMS layers provided by Layman must use one of supported projections, otherwise these layers can not be displayed.

In QGIS, you need to implement following steps.

First, publish each layer whose data source is local ShapeFile or GeoJSON as WMS layer using POST Workspace Layers endpoint. Do not forget to respect supported projection (see crs input parameter). Also set style parameter to layer style, otherwise the data file will be displayed with default GeoServer style.

In response of POST Workspace Layers you will obtain

In response of GET Workspace Layer you will obtain among others URL of WMS endpoint of the layer (wms/url). Together with name of the layer you have now enough information to represent the original local vector file as WMS layer.

Continue with the same steps as in previous example.