public static List <Geometry.Vector> buildgrid(Extents extents) { // 测试代码 // ga.buildgrid(mc.MapExtents) //var parcels = DocumentManager.CurrentMap.Layers["地块"].Features.Select(f=>new Geometry.Polygon(f.GeoData)).ToList(); grid = extents.GetGrid(cellsize); //.Where(p => parcels.Any(x => x.IsPointIn(p))).ToList(); _layer = new VectorLayer("grid", VectorLayer.GEOTYPE_REGION); grid.ForEach(p => _layer.Features.Add(getcellfeature(p))); MapControl.Current.GridLayer.SetData(_layer); return(grid); }