|
var map = api.require('bMap');
map.setAgreePrivacy({
agree: true
});
map.initMapSDK(function (ret) {
if (ret.status) {
initMap();
}
});
function initMap() {
// map.customStyle({customConfig:"lightblue"})
let _self = this;
map.open({
rect: {
x: 0,
y: 0,
w: api.frameWidth,
h: api.frameHeight
},
center: {
lon: 116.730058,
lat: 23.387583
},
zoomLevel: 11,
showUserLocation: true,
fixedOn: api.frameName,
fixed: true
}, function (ret) {
if (ret.status) {
console.log('123456');
// map.walkNavi({
// currentPosition: {
// latitude: 23.387583, //纬度
// longitude: 116.730058 //经度
// },
// destination: {
// latitude: 23.397069, //纬度
// longitude: 116.755642 //经度
// }
// }, function (ret) {
// if (ret.status) {
// alert(JSON.stringify(ret));
// }
// });
map.cyclingNavi({
currentPosition: {
latitude: 23.387583, //纬度
longitude: 116.730058 //经度
},
destination: {
latitude: 23.397069, //纬度
longitude: 116.755642 //经度
}
}, function (ret) {
console.log(JSON.stringify(ret));
if (ret.status) {
alert(JSON.stringify(ret));
}
});
}
});
}
您好,代码是这样的,1.5.5已经引用了setAgreePrivacy跟initMapSDK |
|