* @function ThemeLayer.prototype.onAdd * @description 添加该图层。
(map)
| 85 | * @description 添加该图层。 |
| 86 | */ |
| 87 | onAdd(map) { |
| 88 | this.map = map; |
| 89 | this._createCanvasContainer(); |
| 90 | |
| 91 | //处理用户预先(在图层添加到 map 前)监听的事件 |
| 92 | this.addTFEvents(); |
| 93 | this.map.on('resize', this.resizeEvent.bind(this)); |
| 94 | this.map.on('zoomstart', this.zoomStartEvent.bind(this)); |
| 95 | this.map.on('zoomend', this.zoomEndEvent.bind(this)); |
| 96 | this.map.on('rotatestart', this.rotateStartEvent.bind(this)); |
| 97 | this.map.on('rotate', this.rotateEvent.bind(this)); |
| 98 | this.map.on('rotateend', this.rotateEndEvent.bind(this)); |
| 99 | this.map.on('dragend', this.dragEndEvent.bind(this)); |
| 100 | this.map.on('movestart', this.moveStartEvent.bind(this)); |
| 101 | this.map.on('move', this.moveEvent.bind(this)); |
| 102 | this.map.on('moveend', this.moveEndEvent.bind(this)); |
| 103 | this.map.on('remove', this.removeFromMap.bind(this)); |
| 104 | |
| 105 | this.refresh(); |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * @function ThemeLayer.prototype.refresh |
nothing calls this directly
no test coverage detected