老系统对接

This commit is contained in:
2018-07-12 14:08:55 +08:00
commit 5f41fe5df1
420 changed files with 50883 additions and 0 deletions

38
webapp/js/convertor.js Normal file
View File

@ -0,0 +1,38 @@
(function() { // <20>հ<EFBFBD>
function load_script(xyUrl, callback) {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = xyUrl;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>jQuery<72><79>script<70><74><EFBFBD>򷽷<EFBFBD>
script.onload = script.onreadystatechange = function() {
if ((!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
callback && callback();
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
if (head && script.parentNode) {
head.removeChild(script);
}
}
};
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
head.insertBefore(script, head.firstChild);
}
function translate(point, type, callback) {
var callbackName = 'cbk_' + Math.round(Math.random() * 10000); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
var xyUrl = "http://api.map.baidu.com/ag/coord/convert?from=" + type
+ "&to=4&x=" + point.lng + "&y=" + point.lat
+ "&callback=BMap.Convertor." + callbackName;
// <20><>̬<EFBFBD><CCAC><EFBFBD><EFBFBD>script<70><74>ǩ
load_script(xyUrl);
BMap.Convertor[callbackName] = function(xyResult) {
delete BMap.Convertor[callbackName]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫɾ<D2AA><C9BE><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD>
var point = new BMap.Point(xyResult.x, xyResult.y);
callback && callback(point);
}
}
window.BMap = window.BMap || {};
BMap.Convertor = {};
BMap.Convertor.translate = translate;
})();