hookehuyr

fix 地图设置调整

...@@ -37,5 +37,5 @@ git commit -m '前端地图更新' ...@@ -37,5 +37,5 @@ git commit -m '前端地图更新'
37 git push 37 git push
38 38
39 # 更新SSH服务器上文件 39 # 更新SSH服务器上文件
40 -# ssh -p 22 itomix@ipadbiz.cn 'cd /opt/space-dev/ && git pull origin develop' 40 +ssh -p 22 itomix@ipadbiz.cn 'cd /opt/space-dev/ && git pull origin develop'
41 -ssh -p 22 itomix@ipadbiz.cn 'cd /opt/oa/ && git pull origin master' 41 +# ssh -p 22 itomix@ipadbiz.cn 'cd /opt/oa/ && git pull origin master'
......
1 <!-- 1 <!--
2 * @Date: 2023-05-19 14:54:27 2 * @Date: 2023-05-19 14:54:27
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-03-22 11:40:02 4 + * @LastEditTime: 2024-03-22 16:38:53
5 * @FilePath: /map-demo/src/views/index.vue 5 * @FilePath: /map-demo/src/views/index.vue
6 * @Description: 公众地图主体页面 6 * @Description: 公众地图主体页面
7 --> 7 -->
...@@ -242,6 +242,8 @@ export default { ...@@ -242,6 +242,8 @@ export default {
242 open_current_location: true, 242 open_current_location: true,
243 data_center: [], // 接口获取-地图中心点 243 data_center: [], // 接口获取-地图中心点
244 data_zoom: '', // 接口获取-地图默认缩放 244 data_zoom: '', // 接口获取-地图默认缩放
245 + data_zooms: '', // 接口获取-地图默认缩放范围
246 + data_rotation: 0, // 接口获取-地图旋转角度
245 } 247 }
246 }, 248 },
247 async mounted() { 249 async mounted() {
...@@ -252,8 +254,10 @@ export default { ...@@ -252,8 +254,10 @@ export default {
252 this.mapTiles = data.level; // 获取图层 254 this.mapTiles = data.level; // 获取图层
253 this.navKey = data.list[0]['id']; // 默认选中 第一个 id 255 this.navKey = data.list[0]['id']; // 默认选中 第一个 id
254 this.navList = data.list.filter(item => item.id === this.navKey)[0]['list']; // 返回默认选中项的实体信息 256 this.navList = data.list.filter(item => item.id === this.navKey)[0]['list']; // 返回默认选中项的实体信息
255 - this.data_center = data.map.center.length ? data.map.center.map(item => Number(item)) : this.defaultCenter; // 地图中心点 257 + this.data_center = data.map.center.map(item => Number(item)); // 地图中心点
256 - this.data_zoom = data.map.zoom ? data.map.zoom : this.defaultZoom; // 地图默认缩放 258 + this.data_zoom = data.map.zoom; // 地图默认缩放
259 + this.data_rotation = data.map.rotation; // 地图旋转角度
260 + this.data_zooms = data.map.zooms.map(item => Number(item)); // 地图默认缩放范围
257 // 初始化地图 261 // 初始化地图
258 this.initMap(); 262 this.initMap();
259 // this.setMapBoundary(); 263 // this.setMapBoundary();
...@@ -313,7 +317,7 @@ export default { ...@@ -313,7 +317,7 @@ export default {
313 showIndoorMap: false, 317 showIndoorMap: false,
314 defaultCursor: 'pointer', // 地图默认鼠标样式 318 defaultCursor: 'pointer', // 地图默认鼠标样式
315 showBuildingBlock: false, // 是否展示地图 3D 楼块 319 showBuildingBlock: false, // 是否展示地图 3D 楼块
316 - zooms: [17, 20], // 地图显示的缩放级别范围, 默认为 [2, 20] ,取值范围 [2 ~ 30] 320 + zooms: this.data_zooms, // 地图显示的缩放级别范围, 默认为 [2, 20] ,取值范围 [2 ~ 30]
317 showLabel: true, // 是否展示地图文字和 POI 信息 321 showLabel: true, // 是否展示地图文字和 POI 信息
318 zoom: this.data_zoom, // 设置地图显示的缩放级别 322 zoom: this.data_zoom, // 设置地图显示的缩放级别
319 pitch: 0, // 俯仰角度,默认 0,最大值根据地图当前 zoom 级别不断增大,2D地图下无效 。 323 pitch: 0, // 俯仰角度,默认 0,最大值根据地图当前 zoom 级别不断增大,2D地图下无效 。
...@@ -333,7 +337,7 @@ export default { ...@@ -333,7 +337,7 @@ export default {
333 // 加载景点图层 337 // 加载景点图层
334 this.loadMaker(this.navKey); 338 this.loadMaker(this.navKey);
335 // 339 //
336 - this.map.setRotation(6, true); 340 + this.map.setRotation(this.data_rotation, true);
337 }, 341 },
338 setNavLayer({ id }, index) { // 选择地图图层显示 342 setNavLayer({ id }, index) { // 选择地图图层显示
339 this.isActive = index; 343 this.isActive = index;
......