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
Occasional Contributor
Posts: 18
Registered: ‎11-07-2016

Geospatial Portal SDK and Seamlessly Adding WFS-T layers with Windows Authentication

Hi

 

I have a WFS-T service that is to have Windows Authentication to allow members of a specific user group access, without using HTTPS. I wish to open this WFS-T service with Javascript in the Geospatial Portal SDK (e.g. below).  What I would like to do is to be able to add the layer to the legend seamlessly without having anyone log in. The layers are to be turned off by default (shown in the code). If the user is not in the user group, then the legend item should not be added, or will give an error message if the user attempts to turn on a layer. Is this possible?

 

Thanks

 

 

//add FM_WFS service
$GP.legend.add({
	definitionName: "WFS",
	url: "http://" + g_strMapServerName + "/FM_WFS/service.svc/get?",
	id: "FM_WFS"}, 
	function (result) 
	{
		//turn off all layers in WFS
		result.ids.forEach(
			function (item) 
			{
				$GP.legend.find({
				id: item}, 
					function (result2) 
					{
						result2.legendItems[0].set_isVisible(false);
					}
				);
			}
	);