Possible to un-deprecate AGSFeatureLayer init?

346
3
Jump to solution
02-07-2020 04:41 PM
MichaelDavis3
Occasional Contributor III

It is possible to keep the init function for AGSFeatureLayer around?  Or baring that, is there an actual time line to remove it?

I find creating empty AGSFeatureLayers to be occasionally useful when I need to do some fancy footwork with "behind the scenes" data layers that I don't want exposed to the app user.  I know that's not probably a super valid use case but it has come in super handy on a couple of occasions.  

0 Kudos
1 Solution

Accepted Solutions
MichaelDavis3
Occasional Contributor III

Like I said, it might not be a particularly valid use case but here's an example:

We have a construction monitoring app for a large port construction project.  This includes a huge number of map layers for each utility, layout, basemap, etc...  Rather than present them with a giant layer list to manage we present a table of contents with "fake" AGSFeatureLayers that we might name "Potable Water" or "Topo".  When users tap on a layer we might toggle a whole group on/off but also might re-set some definition queries or kick off other activity.

As I'm typing this I've just discovered that AGSGroupLayer is a thing and has been since 100.5.  This looks like it might do 90% of what we are looking for.... so never mind --- cary on! 🙂

View solution in original post

3 Replies
Nicholas-Furness
Esri Regular Contributor

Can you explain a little more how you're using it this way that makes it useful for you? Not sure I follow.

Thanks!

Nick.

0 Kudos
MichaelDavis3
Occasional Contributor III

Like I said, it might not be a particularly valid use case but here's an example:

We have a construction monitoring app for a large port construction project.  This includes a huge number of map layers for each utility, layout, basemap, etc...  Rather than present them with a giant layer list to manage we present a table of contents with "fake" AGSFeatureLayers that we might name "Potable Water" or "Topo".  When users tap on a layer we might toggle a whole group on/off but also might re-set some definition queries or kick off other activity.

As I'm typing this I've just discovered that AGSGroupLayer is a thing and has been since 100.5.  This looks like it might do 90% of what we are looking for.... so never mind --- cary on! 🙂

Nicholas-Furness
Esri Regular Contributor

Reading your response I was going to suggest Group Layers (or else using Feature Collection Layers as your placeholders). I think Group Layer is your friend here.

Note also the new AGSSubtypeFeatureLayer that was released with 100.7. That's very helpful where you have a single feature service layer with multiple subtypes that you want to treat separately. It's conceptually like an automated group layer: It'll give you a sub-layer per subtype, but is smart about how it queries back to the server when it needs to get data for those sub-layers.

0 Kudos