uniapp里地图map组件的markers时显示时不显示,h5和微信小程序版都一直显示正常‘
代码如下
<template>
<view>
<view class="page-body">
<view class="page-section page-section-gap">
<map scale="13" @markertap="mktap" style="position: absolute;height: 100%; width: 100%; " :latitude="latitude" :longitude="longitude" :markers="markers">
</map>
</view>
</view>
</view>
</template>
<script>
var _self;
export default {
data() {
return {
height:0,
title: '首页',
latitude: 39.909,
longitude: 116.39742,
markers: [{
id:'1',
label:{
content:'店铺1'
},
latitude: 39.909,
longitude: 116.39742,
width:80,
height:80,
iconPath: '/static/shop.png'
}, {
id:'2',
label:{
content:'店铺2'
},
latitude: 39.90,
longitude: 116.39,
width:80,
height:80,
iconPath: '/static/shop.png'
}]
}
},
onLoad:function(options){
_self = this;
//uni.getSystemInfo({
// success: function (res) {
// _self.height = res.windowHeight;
// }
//});
},
methods: {
mktap(e){
uni.navigateTo({
url: '../jishi/jishi?id='+e.mp.markerId
});
}
}
}
</script>
9***@qq.com (作者)
没有,后来没用地图 就没继续关注了
2020-04-05 21:36
1***@qq.com
我有时候进去显示,有时候进去不显示,你是怎么解决的?
2020-06-10 14:23