Book Image

Mastering Geoserver

By : Colin Henderson
Book Image

Mastering Geoserver

By: Colin Henderson

Overview of this book

Table of Contents (19 chapters)
Mastering GeoServer
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Styling data using Cascaded Style Sheets


Although SLDs are the default method to apply styles to the data served by GeoServer, it is not the only way. There is an extension available that adds the ability to provide styling information using Cascaded Style Sheets (CSS). There are a couple of reasons why you might choose to use CSS styles over traditional SLDs:

  • If you have built any kind of web page, then you are likely already familiar with the syntax of CSS

  • The CSS syntax is much leaner than SLD, making styles more readable

  • You don't need to understand XML, making CSS styles less prone to syntax errors

Getting started with CSS styles is as easy as installing the extension and restarting GeoServer.

Installing the extension

Like with all other GeoServer extensions, installation of the CSS extension is as straightforward as copying some JAR files to the <geoserver_home>/WEB-INF/lib folder and restarting GeoServer. First, we must download the version of the extension that matches the version...