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
2024-09-20 11:14:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b72866cbf26bcedb699dd28e7b8e03eca08d1f94
b72866cb
1 parent
82e167b6
fix Bob需求细节调整
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
31 deletions
src/views/bieyuan/info.vue
src/views/bieyuan/map.vue
src/views/bieyuan/info.vue
View file @
b72866c
<!--
* @Date: 2024-09-15 22:08:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-09-19 1
4:51:41
* @LastEditTime: 2024-09-19 1
8: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');
}
}
...
...
src/views/bieyuan/map.vue
View file @
b72866c
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-09-
19 15:54:5
1
* @LastEditTime: 2024-09-
20 11:13:1
1
* @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,
markerStyle
1
: { // 选中
markerStyle
2
: { // 选中
//设置文本样式,Object 同 css 样式表
"padding": ".5rem .2rem .5rem .2rem",
// "margin-bottom": "1rem",
...
...
@@ -176,7 +176,7 @@ export default {
"justify-content": "center",
"align-items": "center",
},
markerStyle
2
: { // 未选中
markerStyle
1
: { // 未选中
//设置文本样式,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.markerStyle
1
);
item.setStyle(this.markerStyle
2
);
}
})
// 修改文本的样式
e.target.setStyle(this.markerStyle
2
);
e.target.setStyle(this.markerStyle
1
);
// 修改文本内容
// 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.04
5587,26.838764
],
[117.05
1081,26.8345723
]
var myBounds = new AMap.Bounds(
// 移动范围,对角线
[117.04
384,26.833629
],
[117.05
5975,26.843652
]
);
this.map.setLimitBounds(myBounds);
let list =[
[117.04
5598,26.838764
],
[117.0
51075,26.83877
9],
[117.05
1075,26.835107
],
[117.0
45598,26.83510
7]
let list =[
// 四个角,覆盖填充范围
[117.04
421,26.833875
],
[117.0
45012,26.84208
9],
[117.05
4749,26.84219
],
[117.0
56013,26.8338
7]
]
// 隐藏边界以外的区域
...
...
@@ -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: 9
99
;
z-index: 9;
background: rgba(86, 65, 23, 0.8);
color: white;
border-radius: 10px;
...
...
Please
register
or
login
to post a comment