Merge pull request #12219 from ahocevar/object-properties

Add 'properties' to Layer constructors
This commit is contained in:
Andreas Hocevar
2021-06-17 08:44:53 +02:00
committed by GitHub
13 changed files with 36 additions and 0 deletions

View File

@@ -105,6 +105,25 @@ describe('ol.layer.Layer', function () {
layer.dispose();
});
it('assigns key-value pairs of `properties` to the object', function () {
const o = new Layer({
properties: {
foo: 'bar',
},
});
expect(o.get('foo')).to.be('bar');
expect(o.get('properties')).to.be(undefined);
});
it('can have a `properties` property', function () {
const o = new Layer({
properties: {
properties: {foo: 'bar'},
},
});
expect(o.get('properties')).to.eql({foo: 'bar'});
});
it('throws on non-numeric opacity', function () {
function create() {
new Layer({