In the following CSS styling:
* {
mark: url(smileyface.png);
mark-mime: "image/png";
mark-rotation: 45;
}
How can I make the URL value dynamic (to be read from a layer's field image_url
)?
I've tried the following:
* {
mark: url([image_url]);
mark-mime: "image/png";
mark-rotation: [rotation_angle];
}
But didn't work. The server console says:
WARN [renderer.style] - Unable to read image at file:/Applications/GeoServer.app/Contents/Java/data_dir/workspaces/tst/styles/%5Bdescription%5D : Can't get input stream from URL!
The auto-generated SLD is:
<sld:PointSymbolizer>
<sld:Graphic>
<sld:ExternalGraphic>
<sld:OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="[image_url]"/>
<sld:Format>image/png</sld:Format>
</sld:ExternalGraphic>
<sld:Rotation>
<ogc:PropertyName>rotation_angle</ogc:PropertyName>
</sld:Rotation>
</sld:Graphic>
</sld:PointSymbolizer>
Although the same works for mark-rotation.
mark: url(${image_url});
ormark: url('${image_url}');
?