This project has moved and is read-only. 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 7: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 9:16 AM
You must not perform ExecuteIntersectionQuery with an Envelope as an argument, use a Geometry (Point).
Apr 20, 2015 at 12:21 PM
Edited Apr 20, 2015 at 12:22 PM
Is it possible to write a sample code؟ I'm grateful, so I need it.
Apr 22, 2015 at 5:00 AM
please,help me