Add Scale Dependencies to Web Map Popups

02-28-2018 08:10 AM
Status: Open
Occasional Contributor III

Yesterday, I had a webmap layer that was zoomed out and the features were small.  I did not want popups in that situation, but I did want the layer to be visible from the initial zoomed out state of our web application.  I would have liked to have a scale range where the popup would work on a given layer.  This would be a subset of the layer visibility range.  I don't need different popups at different scales.  I would just prefer not to have to duplicate layers to achieve the proper effect.  It's like scale dependent symbology in ArcGIS Pro.  It could be done with duplicate versions of layers in ArcMap, but it wasn't clean.

by Anonymous User

This would be very helpful. For example if you have a feature and you're zoomed far out and click, you get 1 of 1000 records. I have observed this is confusing for users. In fact, I use Robert's Identify anyway because users don't understand the 1 of XXX Features convention in the popup and the < > next/previous feature toggle. They just don't notice them for some reason.

Anyhow the other reason is if you zoom in, you don't want to click and get a popup for the entire state, or county. 

For example, I was requested to have the outline of our county on the property viewer map. SAGIS Property Map Viewer    However, now it triggers its popup on the County boundary.

Because I have programmatically set all popups to trigger in WAB DE. Sure I can go in and do some If, then thing to try to weed it out but it would be nice if it was simple. If we can have Scale Dependency for popups, just like for labels.   For now I set it to not draw past City scale, but still... if users are zoomed out to the county I wanted them to get the popup for one property. I accomplished this, by setting a second transparent parcel layer with a Max Record count of 1.  OK great. Only issue, is I was then requested to show the county boundary outline. So it's a "1 of 2 Features"  in the popup title now. Thankfully the property layer's feature takes precedence in popup order so I'll probably wait a while and see what Esri does here on this before going in further to see if I can remove the popup myself.   Thank you Esri for considering this.  

update::: at least for me, this alternative worked. I added the county boundary as its own service, then set its max record count to zero. Now, no popup.  Still, would be nice to have popup scale as a setting. For example if I had services in the web map not from my server.

I think this is a common pattern, that many folks here have set all popups to show using Robert's code block (thanks as always to Robert).  Because then if you bring in layers from Add Data they will have popups. Basically having all popups show all fields is a good 'default'. Ability then, to selectively turn off the handful of layers you perhaps do not want popups for, could be achieved with setting popup draw scale on a sublayer. (note it most be a sublayer not just a service, and that I'd be using this to effectively turn a popup 'off' even perhaps at any scale, and thus override the 'all popups on' code block as noted above).


This is such a good idea.  It seems like a logical next step to to be able to specify scale dependency for popups.  The workaround of duplicating the layer, setting scale dependency so that they switch visibility at a specific scale, with popups configured on the smaller scale layer works, but it's a bit clunky.  It doesn't feel like adding scale dependency to popups would be such a difficult thing to implement.

This idea is very similar/identical: