Layer Styling

Layer Styling

Using QGIS, you can control many visual aspects of your layer. You may apply a common style for all the features in a layer (Single Symbol) or apply a thematic style that displays features according to any of its attributes (Categorized).

WMS Layers

When Pozi displays a WMS layer (ie, not WFS/vector), the rendering of the layer is done by QGIS Server.

The layer will display exactly as it appears in QGIS Desktop.

Vector Layers

When Pozi displays a vector layer (ie, WFS), the rendering and styling are done in the browser. This can sometimes cause the layer to appear differently compared to QGIS for some styling options.

To ensure maximum compatibility with QGIS when working with vector layers, use only the supported styles specified below.

(If you need to style layers using a QGIS style that doesn’t appear in the below lists of supported styles, disable WFS for the layer to force Pozi to retrieve the layer via WMS, which uses the QGIS Server renderer.)

Points

Supported marker symbols:

  • Simple Marker: square, circle, triangle, star, cross, x, etc…
  • SVG Marker

Suggested sizes:

  • set size to 4mm or greater enable to easier interaction for users in the browser
  • set stroke to white, 0.5mm or greater to provide separation from the background

Lines

Supported lines:

  • Simple Line
    • Solid Line
    • No Pen
    • Custom Dash Pattern

Set line thicknesses to 2mm or greater to enable users to easily select line features.

To style a line with dots and/or dashes:

  • set the cap style to flat
  • tick “Use custom dash pattern”
  • specify a dash pattern (eg, 4 2) in millimetres.

QGIS Line - custom dash pattern

Polygons

Supported fills:

  • Simple Fill: Solid, No brush, Horizontal, Vertical, Cross, etc…
  • Point Pattern Fill

Ensure your polygon features remain selectable

If the polygon fill style is set to ‘No brush’, it will prevent users from being able to select a polygon when clicking within the polygon.

To display a polygon with an empty fill while still enabling users to select the polygon, use the ‘Solid’ fill, and set the opacity of the fill color to a low or zero value.

Labels

Point, line and polygon features can be configured to display labels.

Not yet supported in Pozi:

  • label offsets
  • buffer transparency
  • text expressions
    • combining values from multiple fields
    • find-and-replace operations
    • converting to upper or lower case
    • etc

Instead of using a text expression within the label to manipulate text, create a virtual field to dynamically generate the required text for your label.

To improve legibility, set label text size to 10 points or greater and a white 1.8mm buffer.

Embedded Symbology

Layers from MapInfo tables sometimes contain embedded styles. Although QGIS Desktop may recognise and display the features using these styles, QGIS Server is unable to pass on the style to Pozi for styling vector layers.


Embedded styling

If the layer’s symbology mode is set to “Embedded Symbols”, switch it to “Single Symbol” or “Categorized”, and style it according to your preference.

Categorized Symbology

Layers can be styled using the Categorized option. Pick the field to use for the category from the drop-down list, then click the Classify button.


Categorized styling

Limitations

When publishing the layer as a vector layer, the field used for categorisation must be a field that is exposed (ie, not hidden).

An addition, the following limitations apply:

  • the symbology must be based on a field (real or virtual), not an expression
  • the values must not be merged (ie, only one value per row)
  • the field name must not contain any spaces

You can work around these limitations by creating a suitably named virtual field that contains the required logic.

For instance, the virtual field can contain a case statement to accept any number of input values (from one or more fields) and generate specific values for use in subsequent styling.

See Virtual Fields for more information.

Fallback Style

When using the Classify button to generate styles for each unique value, QGIS automatically generates an additional fallback style for “all other values”. However this function is not supported in Pozi - this style category will be ignored by Pozi.


QGIS Categories

Opacity

Layer Styling > Layer Rendering > Opacity


QGIS Layer Opacity

Layers are initially displayed in Pozi using the opacity value you’ve set. Users can adjust the opacity up or down from the initial value using the layer’s opacity slider.


Bubble Symbols

Point layers can be displayedusing Pozi’s popular bubble symbols.

Ensure that your PC (and the server on which QGIS Server is running) has the Font Awesome icon library installed and configured in QGIS.

Customise Bubble Symbol

  1. download sample SLD file
  2. go to Layer Properties > Symbology > Style > Load Style > … (select downloaded SLD file) > Load Style
  3. pick icon
    • select top SVG Marker item
    • set the Fill Color to white (#FFFFFF)
    • in SVG browser, select Pozi SVGs
    • browse icons or use search box to find icon
    • select icon
  4. pick bubble colour
    • select middle SVG Marker item
    • click Fill Color to change colour
  5. OK

Save your project, and preview the layer in Pozi.

Note that the vertical alignment of the icon within the bubble in QGIS may differ slightly to what you see in the Pozi app. What’s important is that the icon displays appropriately in Pozi, even if it looks slightly misaligned in QGIS.

Finding the right icon

The Font Awesome icon library contains thousands of icons to choose from. While you can use the search function within the QGIS SVG browser to search based on an icon filename, you can also use the online Font Awesome search tool to discover icons that match your need, even if your search term doesn’t appear in the icon file name.

Looking for a barbecue icon? Type ‘bbq’ into the Font Awesome online search to see the matching icons. Note that they are named ‘grill’. Now go to the QGIS SVG browser and type in ‘grill’ to find and select the icon.

Last updated on