I have a webmap with lots of layers, that I want to set the visibility range for. I don't want to deal with this in Pro, since publishing it back to Online takes a long time. I can't go through every layer's settings and change the range individually.
Is there a way to change the map's reference scale in ArcGIS Online or achieve what I want using the ArcGIS API for Python?
Solved! Go to Solution.
You could set the layers in a group layer in Map Viewer and use the group layer to define the visible scale range. Note this would then be for 4.x JSAPI apps that support group layers and runtime apps that also support group layers.
You could set the layers in a group layer in Map Viewer and use the group layer to define the visible scale range. Note this would then be for 4.x JSAPI apps that support group layers and runtime apps that also support group layers.
Set Visibility Range Python API:
Reinaldo.
Definitely a solution if my layers were contained within GroupLayers. But alas, adding Feature Services that have group layers in them to a webmap doesn't preserve this nesting structure. So I am left with a webmap with hundreds of broken down child layers, and no group layers.
I'm actually checking Python API to see if there's a method that allows me to programatically group together layers...
We are actually making a change to this tonight in the Online update where items with multiple layers will get grouped automatically.
Music to my ears! I've been dealing with this issue and trying to circumvent it by dealing with Python API and republishing from Pro.
Looking forward to the release!
This is out now. WHen you add the item to a map it will show the item title as the group layer name and then all the layers in the item listed below.
I see it and setting visibility ranges work! I'll accept your original post as solution. Any word on when nested layers will be implemented? If I have a feature layer with nested group layers, and I add them to the webmap, they still appear as one group layer.
So the feature layer wont contain any nesting or in the item yet when published from Pro but we did add nesting in Map Viewer this release. When a layer is in a group you can click Add to New group whci will create a new nested group or you can use the overflow actions on a group to Move to Group which will nest that group inside another group or drag and drop.
Great! Sounds like this update has a lot of long awaited features. I'll wait for the blog post with all the release notes. 🙂