This project is read-only.

Can't select opearator

Aug 17, 2011 at 8:57 AM
When I call the following function, the point features can not be selecte.why???

 

private void MovePoints()
        {
            Random rnd = new Random();

            foreach (IFeature feature in _myPoints.Features)
            {
                // Or controlled in pixels with the help of the map
                Point pixelLocation = map1.ProjToPixel(feature.Coordinates[0]);

                // Control movement in terms of pixels
                int dx = Convert.ToInt32((rnd.NextDouble() - .5) * 50); // shift left or right 5 pixels
                int dy = Convert.ToInt32((rnd.NextDouble() - .5) * 50); // shift up or down 5 pixels
                pixelLocation.X = pixelLocation.X + dx;
                pixelLocation.Y = pixelLocation.Y + dy;

                // Convert the pixel motions back to geographic motions.
                Coordinate c = map1.PixelToProj(pixelLocation);
                feature.Coordinates[0] = c;
            }

            // Refresh the cached representation because we moved points around.
            map1.MapFrame.Invalidate();
            map1.Invalidate();
        }