No, @scale doesn't work in expressions.  But you can indeed use
WMS_SCALE_DENOMINATOR and any other environment variable. In fact, all
filter functions are accessible.

This XML:
        <ogc:Function name="env">
            <ogc:Literal>wms_scale_denominator</ogc:Literal>
            <ogc:Literal>500000</ogc:Literal>
        </ogc:Function>

is the same as this CQL (with brackets so you can copy into the CSS):

[env('wms_scale_denominator', 500000)] .

So you could write:

* {
  fill: lightgrey;
  stroke: black;
  mark: symbol(square);
  mark-size: [env('wms_scale_denominator', 500000) * 0.3)];
}

--
David Winslow
OpenGeo - http://opengeo.org/



On Thu, Jan 3, 2013 at 2:58 PM, Morten Olsen Lysgaard <[email protected]>wrote:

> The plugin works great. Is there any way to use the @scale variable
> for calculating the size of something. Lets say i want the size of a mark
> to be a function of the current scale. Something in the lines of:
>
> * {
>   fill: lightgrey;
>   stroke: black;
>   mark: symbol(square);
>   mark-size: [@scale*0.3]m; // mark size always 3 centimetres large
> }
>
> Or would it be possible to use the variable Ákos mentioned,
> WMS_SCALE_DENOMINATOR?
>
> This may seem a little contrieved but it's just to make the example simple.
> Thanks for the help.
>
> On Thu, Jan 3, 2013 at 8:30 PM, Morten Olsen Lysgaard
> <[email protected]> wrote:
> > On Thu, Jan 3, 2013 at 8:10 PM, David Winslow <[email protected]>
> wrote:
> >> Well, I normally do not install the CSS plugin (instead I build
> GeoServer
> >> from sources with the plugin built in) but I just tried it and it seems
> to
> >> work all right on my machine.  The error message seems to indicate a
> >> configuration problem:
> >>> java.lang.RuntimeException: java.lang.IllegalArgumentException:
> Resource
> >>> must be part of a store
> >>
> >> That is, there is a resource (configured in a featuretype.xml or
> >> coverage.xml file under workspaces) which doesn't correspond to any
> >> configured store. Unfortunately the error message does not provide any
> >> diagnostic information about which resource is not part of a store, but
> I
> >> think you could review these xml files and verify that they all contain
> >> <store> elements and that the id for those elements is also the id of
> some
> >> store in the server.
> >
> > You where right. With the above info i found a stay file lying in the
> > configuration
> > that was referencing an non existing store. Don't understand how it
> > got there though
> > because i deleted it, but that's another problem. Now geoserver is
> > back up running
> > and the CSS plugin is working. Thanks. I'll report back on my progress :)
>
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to