Merge pull request #12219 from ahocevar/object-properties
Add 'properties' to Layer constructors
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user