Hexagon Geospatial
MENU

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 
Reply
Contributor
Posts: 37
Registered: ‎11-11-2015
Accepted Solution

Dynamic Styles in Geospatial Portal

[ Edited ]

We have created FeatureClass1 in both PSS1 and PSS2 data sources. When we apply dynamic Style for FeatureClass1 (see below code), it is applying for PSS1 -FeatureClass1 and PSS2 - FeatureClass1. How to register the dynamic style for a particular PSS Featue Class.

 

$GP.dynamicStyles.register({
    featureClassId: "FeatureClass1",
    default: function(feature) {
        return {
            "style": {
                "styles": [{
                        "type": 2,
                        "color": "#006400"
                    },
                    {
                        "type": 3,
                        "color": "#ff0000",
                    }
                ]
            },
            defaultStyleName: "none",
            styleType: "Intergraph.WebSolutions.Core.WebClient.Platform.Style.AreaStyle"
        }
    }
});
Technical Evangelist
Posts: 132
Registered: ‎08-05-2015

Re: Dynamic Styles in Geospatial Portal

Hi Rajesh,

 

this is a limitation of dynamic styles - it recognizes callbacks only by feature class ID.

 

In order to have different behavior for two feature classes you need to provide different IDs.

 

Best regards,

Piotr

Contributor
Posts: 37
Registered: ‎11-11-2015

Re: Dynamic Styles in Geospatial Portal

This dynamic styles event will work only within the session. In other words, it will not work for workspace level. Is this correct?

Highlighted
Technical Evangelist
Posts: 132
Registered: ‎08-05-2015

Re: Dynamic Styles in Geospatial Portal

It should be independent from workspace if it is registered on application startup - each time when features are drawn, the rendering engine looks for the dynamic styling handlers in order to apply them. So when the handler is registered, it should work for all the workspaces run in particular portal.

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.