Skip to content
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

Merged
merged 6 commits into from
Mar 26, 2016
Merged

Sub layer support #517

merged 6 commits into from
Mar 26, 2016

Conversation

AlexAThomas
Copy link
Contributor

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"}]
},

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
@tmcgee
Copy link
Member

tmcgee commented Mar 1, 2016

And thanks here too!

@tmcgee tmcgee added this to the v1.4.0 milestone Mar 5, 2016
@tmcgee
Copy link
Member

tmcgee commented Mar 5, 2016

@AlexAThomas Methods specific to the layerControl widget like _applyLayerControlOptions and _mixinLayerInfos should be within the widget not in the controller mixin, Can you refactor this PR to reflect that?

AlexThomasEOG and others added 2 commits March 7, 2016 20:12
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
@AlexAThomas
Copy link
Contributor Author

@tmcgee Changes made. The layers are already loaded by the time this widget is starting up, so I added a check for layer-loaded

@AlexAThomas
Copy link
Contributor Author

@tmcgee let me know if you see any other changes I ought to make

@AlexAThomas AlexAThomas reopened this Mar 26, 2016
@tmcgee tmcgee merged commit fc7e160 into cmv:develop Mar 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants