want to use Tencent Map js sdk in APP to find that this is written in the official website tutorial
// SDK
var QQMapWX = require("../../libs/qqmap-wx-jssdk.js");
var qqmapsdk;
Page({
onLoad: function () {
// API
qqmapsdk = new QQMapWX({
key: "key"
});
},
onShow: function () {
//
qqmapsdk.search({
keyword: "",
success: function (res) {
console.log(res);
},
fail: function (res) {
console.log(res);
},
complete: function (res) {
console.log(res);
}
});
})
this allows you to call the interface, but how can the map be displayed on the page?
still can only use the following methods
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=OB4BZ-D4W3U-B7VVO-4PJWW-6TKDJ-WPB77"></script>
<script>
var map = new qq.maps.Map(document.getElementById("container"), {
center: new qq.maps.LatLng(39.916527,116.397128), //
zoom:8 //
});