* @function MapvLayer.prototype.onAdd * @description 添加图层到地图。 * @param {Object} map - 地图对象。
(map)
| 53 | * @param {Object} map - 地图对象。 |
| 54 | */ |
| 55 | onAdd(map) { |
| 56 | this.map = map; |
| 57 | this.mapContainer = map.getCanvasContainer(); |
| 58 | this.renderer = new MapvRenderer(map, this.dataSet, this.mapVOptions, { |
| 59 | transferCoordinate: this._transferCoordinate, |
| 60 | getCenterPixel: this._getCenterPixel, |
| 61 | getResolution: this._getResolution, |
| 62 | validZoom: this._validZoom.bind(this) |
| 63 | }, { mapElement: this.map.getCanvas(), targetElement: this.mapContainer, id: this.id }); |
| 64 | this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px'; |
| 65 | this.bindEvent(); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @function MapvLayer.prototype.onRemove |
nothing calls this directly
no test coverage detected