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.
pingAnQiYeWeb/public/map_load.js

26 lines
1.2 KiB

9 months ago
console.log(window.$mapCfg);
1 year ago
let bmapcfg = {
9 months ago
imgext: ".png", //瓦片图的后缀 ------ 根据需要修改,一般是 .png .jpg
tiles_dir: "roadmap", //普通瓦片图的地址,为空默认在 offlinemap/tiles/ 目录
1 year ago
//'tiles_path': `http://${window.location.host}`,
9 months ago
tiles_path: window.$mapCfg.tiles_path || "",
tiles_hybrid: window.$mapCfg.tiles_hybrid || "", //卫星瓦片图的地址,为空默认在 offlinemap/tiles_hybrid/ 目录
tiles_self: window.$mapCfg.tiles_self || "", //自定义图层的地址,为空默认在 offlinemap/tiles_self/ 目录
1 year ago
};
//////////////////下面的保持不动///////////////////////////////////
var scripts = document.getElementsByTagName("script");
9 months ago
var JS__FILE__ = scripts[scripts.length - 1].getAttribute("src"); //获得当前js文件路径
1 year ago
bmapcfg.home = JS__FILE__.substr(0, JS__FILE__.lastIndexOf("/") + 1); //地图API主目录
(function () {
9 months ago
window.BMap_loadScriptTime = new Date().getTime();
1 year ago
//加载地图API主文件
9 months ago
document.write(
'<script type="text/javascript" src="' +
bmapcfg.home +
'baiduapi.js"></script>'
);
1 year ago
})();
///////////////////////////////////////////////////////////////////