Maps are helpful because they allow you gain a deeper understanding of your data by allowing you to visualize it in many different ways. So you can tell different stories depending on how the data is presented. For any given data or layer, you should explore different styling options and choose the best style for that.
In GeoNode each layer has a Default Style which is determined by the nature of the data you’re mapping. When uploading a new layer (see Layers Uploading) a new default style will be associated to it.
Referring to the example above, dark orange lines are not very good to represent waterways so we would need to change this style. In the following paragraphs you will learn how to create a new style starting from given templates, how to edit a style, how to upload styles from file and how to manage them.
Creating new Styles¶
In order to create a new style, open the Layer Page (see Layer Information) and click on Editing Tools. Then click the Edit button in the Styles section of the Layer Editing panel (see the picture below).
The Layer will open in a new Map. The Styles Panel will show you all the available styles for the layer and some useful tools.
Now follow the steps below:
- Choose a Style Template from the list (both CSS and SLD styles are available).
- Insert a Title and an Abstract (optional), then click on Save.
The style you have created is now added to the Styles List.
You will also see this new style in the Layer Page.
Now you can switch the style by clicking on the corresponding checkbox.
It would be nice to change the style in order to decrease the opacity of the filling color as well as to reduce the lines width. The embedded MapStore makes available a powerful Style Editor to accomplish that tasks. In the next paragraph we will explain how.
Editing the Layer Style¶
The following steps show you how to edit styles:
- From inside the map open the TOC (Table Of Content) by clicking the button
- Click on
- Open the Style tab
Styles editing is allowed only to those users who have the needed permission. See Changing the Layer Permissions to read more)
- Select the Style and click on
- Edit the style. The Style Editor helps you to write valid styles through the Syntax Validator which shows you a popup in case of errors (see the picture below).
See the following gif to recap the whole process.
In GeoNode it is also possible to upload an existing style from file.
Currently only styles in SLD (Style Layer Descriptor 1.0, 1.1) format can be uploaded in GeoNode.
From the Layer Page click on Editing Tools to open the Editing Tools panel and follow the steps below:
- Click the Upload button of the Styles section
- Click on Choose Files and select your style from your disk
- Click on Upload files
Once the process has been finished the new Style will be visible in the Layer Page.
Given a layer, you can manage all its styles in tha Styles Management Page accessible from the Manage button of the Layer Editing panel.
In that page you can:
- See the Layer Name
- Add/remove styles to/from the Available styles list
- Choose the Layer Default Style from the Available styles list
Click on Update Available Styles to save your changes.