style.css
css{box-sizing: border-box;
}body {font-family: Arial, sans-serif;
}.container {display: flex;justify-content: space-around;
}.list {width: 50%;
}ul {list-style-type: none;padding: 0;margin: 0;
}a {text-decoration: none;color: 000;
}span {display: block;margin-top: 5px;
}.map {width: 50%;height: 500px;
}map {width: 100%;height: 100%;
}script.js
js
// 初始化地图
var map = L.map('map').setView([纬度, 经度], 15);// 添加图层
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '©
OpenStreetMap
contributors'
}).addTo(map);// 添加标记
var markers = [];// 获取店铺信息并添加标记
var shops = [{name: "店铺名称",address: "店铺地址",location: [纬度, 经度]},// 其他店铺信息按此格式继续添加
];for (var i = 0; i < shops.length; i++) {var marker = L.marker(shops[i].location).addTo(map);markers.push(marker);marker.bindPopup("
" + shops[i].name + "
" + shops[i].address);
}