From 18c06572924166742bfac87b748237b6442d0139 Mon Sep 17 00:00:00 2001 From: Florian Bischof Date: Thu, 28 Dec 2023 12:38:21 +0100 Subject: [PATCH] Fix formatting --- spec/suites/layer/tile/TileLayerSpec.js | 12 ++++++------ src/layer/tile/TileLayer.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/suites/layer/tile/TileLayerSpec.js b/spec/suites/layer/tile/TileLayerSpec.js index 004bb0ebd..fe21c7ec1 100644 --- a/spec/suites/layer/tile/TileLayerSpec.js +++ b/spec/suites/layer/tile/TileLayerSpec.js @@ -512,14 +512,14 @@ describe('TileLayer', () => { }); }); - describe('#getTileUrl', function () { - it('can call with static coords', function () { + describe('#getTileUrl', () => { + it('can call with static coords', () => { // Layer is not added to the map - var layer = L.tileLayer('http://example.com/{z}/{x}/{y}.png'); - var url = layer.getTileUrl({z: 1, x: 2, y: 3}); + const layer = new TileLayer('http://example.com/{z}/{x}/{y}.png'); + let url = layer.getTileUrl({z: 1, x: 2, y: 3}); expect(url).to.equal('http://example.com/1/2/3.png'); - layer.addTo(map) - var url = layer.getTileUrl({z: 1, x: 2, y: 3}); + layer.addTo(map); + url = layer.getTileUrl({z: 1, x: 2, y: 3}); expect(url).to.equal('http://example.com/1/2/3.png'); }); }); diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 6f62b7c31..db6e1992f 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -210,7 +210,7 @@ export const TileLayer = GridLayer.extend({ e.tile.onload = null; }, - _getZoomForUrl: function (zoom) { + _getZoomForUrl(zoom) { const maxZoom = this.options.maxZoom, zoomReverse = this.options.zoomReverse, zoomOffset = this.options.zoomOffset;