官方文档 :http://lbsyun.baidu.com/index.php?title=uri/api/web
API http://api.map.baidu.com/marker?location=40.047669,116.313082&title=故障位置&output=html&src=webapp.baidu.openAPIdemo
实例
//应用场景 项目内创建百度地图显示坐标,点击地图后,打开新页面显示该坐标
源码
let point =new BMap.Point(latitude,longitude)
let map = new BMap.Map('malfunctionMap'); // 创建Map实例 new BMapGL.Point(116.404, 39.915)
map.centerAndZoom(point, 12); // 初始化地图,设置中心点坐标和地图级别
map.enableScrollWheelZoom(true)
map.disableDragging();
let marker1 = new BMap.Marker(point)
map.addOverlay(marker1)
let location = v.longitude+ ',' + v.latitude
map.addEventListener('click', function (e) {
//跳转方式->打开新页面
window.open(`http://api.map.baidu.com/marker?location=${location}&title=故障位置&content=详细坐标&output=html&src=webapp.baidu.openAPIdemo`)