slms4redd / nfms-portal

NFMS web portal client
nfms4redd.org
GNU General Public License v3.0
0 stars 1 forks source link

Dynamic GetLegendGraphics #59

Closed Damianofds closed 9 years ago

Damianofds commented 9 years ago

Using a recent version of geoserver the GetLegend graphics can be localized.

Before adapt the client side code to support GetLegendGraphic localization (and remove the needs for manually create an image for each legend) below there is a useful Unred.js hack to use the legendGraphics in monolanguage portals :

substitute the line below (shouild be the line around 400)::

//table += '<td colspan="2" style="width:100%;background-color:white"><img src="static/loc/' + languageCode + '/images/' + layerConf.legend + '" /></td>';

with this

table += '<td colspan="2" style="width:100%;background-color:white"><img src="' + layerConf.bas eUrl + '?REQUEST=stg_geoserver/GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=20&HEIGHT=20&LAYER=' + layerConf. wmsName + '" /></td>';