From b23156724c8f122a1b665c5179c04e5b499e9a34 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 19 十月 2023 12:38:29 +0800 Subject: [PATCH] 修改影像获取方法 --- ExportMap/cs/WebUtils.cs | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ExportMap/cs/WebUtils.cs b/ExportMap/cs/WebUtils.cs index 5721025..2a6d1ec 100644 --- a/ExportMap/cs/WebUtils.cs +++ b/ExportMap/cs/WebUtils.cs @@ -143,13 +143,13 @@ /// </summary> public static HttpResponseMessage GetTile(HttpRequestMessage Request, string path, int z, int x, int y) { - string basePath = Path.Combine(LFData, path); + string basePath = Path.Combine(LFData, path, z.ToString()); if (!Directory.Exists(basePath)) { - throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest, "璺緞涓嶅瓨鍦紒")); + throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound, "璺緞涓嶅瓨鍦紒")); } - string file = basePath + "\\" + z + "\\" + x + "\\" + y + ".png"; + string file = basePath + "\\" + x + "\\" + y + ".png"; if (!File.Exists(file)) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound, "鏂囦欢涓嶅瓨鍦紒")); @@ -163,13 +163,13 @@ /// </summary> public static HttpResponseMessage GetTile0(HttpRequestMessage Request, string path, int z, int x, int y) { - string basePath = Path.Combine(LFData, path); + string basePath = Path.Combine(LFData, path, z.ToString()); if (!Directory.Exists(basePath)) { - throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.BadRequest, "璺緞涓嶅瓨鍦紒")); + throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound, "璺緞涓嶅瓨鍦紒")); } - string file = basePath + "\\" + z + "\\" + x + "\\" + y + ".png"; + string file = basePath + "\\" + x + "\\" + y + ".png"; if (!File.Exists(file)) { return DownloadFile(EmptyPng, y + ".png", "image/png"); -- Gitblit v1.9.3