How can I display borders for geometries with UMN-Mapserver only when zoomed in a lot?

287 views Asked by At

I have a map-file for UMN, that displays a layer of vectors, each geometry with different colors depending on their attributes. That works fine. I also want to add borders around each geometry. That's no problem, but on the view showing the complete area, the borders dominate the image, because each geometry has only a few pixels. So I want to show the borders only at an specified zoom-level. I can disable or enable the whole layer depending on the zoom, but I don't know how to realize this only for the borders.

1

There are 1 answers

0
Andrea Bertani On BEST ANSWER

You can do that in at least two ways.
First, you can define two layers, one with the borders and one without the borders. Then you can use MINSCALEDENOM and MAXSCALEDENOM to display either the first or the second, based on zoom level.

Or, you can define one layer with the colored geometries, without borders, to be displayed at all zoomlevels. Then you should define a layer which consists of only the borders, to be displayed on top of the first but only at specified zoomlevel (again using MINSCALE and MAXSCALE). This layer uses the same data of the regular layer, but it must be of type POLYGON but without the COLOR keyword (only the OUTLINECOLOR should be specified). This way only the border of the polygon would be displayed and, if you display this on top of the other, you can create the effect of borders.

For a detailed description of the keywords, http://www.mapserver.org/mapfile/layer.html