import PubSub from 'pubsub-js';

/** * 加载地图文件 * * 
 * @param {String} url - 地图文件路径 * 
*/
export default function uploadMapData(url) {   
    fetch("./map/map.json")
        .then(res => res.text())
        .then(data => {
            // 处理获取的数据
            let json = JSON.parse(data);
            PubSub.publish("body.draw.loaded", json);
        })
        .catch(error => {
            // 处理错误
            console.error('There was a problem with the fetch operation:', error);
        });
}