// 引入SDK核心类var QQMapWX = require('../../../utils/qqmap-wx-jssdk.js');//百度经纬度转换腾讯经纬度 reverseLocation: function() { var that = this; // 实例化API核心类 var demo = new QQMapWX({ key: '申请的开发密钥' }); // 调用接口 demo.reverseGeocoder({ location: { latitude: that.data.latitude, longitude: that.data.longitude }, coord_type: 3, //baidu经纬度 success: function(res) { var latitude = res.result.ad_info.location.lat; var longitude = res.result.ad_info.location.lng; var markers = [{ iconPath: '../../../images/common/location.png', longitude: longitude, latitude: latitude, id: "map", }] console.log(markers) that.setData({ markers: markers, latitude: latitude, longitude: longitude }) }, fail: function(error) { console.error(error); }, complete: function(res) { console.log(res); } }); },