Solved! Go to Solution.
It worked.
What happened is that the TOC window is small for 3 map services(each has a lot of layers) I have to make all the layers not show in the toc windows, this way there is enough room to show the 3rd map service. Do you know where can make the layers not show in the TOC windows by default?
thanks
zhujing
>>> Ken Buja <geonet@esri.com> 9/26/2014 9:51 AM >>>
Ken Buja replied to the discussion
"NLiu's Table of Contents(TOC)/Legend widget and Visibility States"
To view the discussion, visit: https://community.esri.com/message/425287?et=watches.email.thread#425287
In your layerInfo, you can set the collapsed to true. You'll have to turn off the visibility of the layers in one or more of the services to collapse them.
Also, have you thought of putting the TOC in a container that can scroll?
Oh Ya, could you let me know how to make the TOC container scroll?
>>> Ken Buja <geonet@esri.com> 9/26/2014 11:22 AM >>>
Ken Buja replied to the discussion
"NLiu's Table of Contents(TOC)/Legend widget and Visibility States"
To view the discussion, visit: https://community.esri.com/message/425370?et=watches.email.thread#425370
Ken,
Could you point out more detail about where I i should set up this layerinfo? is that in the TOC.js file?
zhujing
>>> Ken Buja <geonet@esri.com> 9/26/2014 11:22 AM >>>
Ken Buja replied to the discussion
"NLiu's Table of Contents(TOC)/Legend widget and Visibility States"
To view the discussion, visit: https://community.esri.com/message/425370?et=watches.email.thread#425370
My previous post has a link to the layerInfo documentation. You apply it when you instantiate the TOC. See the Fiddle I have set up in the other previous post.
Is there a way to use identifyTask with Nliu,s TOC for multiple map services? Is there a way to know which map service it is using for identify? I could hard code to let it know which map service is going to use, but like to see is there a way to know which map service going to use from the map or TOC automaticall?
identifyParameters.layerIds = dynamicMapServiceLayer.visibleLayers;
var identifyServer = cfg_identifyServerURL.checkAppendToken();
var identifyTask = new IdentifyTask(identifyServer);
Nliu,
I used your toc widget for 4 map services, When do the identify I could assign only one map service with
identifyParameters.layerIds = dynamicMapServiceLayer.visibleLayers;
Is that possible to know the map service automatically based on the user clicked on the map?
Thanks
Zhujing