/// <summary> /// 基于文件路径的构造函数 /// </summary> internal MyLayer(string layerpath) { if (Path.GetExtension(layerpath) == ".shp") { Shapefile shp = new Shapefile(layerpath); layerName = shp.Name; dataType = shp.DataType; spaceData = new MySpaceData(shp); renderer = new SimpleRenderer(dataType); rendertype = RendererType.SimpleRenderer; hastext = false; Visible = true; filepath = shp.FilePath; } else { CosmosGisVector cgv = new CosmosGisVector(layerpath); layerName = cgv.Name; dataType = cgv.SpaceDataType; spaceData = new MySpaceData(cgv); renderer = new SimpleRenderer(dataType); rendertype = RendererType.SimpleRenderer; hastext = false; Visible = true; filepath = cgv.FilePath; } /*///TODO * spaceData = new MySpaceData(""); * layerName = Path.GetFileNameWithoutExtension(fileName); * dataType = spaceData.DataType; * this.Visible = true;*/ }
internal MyLayer(MyGrid grid) { layerName = grid.Name; dataType = MySpaceDataType.MyGrid; spaceData = new MySpaceData(grid); Visible = true; filepath = grid.FilePath; }
/// <summary> /// 基于CosmosGisVector的构造函数 /// </summary> /// <param name="cgv">CosmosGisVector</param> internal MyLayer(CosmosGisVector cgv) { layerName = cgv.Name; dataType = cgv.SpaceDataType; spaceData = new MySpaceData(cgv); renderer = new SimpleRenderer(dataType); rendertype = RendererType.SimpleRenderer; hastext = false; Visible = true; filepath = cgv.FilePath; }
/// <summary> /// 基于Shapefile的构造函数 /// </summary> /// <param name="shp">Shapefile</param> internal MyLayer(Shapefile shp) { layerName = shp.Name; dataType = shp.DataType; spaceData = new MySpaceData(shp); renderer = new SimpleRenderer(dataType); rendertype = RendererType.SimpleRenderer; hastext = false; Visible = true; filepath = shp.FilePath; }