详细问题描述
[步骤]
uni-APP 静态内容
<template>
<view class="content">
<map class="map" :latitude="latitude" :longitude="longitude" :markers="covers" :style="{height: height+'px'}" :polyline="polyline"></map>
</view>
</template>
<script>
export default {
data() {
return {
id: 0,
model:{},
latitude: 39.909,
longitude: 116.39742,
height:500,
polyline: [{
points:[
{latitude: 39.909,longitude: 116.39742},
{latitude: 39.909,longitude: 116.29742}
],
color:"#0000AA",//线的颜色
width:20,//线的宽度
dottedLine:true,//是否虚线
arrowLine: true, //带箭头的线 开发者工具暂不支持该属性
}],
covers: [{
latitude: 39.909,//纬度
longitude: 116.39742,//经度
iconPath: '../../static/icon_address_orange.png', //显示的图标
title:'阿打算',//标注点名
label:{//为标记点旁边增加标签
content:'文本1',//文本
color:'#F76350',//文本颜色
anchorX:0,//label的坐标,原点是 marker 对应的经纬度
anchorY:-80,//label的坐标,原点是 marker 对应的经纬度
// x:39.909,//这个组件微信在1.2.0以后就废弃了
// y:116.39742,
bgColor:'#fff',//背景色
padding:5,//文本边缘留白
borderWidth:1,//边框宽度
borderColor:'#D84C29',//边框颜色
textAlign:'right'//文本对齐方式。
},
callout:{//自定义标记点上方的气泡窗口 点击有效
content:'地点1',
color:'#F76350',
fontSize:12,
borderRadius:5,
},
// anchor:{//经纬度在标注图标的锚点,默认底边中点
// x:5,
// y:1,
// }
}, {
latitude: 39.90,
longitude: 116.39,
iconPath: '../../static/image/personal_center.png',
title:'阿迪达斯',
x:39.90,
y:116.399,
label:{
content:'文本2',
color:'#F76350',
bgColor:'#fff',
padding:5,
borderRadius:4,
},
callout:{
content:'地点2',
color:'#F76350',
fontSize:12
}
}],
}
},
onLoad:function(o){
},
methods:{
}
}
</script>
<style>
.map{width: 750upx;}
</style>
[结果]
出现报错
Uncaught Error: Invalid value or type for property <strokeColor> :undefined
2***@qq.com
重启电脑,不行,还是错误
2021-09-14 11:26