Merge pull request #1433 from tmcw/layer-container

Add a public API for getContainer for TileLayer
This commit is contained in:
Vladimir Agafonkin 2013-02-20 09:48:19 -08:00
commit 3063fd9192
2 changed files with 14 additions and 0 deletions

View File

@ -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);

View File

@ -137,6 +137,10 @@ L.TileLayer = L.Class.extend({
return this.options.attribution;
},
getContainer: function () {
return this._container;
},
setOpacity: function (opacity) {
this.options.opacity = opacity;