银花优选微信小程序修改后的最新版本代码
This commit is contained in:
54
pages/map/index.js
Normal file
54
pages/map/index.js
Normal file
@@ -0,0 +1,54 @@
|
||||
var app = getApp()
|
||||
var that=null
|
||||
var sopenFrame=null
|
||||
var areas = null;
|
||||
Page( {
|
||||
data: {
|
||||
loadingHidden:false,
|
||||
latitude:0,
|
||||
longitude:0,
|
||||
address:"",
|
||||
scale:15,
|
||||
markers: []
|
||||
},
|
||||
onReady: function(e) {
|
||||
// 使用 wx.createMapContext 获取 map 上下文
|
||||
this.mapCtx = wx.createMapContext('myMap');
|
||||
},
|
||||
onLoad: function(options) {
|
||||
|
||||
that = this
|
||||
if(options.lat&&options.lon){
|
||||
that.setData({
|
||||
latitude:options.lat,
|
||||
longitude:options.lon,
|
||||
address:options.address,
|
||||
loadingHidden:true,
|
||||
markers: [{
|
||||
id:8900,
|
||||
latitude: options.lat,
|
||||
longitude: options.lon,
|
||||
iconPath: '../../images/position-picker2.png',
|
||||
width: 80,
|
||||
height: 80,
|
||||
callout: {
|
||||
content: options.address,
|
||||
display: 'ALWAYS',
|
||||
color: '#000',
|
||||
bgColor: '#fff',
|
||||
padding: 5,
|
||||
borderRadius: 10,
|
||||
borderColor: '#f1f1f1',
|
||||
fontSize: 14,
|
||||
borderWidth: 1,
|
||||
textAlign: 'center',
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
that.rdata()
|
||||
},rdata: function() {
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user