Select to view content in your preferred language

LegendInfo should have Name when created from SubtypeSublayers

207
0
05-09-2023 10:14 AM
JoeHershman
MVP Regular Contributor

We are wanting to change some offline WebMaps to use SubtypeFeatureLayer.  A main driver behind this is that it allows us to edit domains in AGOL.  It also is a better general fit with the Utility Network configuration.

A big issue making this much more complex is that when you retrieve the LegendInfo objects from SubtypeSublayer these do not have a Name associated to them.  There is no way to identify what a LegendInfo is.  This seems to me to be a bit of a bug, as there is no way to identify what a LegendInfo is unless you somehow know what SubtypeSublayer it was created from.  But it makes it impossible to use the code which already assumed the LegendInfo would have an associated Name (matching the Subtype).

Making this issue even more difficult is that LegendInfo is a sealed class.  So it is not even possible to make a subclass and assign a Name that way.

This has made, what seemed to me should be a trivial operation into a really complex refactoring because there is no way to pass along the IReadOnly<LegendInfo> collection as the previous code did.

This is using Runtime 100.15

Thanks,
-Joe
0 Kudos
0 Replies