Browse Source

地图定位

master
1191151619 4 years ago
parent
commit
c8028dd96f
  1. 19
      pages/look/look.js

19
pages/look/look.js

@ -151,12 +151,21 @@ Page({
},true).then(data => {
console.log(data);
if(data.code == 0){
let l = data.data.centerPoint.indexOf('POINT(');
console.log(l)
return;
let lag = data.data.centerPoint.splice()
let number = data.data[0].centerPoint;
console.log(number)
let l = number.indexOf('(')+1;
let z = number.indexOf(' ');
let r = number.indexOf(')');
console.log(l,z,r)
let log = number.substr(l,z-l);
let lag = number.substr(z,r-z);
console.log(lag,log)
this.setData({
latitude:data.data.centerPoint,
latitude:lag,
longitude:log,
})
}
})

Loading…
Cancel
Save