implement get legend service, make it possible to return the legend and ...

...the htmlpopup in a callback