hookehuyr

fix Bob需求细节调整

1 <!-- 1 <!--
2 * @Date: 2024-09-15 22:08:49 2 * @Date: 2024-09-15 22:08:49
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-09-19 14:51:41 4 + * @LastEditTime: 2024-09-19 18:28:02
5 * @FilePath: /map-demo/src/views/bieyuan/info.vue 5 * @FilePath: /map-demo/src/views/bieyuan/info.vue
6 * @Description: 文件描述 6 * @Description: 文件描述
7 --> 7 -->
...@@ -179,14 +179,7 @@ const goTo = () => { // 打开标记地图显示 ...@@ -179,14 +179,7 @@ const goTo = () => { // 打开标记地图显示
179 // 179 //
180 emit("closeFloat", false); 180 emit("closeFloat", false);
181 // 181 //
182 - let test_paths = { 182 + emit("route", 'marker_id');
183 - name: 'test',
184 - path: [[117.049724,26.838248],
185 - [117.049564,26.838155],
186 - [117.04941,26.837998],
187 - [117.049233,26.837796],]
188 - }
189 - emit("route", test_paths);
190 } 183 }
191 } 184 }
192 185
......
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-09-19 15:54:51 4 + * @LastEditTime: 2024-09-20 11:13:11
5 * @FilePath: /map-demo/src/views/bieyuan/map.vue 5 * @FilePath: /map-demo/src/views/bieyuan/map.vue
6 * @Description: 公众地图主体页面 6 * @Description: 公众地图主体页面
7 --> 7 -->
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
49 </van-floating-panel> 49 </van-floating-panel>
50 </van-config-provider> 50 </van-config-provider>
51 51
52 - <div v-if="!show_walk_route" @click="removeSafeRoute('test')" class="walk-nav-text"> 52 + <div v-if="!show_walk_route" @click="removeSafeRoute(data_path_list[0])" class="walk-nav-text">
53 关闭步行导航 53 关闭步行导航
54 </div> 54 </div>
55 55
...@@ -157,7 +157,7 @@ export default { ...@@ -157,7 +157,7 @@ export default {
157 floatingPanelBorderRadius: '1.25rem' 157 floatingPanelBorderRadius: '1.25rem'
158 }, 158 },
159 showClose: false, 159 showClose: false,
160 - markerStyle1: { // 选中 160 + markerStyle2: { // 选中
161 //设置文本样式,Object 同 css 样式表 161 //设置文本样式,Object 同 css 样式表
162 "padding": ".5rem .2rem .5rem .2rem", 162 "padding": ".5rem .2rem .5rem .2rem",
163 // "margin-bottom": "1rem", 163 // "margin-bottom": "1rem",
...@@ -176,7 +176,7 @@ export default { ...@@ -176,7 +176,7 @@ export default {
176 "justify-content": "center", 176 "justify-content": "center",
177 "align-items": "center", 177 "align-items": "center",
178 }, 178 },
179 - markerStyle2: { // 未选中 179 + markerStyle1: { // 未选中
180 //设置文本样式,Object 同 css 样式表 180 //设置文本样式,Object 同 css 样式表
181 "padding": ".5rem .2rem .5rem .2rem", 181 "padding": ".5rem .2rem .5rem .2rem",
182 // "margin-bottom": "1rem", 182 // "margin-bottom": "1rem",
...@@ -321,11 +321,11 @@ export default { ...@@ -321,11 +321,11 @@ export default {
321 this.markerSum.forEach(item => { 321 this.markerSum.forEach(item => {
322 if (e.target.hS !== item.hS) { 322 if (e.target.hS !== item.hS) {
323 // 修改文本的样式 323 // 修改文本的样式
324 - item.setStyle(this.markerStyle1); 324 + item.setStyle(this.markerStyle2);
325 } 325 }
326 }) 326 })
327 // 修改文本的样式 327 // 修改文本的样式
328 - e.target.setStyle(this.markerStyle2); 328 + e.target.setStyle(this.markerStyle1);
329 329
330 // 修改文本内容 330 // 修改文本内容
331 // textMarker.setText('样式已修改'); 331 // textMarker.setText('样式已修改');
...@@ -523,29 +523,25 @@ export default { ...@@ -523,29 +523,25 @@ export default {
523 523
524 // layer1.setMap(this.map); 524 // layer1.setMap(this.map);
525 525
526 - // TODO: 暂时屏蔽等待数据设置字段
527 // 只显示相应区域,移动会回到选定范围 526 // 只显示相应区域,移动会回到选定范围
528 - const id = this.$route.query.id; 527 + this.lockMapBounds()
529 - if (id === '1759271') { // 定制开发
530 - this.lockMapBounds()
531 - }
532 528
533 }, 529 },
534 // 限制地图范围 530 // 限制地图范围
535 lockMapBounds() { 531 lockMapBounds() {
536 // var bounds = this.map.getBounds(); 532 // var bounds = this.map.getBounds();
537 - var myBounds = new AMap.Bounds( 533 + var myBounds = new AMap.Bounds( // 移动范围,对角线
538 - [117.045587,26.838764], 534 + [117.04384,26.833629],
539 - [117.051081,26.8345723] 535 + [117.055975,26.843652]
540 ); 536 );
541 537
542 this.map.setLimitBounds(myBounds); 538 this.map.setLimitBounds(myBounds);
543 539
544 - let list =[ 540 + let list =[ // 四个角,覆盖填充范围
545 - [117.045598,26.838764], 541 + [117.04421,26.833875],
546 - [117.051075,26.838779], 542 + [117.045012,26.842089],
547 - [117.051075,26.835107], 543 + [117.054749,26.84219],
548 - [117.045598,26.835107] 544 + [117.056013,26.83387]
549 ] 545 ]
550 546
551 // 隐藏边界以外的区域 547 // 隐藏边界以外的区域
...@@ -728,7 +724,7 @@ export default { ...@@ -728,7 +724,7 @@ export default {
728 // 关闭导航提示 724 // 关闭导航提示
729 this.show_walk_route = false; 725 this.show_walk_route = false;
730 }, 726 },
731 - removeSafeRoute(name) { // 移除地图路线 727 + removeSafeRoute({name}) { // 移除地图路线
732 this.current_safe_route.forEach(item => { 728 this.current_safe_route.forEach(item => {
733 if (item.key === name) { 729 if (item.key === name) {
734 this.map.remove([item.path]); // 删除地图折线 730 this.map.remove([item.path]); // 删除地图折线
...@@ -743,9 +739,10 @@ export default { ...@@ -743,9 +739,10 @@ export default {
743 // 关闭导航提示 739 // 关闭导航提示
744 this.show_walk_route = true; 740 this.show_walk_route = true;
745 }, 741 },
746 - onRoute (path) { 742 + onRoute (marker_id) {
743 + console.warn(marker_id);
747 // 模拟新增路线 744 // 模拟新增路线
748 - this.addSafeRoute(path); 745 + this.addSafeRoute(this.data_path_list[0]);
749 } 746 }
750 } 747 }
751 } 748 }
...@@ -920,7 +917,7 @@ export default { ...@@ -920,7 +917,7 @@ export default {
920 bottom: 6rem; 917 bottom: 6rem;
921 left: 50%; 918 left: 50%;
922 transform: translate(-50%, -50%); 919 transform: translate(-50%, -50%);
923 - z-index: 999; 920 + z-index: 9;
924 background: rgba(86, 65, 23, 0.8); 921 background: rgba(86, 65, 23, 0.8);
925 color: white; 922 color: white;
926 border-radius: 10px; 923 border-radius: 10px;
......