kartoza / least-cost-electrification-somaliland

0 stars 0 forks source link

Multiple legend entries for the same feature class #14

Closed vermeulendivan closed 3 years ago

vermeulendivan commented 3 years ago

Multiple legend entries for the same feature class. This happens because those classes displays at different scale. See below (those are the same features, but rules for different scales): image The same happens with the OSM roads map layer.

@meomancer I've been looking into a possible solution to this. There is a getlegendgraphics parameter named hideEmptyRules: hides rules that are not matching any feature. Applicable only if countMatched is true (from geoserver docs). I'm still unsure if this would resolve the issue, so can you replace the getLegendGraphics request with this one: https://somaliland.gep.kartoza.com/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image/png&WIDTH=20&HEIGHT=20&LAYER=geonode:somaliland_osm_waterways&STYLE=geonode_somaliland_osm_waterways&legend_options=fontAntiAliasing:true;fontSize:12;forceLabels:on;countMatched:true;hideEmptyRules:true&access_token=NudhtbRnlG7YyQ7FmdWwqbzjvr8HcJ Just want to see if works, have no other of testing atm.

NyakudyaA commented 3 years ago

@vermeulendivan Can you check if you can use an alternate getlegend graphic as we can do in QGIS Server instances legend-p

vermeulendivan commented 3 years ago

@NyakudyaA Cool, will have a look at that.

lkwalke4 commented 3 years ago

@vermeulendivan any update here?

vermeulendivan commented 3 years ago

@lkwalke4 Fixed. The same had to be done for osm roads, and had also been done. image