@action setIconNum = (pointOut, indexOut, name) => {
let map = this.map
function ComplexCustomOverlay(point, index, name) {
this._point = point
this._index = index
this._name = name
this._map = map
}
ComplexCustomOverlay.prototype = new BMap.Overlay()
ComplexCustomOverlay.prototype.initialize = function (map) {
let span = this._span = document.createElement("span")
span.className = `${this._name}${this._index}`
$(span).css({
'position': 'absolute',
'z-index': "3",
'display': 'block',
'width': '26px',
'color': '#FFF',
'text-align': 'center',
'point-events': 'none',
'font-size': `11px`
})
this._span.innerHTML = this._index + 1
map.getPanes().labelPane.appendChild(span)
return span
}
ComplexCustomOverlay.prototype.draw = function () {
var map = this._map
var pixel = map.pointToOverlayPixel(this._point)
this._span.style.left = pixel.x - 13 + 'px'
this._span.style.top = pixel.y - 11 + 'px'
}
let myCompOverlay = new ComplexCustomOverlay(pointOut, indexOut, name)
this.myCompOverlayArr.push(myCompOverlay)
this.map.addOverlay(myCompOverlay)
}