很简单的定位功能:页面打开以后就显示点图并标记指定经纬度的点~
wxml:
js:
Page({
data: {
markers: [{
iconPath: “…/…/images/dingwei.png”,
id: 0,
latitude: 36.741264,
longitude: 117.068709,
width: 50,
height: 50
}],
},
/** * 生命周期函数–监听页面初次渲染完成 /
onReady: function () { },
/* * 生命周期函数–监听页面卸载 */
onUnload: function () { },
})
wxss:
.loc map{
width:100%;
height:880rpx;
}
|