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-26 09:55:03 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9a4d805e603cf45baec1f1f8e1ed8fb8953f33bb
9a4d805e
1 parent
d730ca12
fix 自动获取地图中心点
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
src/views/mapCutter.vue
src/views/mapCutter.vue
View file @
9a4d805
<!--
* @Date: 2025-01-22 11:40:12
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-02-2
0 16:10:07
* @LastEditTime: 2025-02-2
6 09:54:08
* @FilePath: /map-demo/src/views/mapCutter.vue
* @Description: 文件描述
-->
...
...
@@ -117,10 +117,15 @@
<script setup>
import { onMounted, ref, computed, onBeforeUnmount } from "vue";
import { useRoute, useRouter } from 'vue-router'
// import AMapLoader from "@amap/amap-jsapi-loader";
import { TileCutter } from "@/utils/TileCutter";
import { Top, Bottom, Back, Right, Plus, Minus, Brush } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import { mapAPI } from '@/api/map.js'
const $route = useRoute();
const $router = useRouter();
const map = ref(null);
const imageLayer = ref(null);
...
...
@@ -194,6 +199,10 @@ const handleKeydown = (e) => { // 键盘控制
onMounted(async () => {
loadMap();
window.addEventListener('keydown', handleKeydown)
// 地图中心点
const code = $route.query.id;
const { data } = await mapAPI({ i: code });
map_center.value = data.map.center.map(item => Number(item));
});
onBeforeUnmount(() => {
...
...
Please
register
or
login
to post a comment