* @function HeatMapLayer.prototype.onAdd * @description 添加该图层。
(map)
| 86 | * @description 添加该图层。 |
| 87 | */ |
| 88 | onAdd(map) { |
| 89 | this.map = map; |
| 90 | const targetElement = this.map.getCanvasContainer(); |
| 91 | const mapElement = this.map.getCanvas(); |
| 92 | this.renderer = new HeatMapLayerRenderer({ id: this.id, ...this.options, convertLatlonToPixel: this._convertLatlonToPixel.bind(this), targetElement, mapElement }); |
| 93 | if (this.features.features && this.features.features.length) { |
| 94 | this.renderer.setExtent(this.map.getBounds()); |
| 95 | this.renderer.addFeatures(this.features); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * @function HeatMapLayer.prototype.removeFromMap |
nothing calls this directly
no test coverage detected