Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
map-demo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-02-08 15:10:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
96c11d153e5f9d6bc128f139ec81f6a62cec43a1
96c11d15
1 parent
33638272
fix 在 handleImageUpload 之前 清空 fileInput.value,这样每次选择文件时都会触发 change 事件
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
src/views/mapCutter.vue
src/views/mapCutter.vue
View file @
96c11d1
<!--
* @Date: 2025-01-22 11:40:12
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-02-08 1
4:42:00
* @LastEditTime: 2025-02-08 1
5:08:33
* @FilePath: /map-demo/src/views/mapCutter.vue
* @Description: 文件描述
-->
...
...
@@ -157,7 +157,6 @@ const triggerFileInput = () => {
};
const handleKeydown = (e) => { // 键盘控制
console.log(`按键: ${e.key}, Shift 是否按下: ${e.shiftKey}`) // 调试信息
if (e.shiftKey && e.key === '=') {
// 一些键盘可能需要 Shift 才能输入 `+`,但 `e.key` 实际上是 `=`
scaleImage(1.01)
...
...
@@ -261,6 +260,9 @@ function handleImageUpload(event) {
addImageToMap(imageURL.value);
};
reader.readAsDataURL(file);
// **解决问题:清空 input,让下次选择同一文件也能触发 change**
event.target.value = "";
}
async function addImageToMap(url) {
...
...
@@ -397,8 +399,10 @@ const onZoomChange = (value) => { // 调整地图图层
const onLBRangeBlur = () => {
const str = map_left_bottom_range.value;
if (map_left_bottom_range.value) {
const formattedArray = str?.split(',').map(Number);
map_left_bottom_range.value = formattedArray;
}
}
const onRTRangeBlur = () => {
const str = map_right_top_range.value;
...
...
Please
register
or
login
to post a comment