#

## OpenGeo Stack Workshop

# Scale Depending Rendering with Styler

The style created in the previous section lacks some scale rules. In a previous module scale dependence was added by editing XML directly. In this section scale dependence will be added via the Styler.

1. Using the Zoom Slider on the left zoom to an approximate scale of 1:550,000.

   Zooming with the slider

   Note

   At any time the current scale can be viewed by hovering over the zoom slider. This can be useful when setting up scale dependent style rules.

2. Edit the Bus style by clicking on the rule in the Legend panel.

3. On the Basic tab change the Name to “Bus > 155K”

   Changing the name of a style

4. On the Advanced tab click the add condition button

   Adding a condition to a style filter

5. Set the Match drop down to all.

6. Add the condition “shape_leng > 50000” and save the style.

   Note

   The “shape_leng” represents the overall length of the transit route. Supplementing the scale filter with this conditional filter creates the affect of longer transit routes showing up at larger scales.

   Filtering the bay_area_bus_routes layer

7. Zoom in two levels to an approximate scale of 1:135,000.

8. In the Legend Panel click the Add new button.

9. Add a new style rule with:

   - Name: “Bus 155K - 35K”
   - Color: Same as Bus > 155K style (green).
   - Min scale limit: “35000”
   - Max scale limit: “155000”
   - Condition: Match all of:
     - “class = Bus”
     - “shape_leng > 20000”
     - “shape_leng < 50000”

   Adding a style at the 155K - 35K scale

10. Save the Bus 155 - 35k style.

11. Add a third style rule that similar to the one added in steps 8 through 10 with:

    - Name: “Bus < 35K”
    - Color: Same as Bus > 155K style (green).
    - Max Scale: “35000”
    - Condition: Match all of:
      - “class = Bus”
      - “shape_leng < 20000”

    Adding a style at the < 35K scale

12. Zoom the map in and out to verify the scale dependent rules.

    Viewing style change based on scale

Up to this point SLD styles have been created by editing XML directly, and via the Styler application. In the `next` module an SLD style will be created with a combination of the two.

### Navigation

- index
- modules |
- next |
- previous |
- OpenGeo Stack Workshop »
- Styling with the GeoExt Styler »
- Scale Depending Rendering with Styler