ExportMap/ExportMap.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/Models/SpatialItem.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/cs/SGUtils.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/db/SQLiteHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ExportMap/export.html | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ExportMap/ExportMap.csproj
@@ -152,6 +152,7 @@ <Compile Include="Models\ExportArgs.cs" /> <Compile Include="Models\ResponseMsg.cs" /> <Compile Include="Models\Secret.cs" /> <Compile Include="Models\SpatialItem.cs" /> <Compile Include="Models\SysMeta.cs" /> <Compile Include="Models\XYZArgs.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> ExportMap/Models/SpatialItem.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@ using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace ExportMap.Models { /// <summary> /// SGçç©ºé´æ°æ®é¡¹ /// </summary> public class SpatialItem { public SpatialItem() { } public int id { set; get; } public string Name { set; get; } public string RelativePath { set; get; } public string LayerName { set; get; } public int DataSourceId { set; get; } public string Description { set; get; } } } ExportMap/cs/SGUtils.cs
@@ -1,7 +1,9 @@ using ExportMap.Models; using ExportMap.db; using ExportMap.Models; using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Web; @@ -60,9 +62,40 @@ /// <returns>è¡æ°</returns> public static int Release(XYZArgs args) { List<SysMeta> list = XYZUtils.selectMetas(args.ids, "and type in ('mpt', '3dml')"); if (null == list || list.Count == 0) return 0; int maxId = GetMaxId(); List<SpatialItem> items = SelectItems(maxId); if (null == items || items.Count == 0) return 0; return 0; } /// <summary> /// è·åæå¤§IDå¼ /// </summary> public static int GetMaxId() { Object obj = SQLiteHelper.ExecuteScalar("select max(id) from SpatialItems"); return null == obj ? 0 : Convert.ToInt32(obj); } /// <summary> /// æ¥è¯¢SGæ°æ®é¡¹ /// </summary> /// <param name="maxId">æå¤§IDå¼</param> /// <returns>SGæ°æ®é¡¹</returns> public static List<SpatialItem> SelectItems(int maxId) { string sql = string.Format("select id, Name, RelativePath, LayerName, DataSourceId, Description from SpatialItems where id > {0} order by id desc", maxId); DataTable dt = SQLiteHelper.GetDataTable(sql); List<SpatialItem> list = ModelHandler.FillModel<SpatialItem>(dt); return list; } } } ExportMap/db/SQLiteHelper.cs
@@ -19,7 +19,7 @@ static SQLiteHelper() { //SQLiteHelper.DB = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\Community.db"); DB = Tool.GetSetting("db"); DB = Tool.GetSetting("sgDB"); } /// <summary> ExportMap/export.html
@@ -110,6 +110,15 @@ console.log(rs); }); } // æµè¯SG function toSG() { var data = { ids: [1523, 1525] }; ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) { alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); console.log(rs); }); } </script> </head> <body> @@ -129,5 +138,6 @@ <input type="button" value="æµè¯Rvt" onclick="convert1();" /> <input type="button" value="æµè¯Fbx" onclick="convert2();" /> <input type="button" value="æµè¯Ifc" onclick="convert3();" /> <input type="button" value="æµè¯SG" onclick="toSG();" /> </body> </html>