tike
tike
  • 发布:2021-11-04 09:37
  • 更新:2021-11-04 20:05
  • 阅读:833

【报Bug】H5页面地图添加Marker时有title属性报this.setStyle is not a function错误

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: windows 10

HBuilderX类型: 正式

HBuilderX版本号: 3.2.12

浏览器平台: Chrome

浏览器版本: 13.0.2256.0

项目创建方式: HBuilderX

示例代码:
<template> <view> <map :latitude="context.latitude" :longitude="context.longitude" id="mapContainer" markers="context.markers"></map> </view>
</template>

<script>
export default {
data() {
return {
context:{
longitude:102.74055,
latitude: 25.1578,
markers:[]
}

        }  
    },  
    created() {  
        this.handleCreate()  
    },  
    methods: {  
        handleCreate(){  
            let marker = {  
                id: 1,  
                iconPath:'/static/marker-icon.png',  
                longitude:this.context.longitude,  
                latitude:this.context.latitude,  
                title: '桥梁'  
            }  
            this.context.markers.push(marker)  
        }  
    }  
}  

</script>

<style>

mapContainer{

width: 100%;  
height: 500px;  

}
</style>

操作步骤:

预览即可复现bug

预期结果:

不在地图上显示,也不应该报错。

实际结果:

控制台报错 Uncaught TypeError: this.setStyle is not a function

bug描述:

marker对象新增title属性时在H5上预览就会报错,
错误信息如下:
Uncaught TypeError: this.setStyle is not a function

2021-11-04 09:37 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

该问题目前已经被锁定, 无法添加新回复