Merge pull request #1433 from tmcw/layer-container
Add a public API for getContainer for TileLayer
This commit is contained in:
commit
3063fd9192
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user