Book Image

GeoServer Cookbook

By : Stefano Iacovella
Book Image

GeoServer Cookbook

By: Stefano Iacovella

Overview of this book

Table of Contents (17 chapters)
GeoServer Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Creating scale-dependent rules


Most maps contain more than one layer—each one styled with one or more symbols according to its complexity and the map purpose.

When you browse interactive maps with many layers, you can see that the map changes its style according to the zoom level. When your view on the data is a portrait of the entire world, symbols are simple and there are a few features drawn on the map. As you get closer, you can see more labels, major roads change their symbols, and minor roads appear.

This approach lets you insert a large quantity of information on a web map while avoiding producing an almost unreadable jumble of labels and symbols.

How can you do a similar map with CSS code? It's again a matter of creating filters. This time, you should not only create filters that apply symbols according to the features' attributes, but you should also insert a constraint on the map scale to have GeoServer select the features that have to be drawn.

In this recipe, you will use the global...