Thanks for feedback.
here is my code,which will give you an idea about what i am doing.
private void graphicalselection_icon_Click(object sender, EventArgs e)
{
if (selectedOrder == -1)
MessageBox.Show("First Select Appropriate Layer");
else
{
filename1 = themeview1.Items[selectedOrder].ShapeName;
}
graphicalselection_icon.Checked = !graphicalselection_icon.Checked;
if (graphicalselection_icon.Checked == true)
{
//Using the rectangle from TrackOverlay to do the spatial query
winformsMap1.TrackOverlay.TrackMode = TrackMode.Rectangle;
//Event for getting the rectangle shape at the end of tracking the rectangle on the map.
winformsMap1.TrackOverlay.TrackEnded += new EventHandler<TrackEndedTrackInteractiveOverlayEventArgs>(winformsMap1_TrackEnded);
//InMemoryfeatureLayer to show the selected features is polygon from the spatial query.
InMemoryFeatureLayer spatialQueryResultLayer = new InMemoryFeatureLayer();
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(GeoColor.FromArgb(200, GeoColor.SimpleColors.Gold)));
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.Red;
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//InMemoryfeatureLayer to show the selected features is line from the spatial query.
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.FromArgb(150, GeoColor.StandardColors.Red), 10, true);
//spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColor.StandardColors.Red;
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//InMemoryfeatureLayer to show the selected features is point from the spatial query.
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = new PointStyle();
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle .SymbolPen .Color =GeoColor.StandardColors.Red;
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle .SymbolSolidBrush .Color =GeoColor.StandardColors.Red ;
spatialQueryResultLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// LayerOverlay spatialQueryResultOverlay = new LayerOverlay();
spatialQueryResultOverlay.Layers.Add("SpatialQueryResultLayer", spatialQueryResultLayer);
winformsMap1.Overlays.Add("SpatialQueryResultOverlay", spatialQueryResultOverlay);
winformsMap1.Refresh();
}
}
void winformsMap1_TrackEnded(object sender, TrackEndedTrackInteractiveOverlayEventArgs e)
{
RectangleShape rectangleShape = (RectangleShape)e.TrackShape;
Collection<string> featureFilenames = new Collection<string>();
ShapeFileFeatureLayer worldLayer = (ShapeFileFeatureLayer)winformsMap1.FindFeatureLayer(themeview1.Items[selectedOrder].ShapeName);
InMemoryFeatureLayer spatialQueryResultLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer("SpatialQueryResultLayer");
//Spatial query to find the features intersecting the rectangle from the track rectangle.
Collection<Feature> spatialQueryResults;
worldLayer.Open();
spatialQueryResults = worldLayer.QueryTools.GetFeaturesIntersecting(rectangleShape, ReturningColumnsType.NoColumns);
worldLayer.Close();
//Adds the selected features to the InMemoryfeatureLayer
spatialQueryResultLayer.Open();
spatialQueryResultLayer.EditTools.BeginTransaction();
spatialQueryResultLayer.InternalFeatures.Clear();
foreach (Feature feature in spatialQueryResults)
{
spatialQueryResultLayer.EditTools.Add(feature);
}
spatialQueryResultLayer.EditTools.CommitTransaction();
spatialQueryResultLayer.Close();
//Refreshes the layers to show new result.
winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear();
winformsMap1.Refresh(winformsMap1.TrackOverlay);
winformsMap1.Refresh(winformsMap1.Overlays["SpatialQueryResultOverlay"]);
}
in this code when i draw rectangle the intersecting features (can be area,linestyle,point) get highlighted...now i want to perform operation (like zoom in,zoom out ) on that highlighted feature when i click on button.(i.e feature other than highlighted feature should not have zoom effect i.e the surrounding unhightlighted regions should remain as they are..)