微信小程序地图划线,是小程序很基本的功能,那么小程序地图划线要怎么实现呢。

var point = []
var that2
function drawline() {
that2.setData({
polyline: [{
points: point,
color: "#99FF00",
width: 4,
dottedLine: false
}],
})
}
//获取经纬度
function getlocation() {
var latitude1, longitude1
wx.getLocation({
type: 'gcj02',
success: function (res) {
latitude1 = res.latitude
longitude1 = res.longitude
point.push({latitude:latitude1, longitude:longitude1})
console.log(point)
}
})
}
Page({
data: {
polyline: []
},
onReady: function () {
that2 = this
wx.getLocation({
type: 'gcj02',
success: function (res) {
that2.setData({
long: res.longitude,
lat: res.latitude
})
}
})
},
start:function(){
this.timer=setInterval(repeat, 10000);
function repeat() {
console.log("re")
getlocation()
drawline()
}
},
end: function () {
console.log("clear")
clearInterval(this.timer)
}
})
KESION 科汛软件
KESION 科汛软件是国内领先的在线教育软件及私域社交电商软件服务提供商,长期专注于为企业提供在线教育软件及社交电商SaaS平台解决方案。
公司核心产品云开店SaaS社交电商服务平台、在线教育SaaS服务平台、教育企业数字化SaaS云平台、企微营销助手、私有化独立部署品牌网校和在线教育咨询等。KESION 不断通过技术创新,提供产品和服务,助力企业向数字化转型,通过科技驱动商业革新,让商业变得更智慧!
小程序调用第三方地图api需要如何实现,下面是具体的实现步骤:...
WXS 主要有 3 种注释的方法。 以下为大家分别介绍是哪三种方法...