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
2024-09-20 11:28:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6f1fef286870158389aad954d8be5f7d23aa086e
6f1fef28
1 parent
b72866cb
fix 工具地图新增复制坐标功能
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
src/views/tools.vue
src/views/tools.vue
View file @
6f1fef2
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-0
8-07 09:54:06
* @LastEditTime: 2024-0
9-20 11:23:33
* @FilePath: /map-demo/src/views/tools.vue
* @Description: 公众地图主体页面
-->
...
...
@@ -18,8 +18,8 @@
<van-button @click="setRotationPlus()" type="default" block size="small" style="width: 10rem; margin-left: 1rem;">旋转+10</van-button>
设置<van-field v-model="data_rotation" label="" placeholder="请输入旋转值" style="width: 3.5rem;" @blur="setRotation()" />度
</div>
<div v-if="log_lnglat" style="position: fixed; top: 5rem; left: 1rem; color: black;">
<div style="
display: flex;">点击经纬度:{{ log_lnglat }}
</div>
<div v-if="log_lnglat" style="position: fixed; top: 5rem; left: 1rem; color: black;
background-color: white; padding: 1rem;
">
<div style="
display: flex; align-items: center; justify-content: center;">经纬度:{{ log_lnglat }} <van-button @click="copyText(log_lnglat)" type="primary" icon="brush-o" size="small">复制</van-button>
</div>
</div>
<!-- <div class="nav-bar-wrapper">
<div class="hideScrollBar nav-bar-content">
...
...
@@ -125,6 +125,7 @@ import audioBackground from '@/components/audioBackground'
import { useRect } from '@vant/use';
import { mapAPI } from '@/api/map.js'
import wx from 'weixin-js-sdk'
import { showToast } from 'vant';
const GPS = {
PI: 3.14159265358979324,
...
...
@@ -955,7 +956,7 @@ export default {
e.lnglat.getLng() +
"," +
e.lnglat.getLat() +
"]
,
"
"]"
console.log(text);
this.log_lnglat = text;
// 点击空白处 关闭弹框
...
...
@@ -1225,7 +1226,17 @@ export default {
},
setRotation () {
this.map.setRotation(+this.data_rotation);
}
},
copyText (text) {
navigator.clipboard.writeText(text)
.then(() => {
showToast('复制成功');
})
.catch(err => {
showToast('复制失败');
console.error('复制失败:', err);
});
},
}
}
</script>
...
...
Please
register
or
login
to post a comment