#

## OpenGeo Stack Workshop

# Thematic Styling with Styler

Thematics is another very import aspect of cartography. This section covers the task of launching the Styler application and using it to create create a simple thematic style.

1. Navigate to http://localhost:8080/geoserver/www/styler/index.html in the web browser.

   Running the Styler application

2. In the Layers panel, turn off the world_adm0 layer by unchecking the check box next to it. Turn on the bay_area_transit_routes layer by checking the check box next it.

   Turning on the bay_area_transit_routes layer

3. Activate the bay_area_transit_routes layer for styling by selecting the radio button next to it

   Note

   The check boxes are used control layer visibility. Any number of layers can be visible at one time. The radio buttons are used to set the layer to be styled. Only a single layer can be styled at once.

   Setting the bay_area_transit_routes layer to be styled

4. In the Legend panel click the defaut style

   Opening the Style dialog

5. In the Style dialog change the Name field to “Bus”.

6. Click the Color field and change the color to green.

   Editing color

7. Close the Color Picker dialog and click the Advanced tab.

   Opening the advanced styling tab

8. Click the Limit by condition check box.

   Note

   Limiting by condition applies a filter to a style restricting what parts of the layer the style applies to. Such filters are usually based on a layer attribute value.

9. Leave the value of the first drop down list as any.

10. In the second drop down select the class attribute.

    Selecting the attribute for a condition

11. In the third drop down select the = operator.

    Selecting the operator for a condition

12. In the text field enter the text “Bus”

    Specifying the value for a condition

    Note

    The above filter specifies that only transit routes which are “Bus” routes should be matched.

13. Click the Save button.

    Saving a style

14. Add a new style by clicking the Add new button in the Legend panel:

    Adding a new style

15. Repeating steps 5 through 13 create a new style with:

    - Name: “Rail”
    - Color: grey
    - Condition: class = Rail

    Adding the Rail style

16. Add another style with:

    - Name: “Ferry”
    - Color: blue
    - Condition: class = Ferry

    Adding the Ferry style

17. Zoom in closer to get a better look at the styles.

    Note

    The map panel of Styler is a regular OpenLayers map. You can “rubber-band” zoom by holding Shift and dragging the mouse to draw a desired viewport.

    Viewing the styled bay_area_transit_routes layer

At this point a thematic style has been created with the Styler application. In the next section the style will be further improved with the addition of scale dependence.

### Navigation

- index
- modules |
- next |
- previous |
- OpenGeo Stack Workshop »
- Styling with the GeoExt Styler »
- Thematic Styling with Styler