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
2023-06-28 16:40:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0d7e03caa7b4ddc9901d4d96629a08cf5f413309
0d7e03ca
1 parent
18a23b55
fix
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
7 deletions
src/components/InfoWindow.vue
src/components/InfoWindowLite.vue
src/views/index.vue
src/components/InfoWindow.vue
View file @
0d7e03c
...
...
@@ -184,10 +184,12 @@ export default {
this.voice_play(this.info.details[this.isActive]['audio'], 0)
this.changeAudioSrc(this.audio.src);
this.changeAudioStatus('play');
this.$emit('onPlay', this.info.name)
},
pause() {
this.voice_pause();
this.changeAudioStatus('pause');
this.$emit('onPause', this.info.name)
},
// 声音播放
voice_play(src, index) {
...
...
src/components/InfoWindowLite.vue
View file @
0d7e03c
...
...
@@ -14,9 +14,9 @@
</div>
<div class="van-hairline--top" style="margin: 1rem 0;">
<div @click="goToLocation()" style="width: 100%; float: left; text-align: center; margin-top: 1rem;">
<van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%89%8D%E5%BE%80@2x.png" size="1.5rem" color="#FFF"
<van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%89%8D%E5%BE%80@2x.png" size="1.
2
5rem" color="#FFF"
style="vertical-align: bottom;" />
<span style="color: #AB8F57; font-size: 1
.1
rem;">前往</span>
<span style="color: #AB8F57; font-size: 1rem;">前往</span>
</div>
</div>
</div>
...
...
@@ -112,14 +112,16 @@ export default {
box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
text-align: left;
border-radius: 5px;
padding: 1
.5
rem 1.25rem;
padding: 1rem 1.25rem;
overflow: auto;
.info-text {
width: 100%;
//
width: 100%;
line-height: 1.5;
float: left;
color: #7A6C6C;
font-size: 0.9rem;
padding: 0.5rem 0;
}
.info-text-audio {
width: 80%;
...
...
src/views/index.vue
View file @
0d7e03c
<!--
* @Date: 2023-05-19 14:54:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-06-28 1
5:43:08
* @LastEditTime: 2023-06-28 1
6:39:41
* @FilePath: /map-demo/src/views/index.vue
* @Description: 地图主体页面
-->
...
...
@@ -78,7 +78,7 @@
<!-- 自定义组件InfoWindow,初始时需要隐藏 -->
<!-- 隐藏不要使用v-if,因为我们需要渲染完成后的原生html结构作为信息框的dom对象使用 -->
<InfoWindow v-show="showInfoWindow" ref="infoWindow" :info-window="infoWindow" :info="itemInfo" :rect="rect"
@onLocation="infoWindowLocation"></InfoWindow>
@onLocation="infoWindowLocation"
@onPlay="onPlay" @onPause="onPause"
></InfoWindow>
<InfoWindowLite v-show="showInfoWindowLite" ref="infoWindowLite" :info-window="infoWindowLite" :info="itemInfo"
:rect="rect" @onLocation="infoWindowLocation"></InfoWindowLite>
<InfoWindowWarn v-show="showInfoWindowWarn" ref="infoWindowWarn" :info-window="infoWindowWarn" :info="itemInfo"
...
...
@@ -1076,8 +1076,49 @@ export default {
zoomEnable: true
});
}
}
},
onPlay (name) {
// var zoomStyleMapping = { 14: 0, 15: 0, 16: 0, 17: 0, 18: 0, 19: 0, 20: 0 };
// _.each(coord.spotInfo, (x, i) => {
// var marker = new AMap.ElasticMarker({
// position: coord.spotInfo[i].position,
// zooms: [17, 19],
// styles: [{
// icon: {
// img: x.name !== name ?coord.spotInfo[i].icon : 'https://cdn.ipadbiz.cn/xys/map/%E6%92%AD%E6%94%BE%E6%9A%82%E5%81%9C@2x.png',
// size: [28, 28], // 可见区域的大小
// anchor: 'bottom-center', // 锚点
// fitZoom: 14, // 最合适的级别
// scaleFactor: 2, // 地图放大一级的缩放比例系数
// maxScale: 1.4, // 最大放大比例
// minScale: 0.8 // 最小放大比例
// },
// label: {
// content: coord.spotInfo[i].name,
// position: 'TM',
// // position: 'BM',
// // offset: new AMap.Pixel(0, 10),
// minZoom: 18
// }
// }, {
// icon: {},
// label: {}
// }],
// zoomStyleMapping: coord.spotInfo[i].zoom ? coord.spotInfo[i].zoom : zoomStyleMapping
// });
// if (clickListener) {
// marker.off('click', clickListener)
// }
// // 绑定景点的点击事件 - 文字出现才能触发
// var clickListener = marker.on('click', (e) => {
// this.positionMarker(coord.spotInfo[i]);
// })
// this.spotInfo.push(marker);
// })
// this.map.add(this.spotInfo);
},
onPause (name) {},
}
}
</script>
...
...
Please
register
or
login
to post a comment