Hi Val,
I added more than one feature type to map, now I have road Layer, cities Layer and houses. When I click at house which is a point feature it should highlight closest house but sometimes it highlights closest road. My logic is as follows;
Step I : Foreach Layer in map find the closest feature and add to MemoryLayer1.
foreach (Layer curLayer in layerOverlay.Layers)
{
Collection<Feature> closestFeaturesI = myFeaturesource.GetFeaturesNearestTo( clickedPoint, NextGenProject.GeographyUnits, featureCount, returningColumnNames, bufferZone, NextGenProject.DistanceUnits);
foreach (Feature curFeature in closestFeatures)
{
myMemLayer.InternalFeatures.Add(curFeature);
}
}
Step II : Repeat the logic to find the closest feature in MemoryLayer1.
Collection<Feature> closestFeatures =myMemLayer.GetFeaturesNearestTo( clickedPoint, NextGenProject.GeographyUnits, featureCount, returningColumnNames, bufferZone, NextGenProject.DistanceUnits);
StepII : Highlight the first feature returned by Step II
HighlightLayer.Internalfeatures.add( closestFeatures[0] )
Is there an alternative way of doing this?
Thanks
Prava