Closed Zodiase closed 6 years ago
From my understanding of the purpose of the legend, it'd be better to be somewhere in the map so it's easier to compare the color ramp with the color on the map.
We also need to add a scale (also part of the feedback) at some point. I think they can stay fairly close together and look something like what Google Map has.
Openlayers dynamic scale line example: https://openlayers.org/en/latest/examples/scale-line.html
Pixel-wise operation for re-coloring. https://openlayers.org/en/latest/examples/raster.html
Added a static legend (hard-coded) as an overlay on the map:
@jterstriep Does the legend change over different bands?
A temporary solution implemented on dev branch https://github.com/openskope/skope-interface/tree/add-overlay-legend. Its Docker image is available to be pulled as openskope/webapp:add-overlay-legend
.
This solution only works for wms overlays as it assumes the format of a wms url and extracts the layer name from it. It then builds the legend url from the layer name.
GeoServer reference: http://docs.geoserver.org/latest/en/user/services/wms/get_legend_graphic/index.html
@jterstriep The implementation is not merged to master since it heavily relies on the wms url structure. Do you want to put the legend url in the ES documents, or just ship this?
Geoserver should be able to generate the legend. I'll have to experiment to get the specific request.
We'll need to determine the exact design and where it will be located. It seems like it should be near the variable name, on the map, or just below the map.