12345678910111213141516171819 |
- // var request = require("./request.js");
- const QQMapWX = require("@/libs/qqmap-wx-jssdk.min.js");
- export const key = "CXDBZ-UNALF-Q4SJ7-NCXTF-LVP36-6JFSB"
- const wxMap = new QQMapWX({ key });
- export function getDistance(from, to, callback) {
- wxMap.calculateDistance({
- mode: 'straight',
- from, to,
- success: function (res) {//成功后的回调
- callback(res);
- },
- fail: function (error) {
- callback(error);
- }
- })
- }
|