hookehuyr

fix Bob需求细节调整

<!--
* @Date: 2024-09-15 22:08:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-09-19 14:51:41
* @LastEditTime: 2024-09-19 18:28:02
* @FilePath: /map-demo/src/views/bieyuan/info.vue
* @Description: 文件描述
-->
......@@ -179,14 +179,7 @@ const goTo = () => { // 打开标记地图显示
//
emit("closeFloat", false);
//
let test_paths = {
name: 'test',
path: [[117.049724,26.838248],
[117.049564,26.838155],
[117.04941,26.837998],
[117.049233,26.837796],]
}
emit("route", test_paths);
emit("route", 'marker_id');
}
}
......
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-09-19 15:54:51
* @LastEditTime: 2024-09-20 11:13:11
* @FilePath: /map-demo/src/views/bieyuan/map.vue
* @Description: 公众地图主体页面
-->
......@@ -49,7 +49,7 @@
</van-floating-panel>
</van-config-provider>
<div v-if="!show_walk_route" @click="removeSafeRoute('test')" class="walk-nav-text">
<div v-if="!show_walk_route" @click="removeSafeRoute(data_path_list[0])" class="walk-nav-text">
关闭步行导航
</div>
......@@ -157,7 +157,7 @@ export default {
floatingPanelBorderRadius: '1.25rem'
},
showClose: false,
markerStyle1: { // 选中
markerStyle2: { // 选中
//设置文本样式,Object 同 css 样式表
"padding": ".5rem .2rem .5rem .2rem",
// "margin-bottom": "1rem",
......@@ -176,7 +176,7 @@ export default {
"justify-content": "center",
"align-items": "center",
},
markerStyle2: { // 未选中
markerStyle1: { // 未选中
//设置文本样式,Object 同 css 样式表
"padding": ".5rem .2rem .5rem .2rem",
// "margin-bottom": "1rem",
......@@ -321,11 +321,11 @@ export default {
this.markerSum.forEach(item => {
if (e.target.hS !== item.hS) {
// 修改文本的样式
item.setStyle(this.markerStyle1);
item.setStyle(this.markerStyle2);
}
})
// 修改文本的样式
e.target.setStyle(this.markerStyle2);
e.target.setStyle(this.markerStyle1);
// 修改文本内容
// textMarker.setText('样式已修改');
......@@ -523,29 +523,25 @@ export default {
// layer1.setMap(this.map);
// TODO: 暂时屏蔽等待数据设置字段
// 只显示相应区域,移动会回到选定范围
const id = this.$route.query.id;
if (id === '1759271') { // 定制开发
this.lockMapBounds()
}
},
// 限制地图范围
lockMapBounds() {
// var bounds = this.map.getBounds();
var myBounds = new AMap.Bounds(
[117.045587,26.838764],
[117.051081,26.8345723]
var myBounds = new AMap.Bounds( // 移动范围,对角线
[117.04384,26.833629],
[117.055975,26.843652]
);
this.map.setLimitBounds(myBounds);
let list =[
[117.045598,26.838764],
[117.051075,26.838779],
[117.051075,26.835107],
[117.045598,26.835107]
let list =[ // 四个角,覆盖填充范围
[117.04421,26.833875],
[117.045012,26.842089],
[117.054749,26.84219],
[117.056013,26.83387]
]
// 隐藏边界以外的区域
......@@ -728,7 +724,7 @@ export default {
// 关闭导航提示
this.show_walk_route = false;
},
removeSafeRoute(name) { // 移除地图路线
removeSafeRoute({name}) { // 移除地图路线
this.current_safe_route.forEach(item => {
if (item.key === name) {
this.map.remove([item.path]); // 删除地图折线
......@@ -743,9 +739,10 @@ export default {
// 关闭导航提示
this.show_walk_route = true;
},
onRoute (path) {
onRoute (marker_id) {
console.warn(marker_id);
// 模拟新增路线
this.addSafeRoute(path);
this.addSafeRoute(this.data_path_list[0]);
}
}
}
......@@ -920,7 +917,7 @@ export default {
bottom: 6rem;
left: 50%;
transform: translate(-50%, -50%);
z-index: 999;
z-index: 9;
background: rgba(86, 65, 23, 0.8);
color: white;
border-radius: 10px;
......