第三方通过坐标跳转到百度地图并标记坐标点

官方文档 :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`)
		
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值