-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sub layer support #517
Sub layer support #517
Conversation
These changes allow the user to have granular control over each subLayer in a dynamic Map service. Now, instead of having to just use the name of the layer in the map, you can override it to whatever you'd like. you can also redefine the min/max scale of the subLayer. see the layerInfo properties defined here: https://developers.arcgis.com/javascript/jsapi/layerinfo-amd.html In addition to the subLayerInfo support, i've added two other properties to the layerControlLayerInfos object. 1) subLayerInfos : array of layerInfos that should override the dynamic map service's default layerInfos 2) excludedLayers : an array of layer ids that should not be exposed in the map service 3) includeUnspecifiedLayers: boolean --> if true, then all layers in the dynamic map service will be added, not just the ones listed in subLayerInfos. the excludeLayers list will still be honored. layerControlLayerInfos: { //layerIds: [0, 2, 4, 5, 8, 9, 10, 12, 21] includeUnspecifiedLayers : true, excludedLayers : [1,3], subLayerInfos: [{id:0,name:"Layer 1",defaultVisibility:false},{id:2,name:"Layer 2"},{id:4,name:"Layer 3"},{id:5,name:"Layer 4"},{id:8,name:"Layer 5"},{id:9},{id:10},{id:12,name:"Layer 6"},{id:21,name:"Layer 7"}] },
reverted viewer.js
And thanks here too! |
@AlexAThomas Methods specific to the layerControl widget like |
This change caught some layers at a point where they were already loaded. As a result, we'll need to explicitly set the visibleLayers on the layer
@tmcgee Changes made. The layers are already loaded by the time this widget is starting up, so I added a check for layer-loaded |
@tmcgee let me know if you see any other changes I ought to make |
These changes allow the user to have granular control over each subLayer
in a dynamic Map service. Now, instead of having to just use the name
of the layer in the map, you can override it to whatever you'd like.
you can also redefine the min/max scale of the subLayer.
see the layerInfo properties defined here:
https://developers.arcgis.com/javascript/jsapi/layerinfo-amd.html
In addition to the subLayerInfo support, i've added two other properties
to the layerControlLayerInfos object.
map service's default layerInfos
the map service
dynamic map service will be added, not just the ones listed in
subLayerInfos. the excludeLayers list will still be honored.