When defining the sublayer collection of a MapImageLayer using a MapService in which sublayer default visibility is false, the MapImageLayer ignores the visible parameter defined in the constructuror.
Example: all layers in the MapService have a default visibility of false. MapImageLayer defined with two sublayers set to visible:true. SubLayer visible param is ignored. Uncomment the zoningLayer.when() function, which explicitly sets sublayer visibility, layer draws.
JS Bin - Collaborative JavaScript Debugging
Example two: Again, MapImageLayer with two sublayers. One sublayer with default visibility false in the MapService, the other with default visibility true in the map service. One sublayer draws, the other does not.
JS Bin - Collaborative JavaScript Debugging
Is this the expected behaviour? Seems to me that if visibility is defined as true in the constructor, the sublayer should render on load without the extra step of setting visibility on load. Otherwise, why define visibility in the constructor?
Solved! Go to Solution.
Derek,
the MapImagerLayer property is sublayers NOT subLayers.
So it is. Thank you, Robert. That takes care of it.