I styled Geoserver maps with SLD. And now I have to convert this style to CSS. CSS is easier to support. Well, I have this fragment of SLD:

    <ogc:Function name="offset">

I don't know how to use 'offset' function in CSS. Can you help me?

3 Answers 3


Here is the CSS solution for geoserver:

enter image description here

             /* ---------------- BUILDING ------------- */

                    /* @title Building 60K - 5K */
              /* In EPSG900913 so offset equates to meters */
              geometry: [offset(way, 8, -6)], [way];
              fill: black, #696969;

                    /* @title Building 5K - 3K */
              /* In EPSG900913 so offset equates to meters */
              geometry: [offset(way, 5, -4)], [way];
              fill: black, #696969;

                     /* @title Building 3K - 0K */
              /* In EPSG900913 so offset equates to meters */
              geometry: [offset(way, 3, -2)], [way];
              fill: black, #696969;

Do you mean the label properties? Have you checked the docs?



The offset function can be used to create drop shadow effects below polygons. Notice that the offset values reflect the fact that the data used in the example is in a geographic coordinate system. (from Geometry transformations in SLD)

A CSS equivalent for your SLD code could be this:

box-shadow: -13px 13px 0px #888888;

You may test this code here

  • This is not your regular CSS, rather the question refers to the CSS Module in Geoserver which is a CSS Syntax Editor that then converts the entered CSS style into the appropriate SLD for use by Geoserver. Jun 23, 2014 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.