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