()
| 1 | import L from "leaflet"; |
| 2 | export function mockCreateTile() { |
| 3 | L.TileLayer.prototype.createTile=function (coords, done) { |
| 4 | var tile = document.createElement('img'); |
| 5 | |
| 6 | L.DomEvent.on(tile, 'load', L.Util.bind(this._tileOnLoad, this, done, tile)); |
| 7 | L.DomEvent.on(tile, 'error', L.Util.bind(this._tileOnError, this, done, tile)); |
| 8 | |
| 9 | if (this.options.crossOrigin || this.options.crossOrigin === '') { |
| 10 | tile.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin; |
| 11 | } |
| 12 | tile.alt = ''; |
| 13 | tile.setAttribute('role', 'presentation'); |
| 14 | tile.src = 'base/resources/img/baiduTileTest.png'; |
| 15 | this.getTileUrl(coords); |
| 16 | return tile; |
| 17 | }; |
| 18 | } |
| 19 | export function mockInitImage() { |
| 20 | L.ImageOverlay.prototype._initImage=function () { |
| 21 | this._image = L.DomUtil.create('img', 'leaflet-image-layer'); |
no test coverage detected