效果图
<view class='container'>
<map id="map" longitude="{{lon}}" latitude="{{lat}}" scale="14" markers="{{markers}}"></map>
</view>
.container{
width: 750rpx;
height: 100%;
}
.container map{
width: 100%;
height: 100%;
}
Page({
data: {
lat: '',
lon: '',
markers: []
},
onLoad: function(options) {
console.log('options', options)
let that = this
let lat = options.lat
let lon = options.lon
console.log(options)
that.setData({
lat: lat,
lon: lon,
markers: [{
iconPath: "/img/img/weizhi.png", //图片
id: 0,
latitude: lat,
longitude: lon,
width: 25,
height: 25
}]
})
}
})
|
请发表评论