Select to view content in your preferred language

Cannot identify clustered feature layer

220
7
Monday
LiveHus
Emerging Contributor

Hello

Using ArcGIS Maps SDK for .NET 200.7 and 8 I am having some issues with popups for clustered layers.

I am working with a few clustered layers in a web map from AGE 11.1. They are feature services added to a webmap where clustering and cluster popups are enabled. However, I am unable to display any of the popups for individual features in my client, only the aggregated features.

Is this known behaviour and is there a workaround for this?
Spiller inn 2025-09-01 162234.gif

0 Kudos
7 Replies
PreetiMaske
Esri Regular Contributor

If you have both aggregated geoelement and geoelements on the map you will have to tweak your identify code to account for displaying popup in both cases. Properties defined for AggregationFeatureReduction are independent of properties of FeatureLayer.

0 Kudos
LiveHus
Emerging Contributor

Thank you for the quick answer. The layer is published to my hosting server and added to my webmap through URL, feature popups and the aggregation  popups are all configured in te webmap settings for the layer. Based on your answer I assume its not possible to inherit both popup properties as the same time, and I need to tweak the identify code to display both. Do you have a sample code for this?

0 Kudos
LiveHus
Emerging Contributor

To be more precise: The code accounts for displaying both aggregate results and individual results. When identifying a single feature from the layer, there is no server request intercepted by IHttpMessageInterceptor when clicking individual feature

0 Kudos
PreetiMaske
Esri Regular Contributor

Yes, we have a great sample on popup viewer our .NET toolkit repo that does exactly what you want

https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/blob/main/src/Samples/Toolkit.SampleApp.WPF/S...

Just add another case for AggergateGeoElement after https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/blob/main/src/Samples/Toolkit.SampleApp.WPF/S...

```

if (popup.GeoElement is AggregateGeoElement aggregateGeoElement)
{
return new Popup(aggregateGeoElement, popup.PopupDefinition);
}

```

 

and that should do it. With code if you click on an indiviual feature or a cluster, popup will be displayed accordingly.

Hope this helps.

 

0 Kudos
BjørnarSundsbø1
Frequent Contributor

The code handles displaying popups for AggregateGeoElement or GeoElement. For those layer with only popup for individual features, the popup is displayed. For layers with feature reduction, we get the popup to display for the reduction and also to get information on the individual features as part of the reduction. However, when attempting to identify individual features (not aggregated) in the layer with aggregation, there is nothing. Not even a request to the feature layer to query the feature the user clicks on.

0 Kudos
BjørnarSundsbø1
Frequent Contributor

I've adapted a previous sample application and attached to this thread.

Web map has been configured as follows:

Triangles: represent features with individual popups.
Circles: have both individual popups and aggregate popups.

From the debug output, I get the following:

ArcGisRequestMessageInterceptor: Requested: https://services.arcgis.com/2JyTvMWQSnM2Vi8q/arcgis/rest/services/Individual_points/FeatureServer/0/query?f=json&objectIds=2&outFields=%2A&outSR=25833&returnDistinctValues=false&returnGeometry=true&returnM=true&returnZ=true
Total count: 1
Feature count: 1
ArcGisRequestMessageInterceptor: Requested: https://services.arcgis.com/2JyTvMWQSnM2Vi8q/arcgis/rest/services/Individual_points/FeatureServer/0/query?f=json&objectIds=4%2C2&outFields=%2A&outSR=25833&returnDistinctValues=false&returnGeometry=true&returnM=true&returnZ=true
Total count: 2
Feature count: 2
Total count: 0
Total count: 0
Total count: 1
Aggregate count: 1
Total count: 1
Aggregate count: 1

 

Line 1-3: Clicked individual triangle, ArcGisRequestMessageInterceptor hits breakpoints and logs a query against objectid 26.

Line 7-8: Clicking individual circle, with no request to server and no popup

Line 10-12: Identify result for aggregation/cluster

There is something odd happening when aggregation popup and individual popups are configured for a single layer. 

 

0 Kudos
PreetiMaske
Esri Regular Contributor

Thanks for the code, I guess you might be running into following issue, which we have identified as bug and plan to fix in Nov release.

https://community.esri.com/t5/net-maps-sdk-questions/issue-with-identifygraphicsoverlayasync-and/m-p...

The workaround is to not pass maximumresults parameter value. Please try removing that and let me know if this fixes the issue for you.

 

0 Kudos