| | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.config.PropertiesConfig; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @ApiImplicitParam(name = "y", value = "åå·", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("select/{token}/tile") |
| | | public void selectWmtsTile(@RequestParam("LAYER") String layer, @RequestParam("TILEMATRIX") Integer z, @RequestParam("TILEROW") Integer x, |
| | | @RequestParam("TILECOL") Integer y, @PathVariable(name = "token") String token, |
| | | HttpServletRequest req, HttpServletResponse res) { |
| | | public void selectWmtsTile(@PathVariable(name = "token") String token, HttpServletRequest req, HttpServletResponse res) { |
| | | try { |
| | | // ServletServerHttpRequest ssRequest = new ServletServerHttpRequest(request) |
| | | if (StringHelper.isEmpty(layer) || null == z || null == x || null == y) { |
| | | String layer = WebHelper.getReqParamVal(req, "layer"); |
| | | String matrix = WebHelper.getReqParamVal(req, "tilematrix"); |
| | | String row = WebHelper.getReqParamVal(req, "tilerow"); |
| | | String col = WebHelper.getReqParamVal(req, "tilecol"); |
| | | if (StringHelper.isEmpty(layer) || StringHelper.isEmpty(matrix) || StringHelper.isEmpty(layer) || StringHelper.isEmpty(row) || StringHelper.isEmpty(col)) { |
| | | return; |
| | | } |
| | | |
| | | int z = Integer.parseInt(matrix); |
| | | int x = Integer.parseInt(row); |
| | | int y = Integer.parseInt(col); |
| | | |
| | | ServletServerHttpRequest ssReq = new ServletServerHttpRequest(req); |
| | | ServletServerHttpResponse ssRes = new ServletServerHttpResponse(res); |
| | |
| | | |
| | | // y = (int) Math.pow(2, z) - y - 1; |
| | | String path = config.getTilePath() + File.separator + layer + File.separator + z + File.separator + y + File.separator + x + ".png"; |
| | | System.out.println(path); |
| | | |
| | | File file = new File(path); |
| | | if (!file.exists() || file.isDirectory()) { |