Closed gertgeringer closed 7 years ago
You can just treat each sub layer as its own collection of features. In the following example, CoarseCounty and DetailedCounty seem to have the same attributes. In this case, you can make them into one County class.
var service = new Service(
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer");
foreach (var coarseCounty in service.Download<CoarseCounty>("Coarse Counties"))
{
Console.WriteLine(coarseCounty.OID);
}
foreach (var detailedCounty in service.Download<DetailedCounty>("Detailed Counties"))
{
Console.WriteLine(detailedCounty.OID);
}
Thanks for your reply Jiro,
That would work if the service you are working with is constan., In my case the service is dynamic (the user enters a service url). So I have decided just to parse the json using a normal http request, and extract the layer hierarchy from there.
Regards
Hi Jiro,
Thanks for this useful client.
I went through the documentation and did not see any functionality relating to parent and sub-layer feature of AGS. Am I missing something?
For example, counties is the parent layer and Coarse Counties and Detailed Counties the sub layers.
Thanks