Page({
data: {
latitude: 23.099994,
longitude: 113.324520,
markers: [{
id: 1,
latitude: 23.099994,
longitude: 113.324520,
name: 'T.I.T 创意园'
}],
polyline: [{
points: [{
latitude: 23.099994,
longitude: 113.344520,
},
{
latitude: 23.199994,
longitude: 113.324520,
},
{
latitude: 23.199984,
longitude: 113.304520,
},
],
segmentTexts: [{
startIndex: 0,
endIndex: 1,
name: 'setmengtext1'
},{
startIndex: 1,
endIndex: 2,
name: 'setmengtext2'
}],
textStyle: {
textColor:'#ff0000',
strokeColor:'#ff0000',
fontSize: 14
},
color: "#fff",
width: 15,
arrowLine: true,
borderWidth: 1
}],
covers: [{
latitude: 23.099994,
longitude: 113.344520,
iconPath: '/image/location.png'
}, {
latitude: 23.099994,
longitude: 113.304520,
iconPath: '/image/location.png'
}]
},
onReady: function (e) {
this.mapCtx = wx.createMapContext('myMap')
},
getCenterLocation: function () {
this.mapCtx.getCenterLocation({
success: function (res) {
console.log(res.longitude)
console.log(res.latitude)
}
})
},
moveToLocation: function () {
this.mapCtx.moveToLocation()
},
translateMarker: function () {
this.mapCtx.translateMarker({
markerId: 1,
autoRotate: true,
duration: 1000,
destination: {
latitude: 23.10229,
longitude: 113.3345211,
},
animationEnd() {
console.log('animation end')
}
})
},
includePoints: function () {
this.mapCtx.includePoints({
padding: [10],
points: [{
latitude: 23.099994,
longitude: 113.344520,
},
{
latitude: 23.199994,
longitude: 113.324520,
},
{
latitude: 23.199984,
longitude: 113.304520,
},
]
})
}
})
使用真机调试看看,我这边真机调试可以显示。
现在还没解决,有遇到的吗
楼主解决了吗
我设置的也显示不了
提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。