管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-09-07 8d7a67ab1d635cb954337d8a767878ae526dd3dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using ExportMap.cs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
 
namespace ExportMap.Controllers
{
    //[RoutePrefix("Web")]
    public class WebController : ApiController
    {
        // http://localhost/ExportMap/web/dem/layer.json
        [Route("web/{path}/layer.json")]
        [HttpGet]
        public string GetLayerJsonTest(string path)
        {
            return path + "/layer.json";
        }
 
        // http://localhost/ExportMap/web/dem/3/1/2.terrain
        [Route("web/{path}/{z}/{x}/{y}.terrain")]
        [HttpGet]
        public string GetTerrainTest(string path, int z, int x, int y)
        {
            return path + "/" + z + "/" + x + "/" + y + ".terrain";
        }
 
 
        /*[Route("api/order/{id:int=3}/ordertype")]
        [HttpGet]
        public IHttpActionResult GetById(int id)
        {
            return Ok<string>("Success" + id);
        }
 
        [AcceptVerbs("GET", "POST")]
        public IHttpActionResult GetById(int id)
        {
            return Ok<string>("Success" + id);
        }*/
 
 
        // http://localhost/ExportMap/terra/layer.json?path=3d/terrain/dem/t
        [Route("terra/layer.json")]
        [HttpGet]
        public HttpResponseMessage GetLayerJson([FromUri]string path)
        {
            return WebUtils.GetLayerJson(Request, path);
        }
 
        // http://localhost/ExportMap/terra/0/1/0.terrain?path=3d/terrain/dem/t
        [Route("terra/{z}/{x}/{y}.terrain")]
        [HttpGet]
        public HttpResponseMessage GetTerrain(int z, int x, int y, [FromUri]string path)
        {
            return WebUtils.GetTerrain(Request, path, z, x, y);
        }
 
        // http://localhost/ExportMap/terra0/layer.json?path=3d/terrain/dem/t
        [Route("terra0/layer.json")]
        [HttpGet]
        public HttpResponseMessage GetLayerJson0([FromUri]string path)
        {
            return WebUtils.GetLayerJson(Request, path);
        }
 
        // http://localhost/ExportMap/terra0/1/3/0.terrain?path=3d/terrain/dem/t
        [Route("terra0/{z}/{x}/{y}.terrain")]
        [HttpGet]
        public HttpResponseMessage GetTerrain0(int z, int x, int y, [FromUri]string path)
        {
            return WebUtils.GetTerrain0(Request, path, z, x, y);
        }
 
        // http://localhost/ExportMap/tile/18/213517/107112.png?path=2d/tiles/0102
        [Route("tile/{z}/{x}/{y}.png")]
        [HttpGet]
        public HttpResponseMessage GetTile(int z, int x, int y, [FromUri]string path)
        {
            return WebUtils.GetTile(Request, path, z, x, y);
        }
 
        // http://localhost/ExportMap/tile0/18/213517/107110.png?path=2d/tiles/0102
        [Route("tile0/{z}/{x}/{y}.png")]
        [HttpGet]
        public HttpResponseMessage GetTile0(int z, int x, int y, [FromUri]string path)
        {
            return WebUtils.GetTile0(Request, path, z, x, y);
        }
    }
}