This commit is contained in:
parent
a710409561
commit
213a9715a3
|
@ -323,10 +323,11 @@ var map = null;
|
|||
const BMAP = () => {
|
||||
// 添加鼠标点击事件监听器
|
||||
map.addEventListener("click", function (e) {
|
||||
console.log(e.point, 666);
|
||||
// console.log(e.latlng, 666);
|
||||
console.log(e.point.latLng.lng,e.point.latLng.lat, 666);
|
||||
var pt = e.point; // 获取点击的坐标
|
||||
var marker = new BMapGL.Marker(pt); // 创建标注
|
||||
// map.addOverlay(marker);
|
||||
var marker = new BMapGL.Marker(new BMapGL.Point(e.point.latLng.lng,e.point.latLng.lat)); // 创建点
|
||||
// var marker = new BMapGL.Marker(pt); // 创建标注
|
||||
map.addOverlay(marker); // 将标注添加到地图中
|
||||
});
|
||||
};
|
||||
|
@ -336,13 +337,13 @@ const initMap = () => {
|
|||
map.enableScrollWheelZoom(true);
|
||||
map.setMapType(BMAP_EARTH_MAP);
|
||||
goMapCenter([119.178783, 29.034583], 12);
|
||||
BMAP();
|
||||
//加载乡镇信息
|
||||
loadTown();
|
||||
//渲染地块
|
||||
addPolygonCounty();
|
||||
//添加街道名
|
||||
addJd();
|
||||
BMAP();
|
||||
};
|
||||
const loadTown = () => {
|
||||
for (let v of mapTown.features) {
|
||||
|
|
Loading…
Reference in New Issue