LSSE-front/public/map3.0_init.js
2025-08-06 19:10:12 +08:00

34 lines
1.3 KiB
JavaScript
Vendored
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 离线API初始化, 请在加载map3.0.js之前引入
*/
/**
* 这是必须要确认的配置
* 瓦片图必须是png图像
*/
var bmapConfig = {
'tiles_path': 'http://192.168.0.113:8080/mapSZ', //显示普通地图,为空默认在 tiles/ 目录
tiles_satellite_path: '', //显示卫星影像,为空默认在 tiles_satellite/ ,只有底图没有地址标注
tiles_hybrid_path: '' //显示带有街道的卫星影像,为空默认在 tiles_hybrid/,需和卫星影像配合使用
}
//获得API主目录一般不需要修改
var scripts = document.getElementsByTagName('script')
var _JS__FILE__ = scripts[scripts.length - 1].getAttribute('src')
bmapConfig.home_dir = _JS__FILE__.substr(0, _JS__FILE__.lastIndexOf('/'))
if( bmapConfig.tiles_path.length == 0 ){
// bmapConfig.tiles_path = bmapConfig.home_dir + "/tiles";
bmapConfig.tiles_path = bmapConfig.home_dir + '/mapdata'
}
if( bmapConfig.tiles_satellite_path.length == 0 ){
bmapConfig.tiles_satellite_path = bmapConfig.home_dir + '/tiles_satellite'
}
if( bmapConfig.tiles_hybrid_path.length == 0 ){
bmapConfig.tiles_hybrid_path = bmapConfig.home_dir + '/tiles_hybird'
}
//调试日志,请保留
function bmapLog(s){
if(typeof console != 'undefined')
console.log('>>> '+s)
}