Showing
1 changed file
with
17 additions
and
15 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-01-22 11:40:12 | 2 | * @Date: 2025-01-22 11:40:12 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-02-26 17:41:37 | 4 | + * @LastEditTime: 2025-02-27 09:25:30 |
| 5 | * @FilePath: /map-demo/src/views/mapCutter.vue | 5 | * @FilePath: /map-demo/src/views/mapCutter.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -25,17 +25,6 @@ | ... | @@ -25,17 +25,6 @@ |
| 25 | @blur="onCenterBlur" | 25 | @blur="onCenterBlur" |
| 26 | /> | 26 | /> |
| 27 | </div> | 27 | </div> |
| 28 | - <div style="display: flex; align-items: center;"> | ||
| 29 | - <div>地图层级: </div> | ||
| 30 | - <el-select v-model="map_zoom" placeholder="地图层级" style="width: 80px" @change="onZoomChange"> | ||
| 31 | - <el-option | ||
| 32 | - v-for="item in zoom_options" | ||
| 33 | - :key="item.value" | ||
| 34 | - :label="item.label" | ||
| 35 | - :value="item.value" | ||
| 36 | - /> | ||
| 37 | - </el-select> | ||
| 38 | - </div> | ||
| 39 | 28 | ||
| 40 | <div style="display: flex; align-items: center;"> | 29 | <div style="display: flex; align-items: center;"> |
| 41 | <div>上传图片左下角坐标: </div> | 30 | <div>上传图片左下角坐标: </div> |
| ... | @@ -61,6 +50,19 @@ | ... | @@ -61,6 +50,19 @@ |
| 61 | > | 50 | > |
| 62 | </el-input> --> | 51 | </el-input> --> |
| 63 | </div> | 52 | </div> |
| 53 | + | ||
| 54 | + <div style="display: flex; align-items: center;"> | ||
| 55 | + <div>地图层级: </div> | ||
| 56 | + <el-select v-model="map_zoom" placeholder="地图层级" style="width: 80px" @change="onZoomChange"> | ||
| 57 | + <el-option | ||
| 58 | + v-for="item in zoom_options" | ||
| 59 | + :key="item.value" | ||
| 60 | + :label="item.label" | ||
| 61 | + :value="item.value" | ||
| 62 | + /> | ||
| 63 | + </el-select> | ||
| 64 | + </div> | ||
| 65 | + | ||
| 64 | <div v-if="showUpload"> | 66 | <div v-if="showUpload"> |
| 65 | <!-- 触发上传按钮 --> | 67 | <!-- 触发上传按钮 --> |
| 66 | <el-button type="primary" @click="triggerFileInput">上传图片</el-button> | 68 | <el-button type="primary" @click="triggerFileInput">上传图片</el-button> |
| ... | @@ -203,12 +205,12 @@ const handleKeydown = (e) => { // 键盘控制 | ... | @@ -203,12 +205,12 @@ const handleKeydown = (e) => { // 键盘控制 |
| 203 | } | 205 | } |
| 204 | 206 | ||
| 205 | onMounted(async () => { | 207 | onMounted(async () => { |
| 206 | - loadMap(); | ||
| 207 | - window.addEventListener('keydown', handleKeydown) | ||
| 208 | // 地图中心点 | 208 | // 地图中心点 |
| 209 | const code = $route.query.id; | 209 | const code = $route.query.id; |
| 210 | const { data } = await mapAPI({ i: code }); | 210 | const { data } = await mapAPI({ i: code }); |
| 211 | map_center.value = data.map.center.map(item => Number(item)); | 211 | map_center.value = data.map.center.map(item => Number(item)); |
| 212 | + loadMap(); | ||
| 213 | + window.addEventListener('keydown', handleKeydown) | ||
| 212 | }); | 214 | }); |
| 213 | 215 | ||
| 214 | onBeforeUnmount(() => { | 216 | onBeforeUnmount(() => { |
| ... | @@ -364,7 +366,7 @@ function cutTiles() { | ... | @@ -364,7 +366,7 @@ function cutTiles() { |
| 364 | 366 | ||
| 365 | // ✅ 1. 位置移动 | 367 | // ✅ 1. 位置移动 |
| 366 | const moveImage = (direction) => { | 368 | const moveImage = (direction) => { |
| 367 | -const offset = 0.0001; // 移动步长(经纬度差值) | 369 | +const offset = 0.000002; // 移动步长(经纬度差值) |
| 368 | const sw = bounds.value.getSouthWest(); | 370 | const sw = bounds.value.getSouthWest(); |
| 369 | const ne = bounds.value.getNorthEast(); | 371 | const ne = bounds.value.getNorthEast(); |
| 370 | 372 | ... | ... |
-
Please register or login to post a comment