<div id="map"></div>
<script>
let map = new BMapGL.Map('map')
let point = new BMapGL.Point(116.404, 39.915) // 地图坐标
map.centerAndZoom(point, 16) // 坐标点, 缩放级别
map.enableScrollWheelZoom(true)
map.setMapStyleV2({
styleId: 'f1479cb75b9c850e24c98229cb077a67'
})
let myIcon = new BMapGL.Icon(
'https://www.youbaobao.xyz/datav-res/datav/location.png',
new BMapGL.Size(60, 60),
{
anchor: new BMapGL.Size(0, 0),
imageOffset: new BMapGL.Size(0, 0)
}
)
let marker = new BMapGL.Marker(point, { icon: myIcon })
map.addOverlay(marker)
let polyline = new BMapGL.Polyline([
new BMapGL.Point(116.500, 39.800),
new BMapGL.Point(116.510, 39.820)
])
map.addOverlay(polyline)
</script>