<view class="home">
<map id="map" scale='10' style="width: 750px; flex: 1;" latitude="39.909" longitude="116.39742" :markers="covers" layer-style='5072e0eb06928aa9b7a8e99747571603'>
</map>
<!-- <image src="../../static/icon/db.png" mode=""></image> -->
<!-- <map style="width: 750rpx; height: 1200rpx;" layer-style="c29e758aea2d2a1873049aeb81dab986"> </map> -->
</view>
</template>
<script>
export default {
data() {
return {
id: 0, // 使用 marker点击事件 需要填写id
latitude: 40.801163,
longitude: 114.886351,
covers: [{
latitude:40.801163,
longitude: 114.886351,
// iconPath: '/static/icon/db.png',
iconPath: 'https://img1.baidu.com/it/u=1960110688,1786190632&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1685120400&t=5a8dab865f3afadf1a6404128a847718',
// sty
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 15,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
{
latitude: 40.801163,
longitude: 114.886351,
iconPath: '/static/icon/db.png',
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 10,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
{
latitude: 39.957866,
longitude: 113.786351,
iconPath: '/static/icon/db.png',
// iconPath: '',
// sty
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 10,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
{
latitude: 41.801163,
longitude: 112.886351,
iconPath: '/static/icon/db.png',
// iconPath: '',
// sty
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 10,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
{
latitude: 39.918919,
longitude: 116.063344,
iconPath: '/static/icon/db.png',
// iconPath: '',
// sty
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 10,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
{
latitude: 39.901652,
longitude: 116.376098,
iconPath: '/static/icon/db.png',
// iconPath: '',
// sty
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 10,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
{
latitude: 39.939281,
longitude: 116.369199,
iconPath: '/static/icon/db.png',
// iconPath: '',
// sty
width: 40,
height: 40,
callout: {
content: '海深时见鲸,林深时。。。',
color: '#ffffff',
fontSize: 10,
display: 'ALWAYS',
textAlign: 'right',
anchorX: 30,
bgColor: 'rgba(147, 150, 146, 0.4)',
borderRadius: 15
}
},
]
}
},
onShow() {
console.log(1);
const that = this
uni.getLocation({
success: res => {
console.log(res);
that.latitude = res.latitude
that.longitude = res.longitude
}
})
}
}
</script>
<style>
.home {
width: 750rpx;
flex: 1;
}
</style>```

- 发布:2023-05-25 16:23
- 更新:2023-05-25 16:58
- 阅读:224
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows7
HBuilderX类型: 正式
HBuilderX版本号: 3.7.11
手机系统: Android
手机系统版本号: Android 14
手机厂商: 荣耀
手机机型: magic2
页面类型: nvue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
用基座在手机上打开不动手机几分钟后地图变色
用基座在手机上打开不动手机几分钟后地图变色
预期结果:
不变色
不变色
实际结果:
变色了
变色了
bug描述:
app使用nvue做地图使用layer-style改变地图颜色后,标准基座可以显示,自定义基座不行,而且在标准基座下,地图颜色在不动的情况下几分钟后会变成标准颜色

Diligent_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序
你这是动态设置layer-style吗
1***@qq.com (作者)
是写死的
没做动态
2023-05-26 10:17