This project has moved. For the latest updates, please go here.

how can selected polygon by clicked?

Topics: SharpMap Project, SharpMap v0.9 / v1.x
Apr 19, 2015 at 6:42 AM
when i clicked to map, it selected a few polygon while i want to select one polygon clicked,how can select polygon that clicked on map ,pls help me
use code:
   SharpMap.Data.FeatureDataSet ds = new SharpMap.Data.FeatureDataSet();
     BoundingBox bbx = new SharpMap.Geometries.Point(Convert.ToDouble(x)-2, Convert.ToDouble(y)-2).GetBoundingBox().Grow(1);
        layWA_ParkAreas.DataSource.ExecuteIntersectionQuery(bbx, ds); //because I wrote this code in event "MapImage_MouseMove" so use WorldPos
        SharpMap.Layers.VectorLayer laySelected = new SharpMap.Layers.VectorLayer("Selection");
laySelected.DataSource = new SharpMap.Data.Providers.GeometryProvider(ds.Tables[0]);
            laySelected.Style.Fill = new System.Drawing.SolidBrush(System.Drawing.SystemColors.Highlight);
Apr 20, 2015 at 8:16 AM
You must not perform ExecuteIntersectionQuery with an Envelope as an argument, use a Geometry (Point).
Apr 20, 2015 at 11:21 AM
Edited Apr 20, 2015 at 11:22 AM
Is it possible to write a sample code؟ I'm grateful, so I need it.
Apr 22, 2015 at 4:00 AM
please,help me