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.
Solved! Go to Solution.
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! 🙂
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.
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! 🙂
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.