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-20 14:58:06 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
63ac3b49906e5c92fd5a48a1fed903fcb9bcec67
63ac3b49
1 parent
729af4c7
fix 建设没有设置也不报错,避免地图无法渲染
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
src/views/by/map.vue
src/views/by/map.vue
View file @
63ac3b4
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-02-
11 18:36:30
* @LastEditTime: 2025-02-
20 14:55:41
* @FilePath: /map-demo/src/views/by/map.vue
* @Description: 公众地图主体页面
-->
...
...
@@ -274,8 +274,8 @@ export default {
const { data } = await mapAPI({ i: code });
this.navBarList = data.list; // 底部导航条
this.mapTiles = data.level; // 获取图层
this.navKey = data.list
[0]['id']
; // 默认选中 第一个 id
this.navList = data.list.
filter(item => item.id === this.navKey)[0]['list'
]; // 返回默认选中项的实体信息
this.navKey = data.list
.length ? data.list[0]['id'] : 0
; // 默认选中 第一个 id
this.navList = data.list.
length ? data.list.filter(item => item.id === this.navKey)[0]['list'] : [
]; // 返回默认选中项的实体信息
this.data_center = data.map.center.map(item => Number(item)); // 地图中心点
this.data_zoom = data.map.zoom; // 地图默认缩放
this.data_rotation = data.map.rotation; // 地图旋转角度
...
...
@@ -382,7 +382,7 @@ export default {
// 添加地图点击事件
this.map.on("click", this.showInfoClick);
// 加载景点图层
this.loadMaker(this.navKey);
this.
navKey && this.
loadMaker(this.navKey);
//
this.map.setRotation(this.data_rotation, true);
},
...
...
Please
register
or
login
to post a comment