| 36 | export class MapvLayer extends BaiduMapLayer { |
| 37 | |
| 38 | constructor(map, dataSet, options, mapWidth, mapHeight, source) { |
| 39 | super(map, dataSet, options); |
| 40 | this.dataSet = dataSet; |
| 41 | this.mapWidth = mapWidth; |
| 42 | this.mapHeight = mapHeight; |
| 43 | var self = this; |
| 44 | options = options || {}; |
| 45 | this.source = source; |
| 46 | self.animator = null; |
| 47 | self.map = map; |
| 48 | self.init(options); |
| 49 | self.argCheck(options); |
| 50 | this.canvasLayer = new MapvCanvasLayer({ |
| 51 | map: map, |
| 52 | context: this.context, |
| 53 | paneName: options.paneName, |
| 54 | mixBlendMode: options.mixBlendMode, |
| 55 | enableMassClear: options.enableMassClear, |
| 56 | zIndex: options.zIndex, |
| 57 | width: mapWidth, |
| 58 | height: mapHeight, |
| 59 | update: function update() { |
| 60 | self._canvasUpdate(); |
| 61 | } |
| 62 | }); |
| 63 | this.clickEvent = this.clickEvent.bind(this); |
| 64 | this.mousemoveEvent = this.mousemoveEvent.bind(this); |
| 65 | map.on('movestart', this.moveStartEvent.bind(this)); |
| 66 | map.on('moveend', this.moveEndEvent.bind(this)); |
| 67 | map.getView().on('change:center', this.zoomEvent.bind(this)); |
| 68 | map.getView().on('change:size', this.sizeEvent.bind(this)); |
| 69 | map.on('pointerdrag', this.dragEvent.bind(this)); |
| 70 | this.bindEvent(); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @function MapvLayer.prototype.init |