void LoadMap() { GeoStar.Core.SqliteDatabaseFactory fac = new GeoStar.Core.SqliteDatabaseFactory(); GeoStar.Core.ConnectProperties conn = new GeoStar.Core.ConnectProperties(); conn.Server = @"D:\02-Work\8888-GeoStarKernel\GPS\data"; GeoStar.Core.GeoDatabase gdb = fac.Open(conn); GeoStar.Core.TileClass tileclass = gdb.OpenTileClass("shenzhenImage") as GeoStar.Core.TileClass; GeoStar.Core.Control.WPF.TileClassGraphicsLayer tilelayer = new GeoStar.Core.Control.WPF.TileClassGraphicsLayer(tileclass); m_GeoSpace.LayerBox.AddLayer(tilelayer); }
void CacheTileClass(GeoStar.Core.TMSTileClass tms) { GeoStar.Core.ConnectProperties connn = new GeoStar.Core.ConnectProperties(); connn.Server = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TileCache"); if (!System.IO.Directory.Exists(connn.Server)) { System.IO.Directory.CreateDirectory(connn.Server); } GeoStar.Core.SqliteDatabaseFactory fac = new GeoStar.Core.SqliteDatabaseFactory(); GeoStar.Core.GeoDatabase gdb = fac.Open(connn); GeoStar.Core.TileClass tileclass = gdb.OpenTileClass(tms.Name) as GeoStar.Core.TileClass; if (null == tileclass) { tileclass = gdb.CreateTileClass(tms.Name, tms.SpatialReference, tms.Pyramid, tms.TileColumnInfo) as GeoStar.Core.TileClass; } tms.Cache = tileclass; }