Hi Carlos,
That's a good point to have a FeatureLayers property on the LayerOverlay. And I might misunderstand that you want a Open and QueryTools on the LayerOverlay directly. Please assume we have a FeatureLayers, then there are one Layers property and one FeatureLayers property which might confuse other users. They might think what is this new property doing. What if we use LayerOverlay.FeatureLayers.Add; we also can remove the Add method you know; but it is weird. As I think, the better idea to do extent the layers collection and do the querying.
Please copy the attached file to your project and use the code below to satisfy your requirement. Please choose any one of the following method. If it works fine, you can try to add any method you need in this extension.
layerOverlay.Layers.OfType<featurelayer>().GetAllFeatures(ReturningColumnsType.AllColumns);
layerOverlay.Layers.GetAllFeatures(ReturningColumnsType.AllColumns);
About the constructor; as you see, Feature is actually a structure and everything should be immutable; so there isn't a set property for the Id. I know there might be some structure pattern we didn't follow, but we need to do it like this for some reasons. I checked our API again and find there is only the constructors which accepts BaseShape doesn't have an id parameter. And we need keep the same Id for both BaseShape and Feature. So if you want to set the id of the Feature object and also have a BaseShape, please set id for the BaseShape instead. If we work as you mentioned, when we create the Feature with both BaseShape and Id, the id of the BaseShape parameter will be also changed and we cannot be sure if there is any side effects. Hope it makes sense.
BTW, it’s a part-time job for me on the forum temporary. So I will reply them when I’m online. There also be some guys during day time around. So just feel free to let us know if you have any queries.
Thanks,
Howard
</featurelayer>
FeatureLayerExtension.cs.txt (1.16 KB)