I’m trying to load several kml files with more than 2000 placemarks each.
So far I was able to load it using yours modified KmlExtension sample and using custom styles, but I was not able to find a best way to open a popup window when user clicks on one particular point (icon).
I tried using Layer.QueryTools.GetFeaturesWithin inside MapClick event, but without success , because I have too many points close by.
Please advice for a best and efficient solution to find a feature which user clicked on, taking in consideration that I have several layers and many points closed by.
If you have a lot of points in your layer I would use the QueryTools.GetFeaturesNearestTo method passing in the point that the user clicked. By using this method you can specify the maximum number of items you want to return which I think will work well in your case.
That should be a feasible approach, is it still performing to slow? How long is it taking? Another possible option although I’m not sure exactly how this would work with KML is to build an InMemoryRTreeIndex on each layer as they may speed things up pretty quickly.
Here is some sample code on how to create an index on an InMemoryFeatureLayer that may port over to your layers pretty easily.