[Geoserver-users] Using variable substitution and static values inside OnlineResource href

Hi all,

I am trying to show a svg over some features. The end user should choose
which svg to display and send svg name through WMS requests into my sld
file. If no filename provided, a default one should render. All available
svg files are inside geoserver data dir.

What I achieved so far is:

/<ExternalGraphic>
  <OnlineResource xlink:type="simple" xlink:href="${env('chosen-icon',
icon)}"/>
  <Format>image/svg+xml</Format>
</ExternalGraphic>
/

This means that if 'chosen-icon' is not provided, the default svg name is
read from icon (which in my case is a layer attribute). Instead of using a
layer attribuite, I would like to write there a static value for the
filename. Like: /xlink:href="${env('chosen-icon',
'disability_accessibility.svg')}"/. But this is not working.

Does anyone have any suggestions?

Thanks!

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

Hi,

what do you see in the log file (in verbose mode) with the static value ?

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

This solution actually works. In the original code I forgot to put the
default filename between quotes. Silly mistake!

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html