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, }; }; }