예제 #1
0
        /// <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;*/
        }
예제 #2
0
 internal MyLayer(MyGrid grid)
 {
     layerName = grid.Name;
     dataType  = MySpaceDataType.MyGrid;
     spaceData = new MySpaceData(grid);
     Visible   = true;
     filepath  = grid.FilePath;
 }
예제 #3
0
 /// <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;
 }
예제 #4
0
 /// <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;
 }