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

Thematic Item window opening event



We have been asked to quickly estimate a customization effort, that basically needs to prefills the Thematic Item window in Geospatial Portal, with certain min, max and distinct values. We want to reuse the Thematic Item window, so that we do not have to redo the entire functionality, styling, drawing etc. However, in order to prefill fields, we need to know when the Thematic Item window is opened. We have been looking in the examples and API, but we cannot find anything related.


Is it possible, via the API, to register an event for this Thematic Item window opening?



New Contributor
Posts: 2
Registered: ‎03-15-2017

Re: Thematic Item window opening event

[ Edited ]

Hi there,

Once I needed to something like this, I hope it can help you.

See the example below:


//For you to be able to get the "MapContentCategorizedExt" you have to set the clientIdMode to Static of the element
//on the full.aspx page, or other page you are using, see example:
//this code is in my Full.aspx*******************
<wc_core:MapLegendControl runat="server" id="MapContentCategorized" MapStateId="map" Mode="Categorized" meta:resourcekey="Categories" ClientIdMode = "static" />


//Registering the "expandnode" event of the treeview,
//you can do this inside the $GP.ready(function () {})
$GP.ready(function() {
    Ext.getCmp('MapContentCategorizedExt').on('expandnode', function(a, b, c) {
        //Verify if it is a tematic root node, or if the node was already ajusted (a.moniker != undefined)
        if (!a.attributes.isThematicMap || a.moniker != undefined)

        //Iterate over the tematic items
        for (var i = 0; i < a.childNodes.length; i++) {
            //you can add as many properties as you need
            a.childNodes[i]["moniker"] = 'whatever';
            a.childNodes[i]["icon"] = 'whatever';
            a.childNodes[i]["metadate"] = 'whatever'