Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Posts: 31
Registered: ‎05-30-2016

Customising legend item options menu

[ Edited ]

For our current Geospatial Portal project, using Portal SDK, we need to be able to manipulate/customise the options menu for layers in the legend.


Currently the customer is not keen on the way the "Layers" tab arranges the layers, but at the same time the "Categories" tab options menu, for each layer, lacks the "Translucency" option.

I can't seem to find any suggestions that the option menu can be manipulated via the API or any examples on how to do it via customising files.

In short terms, what we need is to:


  1. Be able to add e.g. translucency to the legend item options menu in categories tab.
  2. Be able to hide unused legend item options menu items.

Could you please advice us on how we can achieve this?

Technical Evangelist
Posts: 1,405
Registered: ‎09-11-2015

Re: Customising legend item options menu

[ Edited ]

Hi Mikkel, have a look here:


You will probably need to utilize some control from ExtJS to display the transparency bar, or just make simpler version of it. The legend entry opacity is controled by LegendItem.set_opacity(value)



Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Posts: 31
Registered: ‎05-30-2016

Re: Customising legend item options menu

I have taken a look at the examples - thank you. However, one requirement is that this functionality would have to (or at least preferred to) be done without building/rebuilding sources as the current solution is "straight out of the box" only using the API from the SDK.

Is there a way around the serverside controls for the context menu? Are there any events that we could take advantage of, to override the default context menu being opened - so that we could show our own custom ExtJS menu?





P.S. Why is the transparency bar not present in the categories tab in the first place? Seems like it is the only one missing, comparing to the layers tab. It is also missing for analysis layers.