<div class='map-wrapper'></div>
this.map = new qq.maps.Map(document.getElementById("map-wrapper"), {
center: new qq.maps.LatLng(latitude, longitude),
zoom: 13,
disableDefaultUI: true
})
this.infoWin = new qq.maps.InfoWindow({
map: this.map
})
var path = [
new qq.maps.LatLng(39.910, 116.399),
new qq.maps.LatLng(39.920, 116.405),
new qq.maps.LatLng(39.930, 116.420)
]
var polygon = new qq.maps.Polyline({
map: map,
path: path,
strokeWeight: 5,
editable: false,
strokeColor: '#12B35D',
})
const cssA = {
backgroundImage: 'url()',
width: '28px',
height: '32px',
backgroundSize: 'cover',
border: 'none',
transform: 'translate(-50%, -100%)'
}
const marker = new qq.maps.LatLng(39.674924, 116.357051)
new qq.maps.Label({
position: marker,
map: this.map,
style: cssA
})
const innerHTML = `<div></div>`
new qq.maps.Label({
position: new qq.maps.LatLng(39.674924, 116.357051),
map: this.map,
content: innerHTML,
style: {}
})
const latlngBounds = new qq.maps.LatLngBounds()
data.map(item => {
latlngBounds.extend(new qq.maps.LatLng(...item))
})
this.map.fitBounds(latlngBounds)