|
|
|
@ -47,17 +47,54 @@ const mapInit = () => { |
|
|
|
map.addControl(new BMap.ScaleControl()); |
|
|
|
map.addControl(new BMap.MapTypeControl()); |
|
|
|
map.enableScrollWheelZoom(); // 启用滚轮放大缩小 |
|
|
|
const point = new BMap.Point(longitude.value,latitude.value); // 创建点坐标 |
|
|
|
map.centerAndZoom(point, 16); |
|
|
|
var marker = new BMap.Marker(point); |
|
|
|
map.addOverlay(marker); |
|
|
|
const points = new BMap.Point(117.14372945240574,35.92808471455389); // 创建点坐标 |
|
|
|
map.centerAndZoom(points, 16); |
|
|
|
var markerd = new BMap.Marker(points); |
|
|
|
map.addOverlay(markerd); |
|
|
|
|
|
|
|
mapHandle(map) |
|
|
|
|
|
|
|
// const point = new BMap.Point(longitude.value,latitude.value); // 创建点坐标 |
|
|
|
// map.centerAndZoom(point, 16); |
|
|
|
// var label = new BMap.Label("山东恒信高科", { // 创建文本标注 |
|
|
|
// position: point, // 设置标注的地理位置 |
|
|
|
// offset: new BMap.Size(10, 20) // 设置标注的偏移量 |
|
|
|
// }).addEventListener("click", function(){ |
|
|
|
// alert("您点击了标注"); |
|
|
|
// }); |
|
|
|
|
|
|
|
// // var marker = new BMap.Marker(point); |
|
|
|
// map.addOverlay(label); |
|
|
|
// const points = new BMap.Point(117.14372945240574,35.92808471455389); // 创建点坐标 |
|
|
|
// map.centerAndZoom(points, 16); |
|
|
|
// var markerd = new BMap.Marker(points); |
|
|
|
// map.addOverlay(markerd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ 作者: 秦东 |
|
|
|
@ 时间: 2024-07-19 15:31:05 |
|
|
|
@ 功能: 处理地图时间 |
|
|
|
*/ |
|
|
|
const mapHandle = (map:any) => { |
|
|
|
let blz = [] |
|
|
|
for(var i = 1; i < 5;){ |
|
|
|
const points = new BMap.Point(117.14372945240574,35.92808471455389+i); // 创建点坐标 |
|
|
|
map.centerAndZoom(points, 16); |
|
|
|
// var markerd = new BMap.Marker(points); |
|
|
|
// map.addOverlay(markerd); |
|
|
|
// let blz = "label"+i |
|
|
|
blz[i] = new BMap.Label("山东恒信高科"+i, { // 创建文本标注 |
|
|
|
position: points, // 设置标注的地理位置 |
|
|
|
offset: new BMap.Size(10, 20) // 设置标注的偏移量 |
|
|
|
}) |
|
|
|
blz[i].addEventListener("click", function(){ |
|
|
|
alert(i); |
|
|
|
}); |
|
|
|
map.addOverlay(blz[i]); |
|
|
|
i++ |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() =>{ |
|
|
|
loadJScript() |
|
|
|
}) |
|
|
|
|