| | |
| | | /// </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, "文件不存在!")); |
| | |
| | | /// </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"); |