Transformed
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
|
||||
|
||||
goog.require('ol.style.AtlasManager');
|
||||
goog.require('ol.style.RegularShape');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Stroke');
|
||||
import _ol_style_AtlasManager_ from '../../../../src/ol/style/AtlasManager.js';
|
||||
import _ol_style_RegularShape_ from '../../../../src/ol/style/RegularShape.js';
|
||||
import _ol_style_Fill_ from '../../../../src/ol/style/Fill.js';
|
||||
import _ol_style_Stroke_ from '../../../../src/ol/style/Stroke.js';
|
||||
|
||||
|
||||
describe('ol.style.RegularShape', function() {
|
||||
@@ -11,7 +9,7 @@ describe('ol.style.RegularShape', function() {
|
||||
describe('#constructor', function() {
|
||||
|
||||
it('can use rotateWithView', function() {
|
||||
var style = new ol.style.RegularShape({
|
||||
var style = new _ol_style_RegularShape_({
|
||||
rotateWithView: true,
|
||||
radius: 0
|
||||
});
|
||||
@@ -19,7 +17,7 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('can use radius', function() {
|
||||
var style = new ol.style.RegularShape({
|
||||
var style = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
radius2: 10
|
||||
});
|
||||
@@ -28,7 +26,7 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('can use radius1 as an alias for radius', function() {
|
||||
var style = new ol.style.RegularShape({
|
||||
var style = new _ol_style_RegularShape_({
|
||||
radius1: 5,
|
||||
radius2: 10
|
||||
});
|
||||
@@ -37,7 +35,7 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('creates a canvas if no atlas is used (no fill-style)', function() {
|
||||
var style = new ol.style.RegularShape({radius: 10});
|
||||
var style = new _ol_style_RegularShape_({radius: 10});
|
||||
expect(style.getImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getSize()).to.eql([21, 21]);
|
||||
expect(style.getImageSize()).to.eql([21, 21]);
|
||||
@@ -50,9 +48,9 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('creates a canvas if no atlas is used (fill-style)', function() {
|
||||
var style = new ol.style.RegularShape({
|
||||
var style = new _ol_style_RegularShape_({
|
||||
radius: 10,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#FFFF00'
|
||||
})
|
||||
});
|
||||
@@ -68,8 +66,8 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('adds itself to an atlas manager (no fill-style)', function() {
|
||||
var atlasManager = new ol.style.AtlasManager({initialSize: 512});
|
||||
var style = new ol.style.RegularShape(
|
||||
var atlasManager = new _ol_style_AtlasManager_({initialSize: 512});
|
||||
var style = new _ol_style_RegularShape_(
|
||||
{radius: 10, atlasManager: atlasManager});
|
||||
expect(style.getImage()).to.be.an(HTMLCanvasElement);
|
||||
expect(style.getSize()).to.eql([21, 21]);
|
||||
@@ -83,11 +81,11 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('adds itself to an atlas manager (fill-style)', function() {
|
||||
var atlasManager = new ol.style.AtlasManager({initialSize: 512});
|
||||
var style = new ol.style.RegularShape({
|
||||
var atlasManager = new _ol_style_AtlasManager_({initialSize: 512});
|
||||
var style = new _ol_style_RegularShape_({
|
||||
radius: 10,
|
||||
atlasManager: atlasManager,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#FFFF00'
|
||||
})
|
||||
});
|
||||
@@ -106,17 +104,17 @@ describe('ol.style.RegularShape', function() {
|
||||
describe('#clone', function() {
|
||||
|
||||
it('creates a new ol.style.RegularShape', function() {
|
||||
var original = new ol.style.RegularShape({
|
||||
var original = new _ol_style_RegularShape_({
|
||||
points: 5
|
||||
});
|
||||
var clone = original.clone();
|
||||
expect(clone).to.be.an(ol.style.RegularShape);
|
||||
expect(clone).to.be.an(_ol_style_RegularShape_);
|
||||
expect(clone).to.not.be(original);
|
||||
});
|
||||
|
||||
it('copies all values', function() {
|
||||
var original = new ol.style.RegularShape({
|
||||
fill: new ol.style.Fill({
|
||||
var original = new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
points: 5,
|
||||
@@ -124,7 +122,7 @@ describe('ol.style.RegularShape', function() {
|
||||
radius2: 6,
|
||||
angle: 1,
|
||||
snapToPixel: false,
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
rotation: 2,
|
||||
@@ -147,11 +145,11 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('the clone does not reference the same objects as the original', function() {
|
||||
var original = new ol.style.RegularShape({
|
||||
fill: new ol.style.Fill({
|
||||
var original = new _ol_style_RegularShape_({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
@@ -170,11 +168,11 @@ describe('ol.style.RegularShape', function() {
|
||||
describe('#getChecksum', function() {
|
||||
|
||||
it('calculates not the same hash code (radius)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 4,
|
||||
radius2: 5
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 3,
|
||||
radius2: 5
|
||||
});
|
||||
@@ -182,11 +180,11 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('calculates not the same hash code (radius2)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 4,
|
||||
radius2: 5
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 4,
|
||||
radius2: 6
|
||||
});
|
||||
@@ -194,25 +192,25 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('calculates the same hash code (radius)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 5
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 5
|
||||
});
|
||||
expect(style1.getChecksum()).to.eql(style2.getChecksum());
|
||||
});
|
||||
|
||||
it('calculates not the same hash code (color)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
@@ -220,15 +218,15 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('calculates the same hash code (everything set)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
radius2: 3,
|
||||
angle: 1.41,
|
||||
points: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3',
|
||||
lineCap: 'round',
|
||||
lineDash: [5, 15, 25],
|
||||
@@ -237,15 +235,15 @@ describe('ol.style.RegularShape', function() {
|
||||
width: 2
|
||||
})
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
radius2: 3,
|
||||
angle: 1.41,
|
||||
points: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3',
|
||||
lineCap: 'round',
|
||||
lineDash: [5, 15, 25],
|
||||
@@ -258,15 +256,15 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('calculates not the same hash code (stroke width differs)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
radius2: 3,
|
||||
angle: 1.41,
|
||||
points: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3',
|
||||
lineCap: 'round',
|
||||
lineDash: [5, 15, 25],
|
||||
@@ -275,15 +273,15 @@ describe('ol.style.RegularShape', function() {
|
||||
width: 3
|
||||
})
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
radius2: 3,
|
||||
angle: 1.41,
|
||||
points: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3',
|
||||
lineCap: 'round',
|
||||
lineDash: [5, 15, 25],
|
||||
@@ -296,21 +294,21 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('invalidates a cached checksum if values change (fill)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
@@ -321,21 +319,21 @@ describe('ol.style.RegularShape', function() {
|
||||
});
|
||||
|
||||
it('invalidates a cached checksum if values change (stroke)', function() {
|
||||
var style1 = new ol.style.RegularShape({
|
||||
var style1 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
var style2 = new ol.style.RegularShape({
|
||||
var style2 = new _ol_style_RegularShape_({
|
||||
radius: 5,
|
||||
fill: new ol.style.Fill({
|
||||
fill: new _ol_style_Fill_({
|
||||
color: '#319FD3'
|
||||
}),
|
||||
stroke: new ol.style.Stroke({
|
||||
stroke: new _ol_style_Stroke_({
|
||||
color: '#319FD3'
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user