layer list does not work when map service names are hidden
The layerlist with the new 1.1 viewer seems to have an issue. If i don't have a layer turned on by default in my site config and I have the hideOperationalMapServiceNames set to true I cannot turn layers on and off. Also when it is turned on end users have to check the map service name to get operational layers to display. from a usability standpoint this will defiantly confuse end users and we really don't want to have to turn on an operational layer by default just to get the functionality we are looking for. Is there anyway to have the map service checked but not have the operational layers turned on.
-
Hi Nick,
I cannot quite understand what the problem is. When I set hideOperationalMapServiceNames to true, I still can turn the layers off and on.
What that flag does is just to hide the operational map services from the layerlist treeview and flattens the children of MapService which are operational layers one level back.
I can see that if you turn off the visibility of map service in REST Manager and set hideOperationalMapServiceNames flag to true, you will not be able to turn on and off the layers. Is this your scenario or I didn't understand the problem?
Cheers
0 -
basically I have the map service set to visible but don't have any layers turned on by default so the map service (Top level) checkbox is not checked by default in the layer list. This is my list below /customer/servlet/servlet.FileDownload?file=00P6000000e88H5EAI
0 -
Thanks for clarifying that Nick,
I understand the problem now. The main problem here is that the visibility of Map Service overrides the visibility of the layers and not the functionality of hideOperationalMapServiceNames. Whether you hide a map service name or show it you need to turn on the Map Service before toggling the visibility of a layer.
I will create a ticket to deal with this scenario in our next release, in the meantime I cannot think of any workaround for this problem other than having at least on layer turned on. Another idea is that if you have access to your ArcGIS server, you might be able to add a dummy layer to your map service and in REST Manager turn that layer on but exclude it from layer list.
0 -
I was thinking about doing a work around similar to that. I was also contemplating creating a workflow that would run on load to turn the map service layer on. I was leaning toward the workflow option I am curious if the workflow would be a good work around so I can avoid having to mess around with adding layers.
0 -
I agree, I think workflow workaround is a lot cleaner. Just use the SetMapServiceVisibility activity and that's all you basically need.
0 -
The set map service visibility does not seem to work with the viewer. I have tested it with the debug tool and it is initializing on load but fails to change the map service visibilty. Is this workflow activity supported in the javascript viewer.
0 -
Hi Nick,
Yes, SetMapServiceVisibility activity is supported in GVH 1.1.
I just tested it by setting a map service with (id ="0") to either True or False, in debug and non-debug mode and it works fine.
Will you please put some log activities before and after your activity or post your workflow here so I could have a look?
Cheers
0 -
I am seeing 404 errors after this runs because the layers value is null. However the workflow runs just fine. I posted my workflow below and a link to the site as well.
http://maps.auburnwa.gov/publicHTML5/index.html
<Activity mc:Ignorable="sap" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="322,246" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client" xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client" xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core" xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi" xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi" xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting" xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow" xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=System.Core" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=mscorlib" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Sequence sap:VirtualizedContainerService.HintSize="282,206" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<gwa1:SetMapServiceVisibility Debug="True" sap:VirtualizedContainerService.HintSize="260,82" MapServiceId="6" Visible="True">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</gwa1:SetMapServiceVisibility>
</Sequence>
</Activity>0 -
Your workflow and your activity works fine, the only thing is missing is that when you modify the visibility of a map service via a workflow, it just does not modify the checkbox of the map service in the layer list.
If you notice however, after you run the workflow you'll need to click twice on map service's checkbox to turn it on (because it is already on , just not showing the checkbox as checked).
So, in your case if you set the hideOperationalMapServiceNames flag back to true, you should get your desirable behavior.
In terms of the viewer though this is a bug and needs to be fixed.
In more technical terms, layer list needs to listen to visibility changes from outside sources as well and not just from a user checking a checkbox inside the layer list.
0 -
Curious if this problem has been addressed in the html5 Viewer (currently using version 2.2.1)?
I am running into what appears to be the same problem.
When I set the visibility for a map service that is not included in the Layer List from a workflow to display - it is dynamically added to the legend but not to the list of layers. So the map service + layers do display on the map as desired but I would like the Layer List to update and show the Map Service + layers that were "turned on" via the workflow (like the legend behavior). Is this the "bug" referred in this thread? Or am I missing something?
Thanks
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
10 kommentarer