4 changed files with 45 additions and 36 deletions
@ -0,0 +1,33 @@ |
|||
|
|||
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, |
|||
}; |
|||
}; |
|||
} |
@ -1,20 +0,0 @@ |
|||
/** |
|||
* 邮箱 |
|||
* @param {*} s |
|||
*/ |
|||
export default function init() { |
|||
window.TMap = { |
|||
Map: T.Map, |
|||
service: { |
|||
Search: T.LocalSearch, |
|||
Geocoder: T.Geocoder, |
|||
}, |
|||
MultiMarker() {}, |
|||
LatLng(lat, lng) { |
|||
return { |
|||
lat, |
|||
lng, |
|||
}; |
|||
}, |
|||
}; |
|||
} |
Loading…
Reference in new issue