Add public getContainer API to TileLayer, and test for it.
This commit is contained in:
parent
0b14d71d7a
commit
8735b87980
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user