diff --git a/spec/suites/layer/TileLayerSpec.js b/spec/suites/layer/TileLayerSpec.js index 16af778c..4e9f47e2 100644 --- a/spec/suites/layer/TileLayerSpec.js +++ b/spec/suites/layer/TileLayerSpec.js @@ -19,6 +19,16 @@ describe('TileLayer', function () { expect(map.getMinZoom()).toBe(minZoom); }); }); + + describe("accessing a tilelayer's properties", function () { + it('provides a container', function () { + map.setView([0, 0], 1); + + var layer = L.tileLayer("{z}{x}{y}").addTo(map); + expect(layer.getContainer()).toBeTruthy(); + }); + }); + describe("when a tilelayer is added to a map that already has a tilelayer", function () { it("has its zoomlevels updated to fit the new layer", function () { map.setView([0, 0], 1); diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 25c655c5..ac85bc52 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -122,6 +122,10 @@ L.TileLayer = L.Class.extend({ return this.options.attribution; }, + getContainer: function () { + return this._container; + }, + setOpacity: function (opacity) { this.options.opacity = opacity;