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
Highlighted
Regular Contributor
Posts: 248
Registered: ‎05-01-2016

$GP.dynamicStyles.register problem workaround

This code (which uses only Hexagon data and services) doesn't work  - the requested style is not used when $GP.dynamicStyles.register is used with WMPS so the added feature displays in default black.  I think there is a workaround but i have not been able to get it to work.  I am using EP05 SDK for GM 2015 products with all updates applied.  Any help appreciated!  Thanks!

 

 

$GP.dynamicStyles.register({
	featureClassId : "USSample|Rivers",
	"default" : function (feature) {
		return {
			"style" : {
				"color" : "#f0a",
				"name" : "Rivers",
				"size" : 4,
				"translucency" : 0.8
			},
			defaultStyleName : "none",
			styleType : "Intergraph.WebSolutions.Core.WebClient.Platform.Style.SimpleLineStyle"
		};
	}
},
	function () {
	$GP.legend.add({
		url : "http://demo.hexagongeospatial.com/wmps/mapService.svc",
		definitionName : "MapPublisher",
		ids : ["USSample|Rivers"],
		applicationId : "DEMO_USA",
	});
});

 

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