Heron already supports per-Layer pre-configured custom legends where the user
supplies a link to a legend image. This can be effected via the standard
OpenLayers 'metadata' config object within an OpenLayers Layer. See for example:
http://lib.heron-mc.org/heron/latest/examples/legendcustom . The parameters is
as follows:
["OpenLayers.Layer.WMS", "World Map",
"http://www2.demis.nl/WMS/wms.asp?WMS=WorldMap",
{layers: 'Coastlines', format: 'image/png' },
{ metadata: {
legend: {
// Use a fixed URL as legend
legendURL: 'legenda-t25raster.png',
hideInLegend: false
}
}
}
]
Custom legend configuration is however not yet possible for Layers defined in
a Heron Context XML file, such as used with the PDOK project (and pdokviewer
Heron app). The XSD and handling needs to be extended to support:
- the 'metadata' object
- the legend element and legendURL
Like:
<metadata>
<legend>
<legendURL>http://myserver.com/someimage.png</legendURL>
<hideInLegend>true|false</hideInLegend>
</legend>
</metadata>
In the future more elements will be added to the metadata element (e.g. WFS
params). Custom legends need to be available for raster layers: WMS, WMTS and
TMS.
Original issue reported on code.google.com by jus...@gmail.com on 18 Nov 2014 at 2:50
Original issue reported on code.google.com by
jus...@gmail.com
on 18 Nov 2014 at 2:50