About MapPointLayer!!!

Nov 16, 2010 at 2:30 AM

hi all,

after i create several point in MapPointLayer,i want to delete some point from MapPointLayer how can i do ?

the other word,how to show label ?i do like this ,but it dosen't work!

private void CreateMapPoints()
        {

            double[,] points = { { 22.516641, 113.5481 },{22.15181,114.002811},{22.15846,114.025186},{22.42215,114.121542} };
            
            FeatureSet fs = new FeatureSet(MapWindow.Geometries.FeatureTypes.Point);
            MapPointLayer pointLayer = new MapPointLayer(fs);
            pointLayer.Symbolizer = new PointSymbolizer(Color.Yellow,PointShapes.Star,32);
            pointLayer.Symbolizer.SetOutline(Color.Black, 1);

            for (int i = 0; i < points.Length / points.Rank; i++)
            {
                double pointX = points[i, 1];
                double pointY = points[i, 0];
                MapWindow.Geometries.Coordinate coordinate = new MapWindow.Geometries.Coordinate(pointX, pointY);
                fs.AddFeature(new MapPoint(coordinate));
            }

            MapLabelLayer labelLayer = new MapLabelLayer();
            ILabelCategory labelCategory = labelLayer.Symbology.Categories[0];
            labelCategory.Expression = "Test";
            labelCategory.Symbolizer.BackColorEnabled = true;
            labelCategory.Symbolizer.BorderColor = Color.FromArgb(128, Color.LightBlue);
            labelCategory.Symbolizer.OffsetX = (float)32.00;
            labelCategory.Symbolizer.OffsetY = (float)16.00;
            labelCategory.Symbolizer.BorderVisible = true;
            labelCategory.Symbolizer.BorderColor = Color.Black;
            labelCategory.Symbolizer.Orientation = ContentAlignment.MiddleCenter;
            pointLayer.ShowLabels = true;
            pointLayer.LabelLayer = labelLayer;

            myMap.MapFrame.DrawingLayers.Add(pointLayer);
            myMap.MapFrame.Invalidate();
            
        }

Thanks and regards,