2

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:

<Geometry>
    <ogc:Function name="offset">
        <ogc:PropertyName>way</ogc:PropertyName>
        <ogc:Literal>-13</ogc:Literal>
        <ogc:Literal>13</ogc:Literal>
    </ogc:Function>
</Geometry>

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

2

Here is the CSS solution for geoserver:

enter image description here

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

                    /* @title Building 60K - 5K */
            [building='yes'][@scale>5000][@scale<60000],
            [building='house'][@scale>5000][@scale<60000]
             {
              /* In EPSG900913 so offset equates to meters */
              geometry: [offset(way, 8, -6)], [way];
              fill: black, #696969;
             } 

                    /* @title Building 5K - 3K */
            [building='yes'][@scale>3000][@scale<5000],
            [building='house'][@scale>3000][@scale<5000]
             {
              /* In EPSG900913 so offset equates to meters */
              geometry: [offset(way, 5, -4)], [way];
              fill: black, #696969;
             } 

                     /* @title Building 3K - 0K */
            [building='yes'][@scale<3000],
            [building='house'][@scale<3000]
             {
              /* In EPSG900913 so offset equates to meters */
              geometry: [offset(way, 3, -2)], [way];
              fill: black, #696969;
             } 
0

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

http://docs.geoserver.org/latest/en/user/extensions/css/properties.html#text-symbology-labeling

-1

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. – Mark Cupitt Jun 23 '14 at 8:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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