Modify render tests to catch regressions

This commit is contained in:
ahocevar
2019-05-05 14:31:01 +02:00
parent 12289b8ef9
commit 1142caf5e8
4 changed files with 167 additions and 74 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -7,6 +7,7 @@ import Point from '../../../src/ol/geom/Point.js';
import Style from '../../../src/ol/style/Style.js';
import Text from '../../../src/ol/style/Text.js';
import CircleStyle from '../../../src/ol/style/Circle.js';
import Fill from '../../../src/ol/style/Fill.js';
import Stroke from '../../../src/ol/style/Stroke.js';
import LineString from '../../../src/ol/geom/LineString.js';
@@ -59,9 +60,10 @@ source1.addFeature(new Feature({
}));
layer1.setStyle(function(feature) {
return new Style({
zIndex: feature.get('zIndex'),
image: new CircleStyle({
radius: 15,
stroke: new Stroke({
fill: new Fill({
color: 'blue'
})
})
@@ -88,15 +90,16 @@ source2.addFeature(new Feature({
}));
layer2.setStyle(function(feature) {
return new Style({
zIndex: feature.get('zIndex'),
text: new Text({
text: feature.get('text'),
font: '16px Ubuntu'
font: 'italic bold 18px Ubuntu'
})
});
});
map.addLayer(layer2);
center = [center[0] + 500, center[1] + 500];
center = [center[0] + 500, center[1] + 300];
source3.addFeature(new Feature({
geometry: new Point(center),
text: 'center'
@@ -112,16 +115,17 @@ source3.addFeature(new Feature({
layer3.setStyle(function(feature) {
return new Style({
image: new CircleStyle({
radius: 5,
radius: 10,
stroke: new Stroke({
color: 'red'
color: 'red',
width: 8
})
}),
text: new Text({
text: feature.get('text'),
font: '16px Ubuntu',
font: 'italic bold 18px Ubuntu',
textBaseline: 'bottom',
offsetY: -5
offsetY: -12
})
});
});
@@ -130,11 +134,12 @@ map.addLayer(layer3);
center = [center[0] - 2000, center[1] - 2000];
const point = new Feature(new Point(center));
point.setStyle(new Style({
zIndex: 2,
zIndex: 1,
image: new CircleStyle({
radius: 8,
stroke: new Stroke({
color: 'blue'
color: 'blue',
width: 4
})
})
}));
@@ -143,7 +148,7 @@ const line = new Feature(new LineString([
[center[0] + 650, center[1] - 200]
]));
line.setStyle(new Style({
zIndex: 1,
zIndex: 2,
stroke: new Stroke({
color: '#CCC',
width: 12
@@ -151,7 +156,7 @@ line.setStyle(new Style({
text: new Text({
placement: 'line',
text: 'east-west',
font: '16px Ubuntu',
font: 'italic bold 18px Ubuntu',
overflow: true
})
}));
@@ -159,4 +164,4 @@ source4.addFeature(point);
source4.addFeature(line);
map.addLayer(layer4);
render({tolerance: 0.02});
render({tolerance: 0.007});