| | |
| | | ServletServerHttpResponse ssRes = new ServletServerHttpResponse(res); |
| | | |
| | | // 检查缓存是否过期 |
| | | // if (checkIfNotModify(ssReq, ssRes)) { |
| | | // // 设置缓存头 |
| | | // setBrowerCache(ssRes); |
| | | // return; |
| | | // } |
| | | if (checkIfNotModify(ssReq, ssRes)) { |
| | | // 设置缓存头 |
| | | setBrowerCache(ssRes); |
| | | return; |
| | | } |
| | | |
| | | // 设置返回图片类型 |
| | | res.setContentType("image/png"); |
| | |
| | | // 定义输入流,通过输入流读取文件内容 |
| | | FileInputStream fileInputStream; |
| | | |
| | | // y = (1 << z) - y - 1 |
| | | y = (int) Math.pow(2, z) - y - 1; |
| | | String path = config.getTilePath() + File.separator + layer + File.separator + z + File.separator + x + File.separator + y + ".png"; |
| | | // 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"; |
| | | |
| | | File file = new File(path); |
| | | if (!file.exists() || file.isDirectory()) { |