Skip to content

Publish a layer

Every map in Loka Server goes the same way: Workspace → Data Store → Layer → Style → Publish. You do all of it in the web console at http://127.0.0.1:8080.

The sidebar of the console has these groups:

Group Pages
Main Dashboard, Workspaces, Data Stores, Layers, Layer Groups, ENC Charts, Elevation, 3D Tiles, Styles, Publishing
Analysis Workbench, Guides
Services OGC Services, Tile Cache
Monitoring System, Monitoring, Logs
Settings Security, API Tokens

Press Ctrl+K to jump to a page by name.

A workspace groups layers, like a project. Its name is what readers see; Loka makes the service name for you.

  1. Open Workspaces and press + Add Workspace.
  2. Enter a Name (up to 160 characters), for example Peta Indonesia 1:10M.
  3. Press Save Workspace.

Loka builds the service name from the name: lower-case letters, digits and _, at most 40 characters. Renaming a workspace later changes only its display name; addresses that clients use stay the same.

A workspace can be deleted only when it is empty, and only by an administrator.

The Workspaces page with one workspace, Demo, holding 83 layers
Workspaces in the console. Each row links to its layers and its WFS address.

A data store is where the data comes from: a file, a database or a remote service.

  1. Open Data Stores and press Add new Store.

  2. Pick a type in New Data Source:

    Group Types
    Vector GeoPackage, PostGIS, WFS service, Shapefile, Aeronautical (AIXM)
    Raster GeoTIFF, Weather (GRIB)
    Military Military map product (CADRG/CIB, ADRG, ASRP/USRP, NITF; a VPF database becomes a GeoPackage store)
  3. Choose the Workspace and the file (or the connection), then press Save.

PostGIS and WFS service stores are for administrators only. For PostGIS, press Test connection before you save. A PostGIS store can be Global — usable from any workspace; a store in a workspace publishes only into that workspace.

ENC charts and elevation are not data stores: import S-57 cells on ENC Charts (Import cells) and DTED on Elevation. See Formats.

After a file upload, the console opens the new layer. For a store with several tables, open the store and use Publish layers:

  • File stores: press Publish next to a table or raster. A global store asks which workspace to publish into.
  • PostGIS stores: press Publish live to read the table on every request, or Snapshot to copy it once (Refresh snapshot copies it again).

The layer page has five tabs:

Tab What it is for
Data The name, the WMS name and where the data comes from
Publishing Publish the draft, preview the service, copy the addresses
Style Editor The layer’s SLD style
Layer Preview The map
Metadata Abstract and keywords, shown to clients such as QGIS in the capabilities

The WMS name is made once from the layer name, for example roads_2024. You can change it on the Data tab, but QGIS and web clients that use the old name in LAYERS= stop working. WMTS and TMS addresses and cached tiles are not affected.

Each layer has its own SLD 1.0 style. On the layer’s Style Editor tab:

  1. Edit the SLD, or start from Load template… (Point, Line, Polygon, raster RGB, grayscale or colour ramp).
  2. Press Validate.
  3. Press Apply / Save Draft. The Draft Preview shows the draft; Published WMS shows what clients see now.
  4. Press Publish Style.
The Style Editor tab of a layer, showing the MIL-STD-2525 tactical graphics options
A layer's Style Editor tab. Some layer types, like MIL-STD-2525 graphics, show a form instead of raw SLD.

A style can be at most 24 KiB. Validation checks the syntax and the structure; how a rule is drawn depends on MapServer.

Styles in the sidebar is the style library: styles you can reuse. Press + Add a new style, start from a template or copy a layer’s style, then Apply & Save it to a layer. That puts it on the layer as a draft, which you publish from the layer’s Style Editor.

Some layers have their own style modes:

Layer Style
Points with a symbol code MIL-STD-2525 symbols: unit and equipment symbols or tactical graphics, from a code attribute
Aeronautical (AIXM) Use the chart style: ICAO Annex 4 symbols
ENC charts The S-52 display, with day, dusk and night palettes, on the chart’s Style tab

On the Publishing tab, press Publish draft (revision N). The layer badge changes from Published · draft pending to Published.

The Service endpoints card lists every address for the layer: WMS, WMTS, XYZ, TMS, WCS for rasters, WFS for vectors and vector tiles. See Services and clients for how to use them.

A layer group draws several layers as one map.

  1. Open Layer Groups and press + Create Layer Group.
  2. Choose the workspace, a display name and up to 20 member layers. The order you select them in is the drawing order.
  3. Press Create Group.

A group is published as soon as it is saved. Its members always use their published style.

MapCache keeps the tiles of every layer and group. Publishing a new style starts a fresh cache by itself.

To fill the cache ahead, or clear it, open Tile Cache and press Seed / Purge (administrators only):

Operation Effect
Seed Adds missing tiles
Reseed Replaces tiles
Purge Deletes cached tiles
The Tile Cache page listing cached layers and groups with Seed / Purge buttons
The Tile Cache page.

Choose the zoom levels (0 to 18) and, if you want, an extent in EPSG:3857. One job can make at most 75,000 tiles. Recent Jobs lists them, with Run again.