openskope / skope-interface

The new SKOPE web portal interface.
https://www.openskope.org
4 stars 2 forks source link

There needs to be a color ramp and legend shown on or just off the map. #135

Closed Zodiase closed 6 years ago

jterstriep commented 6 years ago

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.

Zodiase commented 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.

screen shot 2018-03-27 at 5 39 33 pm

Zodiase commented 6 years ago

Openlayers dynamic scale line example: https://openlayers.org/en/latest/examples/scale-line.html

Zodiase commented 6 years ago

Pixel-wise operation for re-coloring. https://openlayers.org/en/latest/examples/raster.html

Zodiase commented 6 years ago

Added a static legend (hard-coded) as an overlay on the map: image

@jterstriep Does the legend change over different bands?

Zodiase commented 6 years ago

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

Zodiase commented 6 years ago

@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?