You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
804 B
34 lines
804 B
3 years ago
|
|
||
|
export default function init() {
|
||
|
this.mapType = typeof window.TMap!=='undefined' ? 'qq' : 'tiandi'
|
||
|
window.TMap = T;
|
||
|
console.log("天地图", T);
|
||
|
window.TMap = {};
|
||
|
window.TMap.Map = function (ele, paramas) {
|
||
|
let tmap = new T.Map(ele, paramas);
|
||
|
if (typeof ele == "string") {
|
||
|
ele = document.getElementById("app");
|
||
|
}
|
||
|
let width = ele.offsetWidth;
|
||
|
let height = ele.offsetHeight;
|
||
|
if (height == 0) {
|
||
|
ele.style.height = width * 0.6 + "px";
|
||
|
}
|
||
|
Object.keys(tmap).forEach((ki) => {
|
||
|
this[ki] = tmap[ki];
|
||
|
});
|
||
|
return this;
|
||
|
};
|
||
|
window.TMap.service = {
|
||
|
Search: T.LocalSearch,
|
||
|
Geocoder: T.Geocoder,
|
||
|
};
|
||
|
window.TMap.MultiMarker = function () {};
|
||
|
window.TMap.LatLng = function (lat, lng) {
|
||
|
return {
|
||
|
lat,
|
||
|
lng,
|
||
|
};
|
||
|
};
|
||
|
}
|