-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
34 lines (29 loc) · 775 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const menuButtonData = wx.getMenuButtonBoundingClientRect();
var bmap = require('./libs/bmap-wx.min.js');
App({
onLaunch: function() {
},
globalData: {
statusBarHeight:wx.getSystemInfoSync()['statusBarHeight'],
menuButtonHeight: menuButtonData.height,
menuButtonTop: menuButtonData.top,
},
getLocation: function(parms) {
let BMap = new bmap.BMapWX({
ak:"Ya6fWkQO7lSgjIdXQfibZovyMlbCB1vV"
})
wx.getLocation({
type:'wgs84',
success: function(res) {
const latitude = res.latitude
const longitude = res.longitude
BMap.regeocoding({
location:latitude + ',' + longitude,
success: function (res) {
parms.success(res)
}
})
},
})
}
})