MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / mockCreateTile

Function mockCreateTile

test/tool/mock_leaflet.js:2–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import L from "leaflet";
2export 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}
19export function mockInitImage() {
20 L.ImageOverlay.prototype._initImage=function () {
21 this._image = L.DomUtil.create('img', 'leaflet-image-layer');

Callers 10

initMapSpec.jsFile · 0.90
WebMapSpec.jsFile · 0.90
LogoSpec.jsFile · 0.90

Calls 4

createElementMethod · 0.80
bindMethod · 0.80
getTileUrlMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected