Accept flat coordinates in LineString constructor

This commit is contained in:
ahocevar
2018-07-07 16:04:43 +02:00
parent c0d04ea077
commit 160f1bc286
14 changed files with 57 additions and 67 deletions

View File

@@ -105,8 +105,7 @@ describe('ol.rendering.style.Text', function() {
const polygon = [151, 17, 163, 22, 159, 30, 150, 30, 143, 24, 151, 17];
function createLineString(coords, textAlign, maxAngle, strokeColor, strokeWidth, scale) {
let geom = new LineString();
geom.setFlatCoordinates('XY', coords);
let geom = new LineString(coords, 'XY');
let style = new Style({
stroke: new Stroke({
color: 'red'
@@ -262,8 +261,7 @@ describe('ol.rendering.style.Text', function() {
it('renders text along a MultiLineString', function(done) {
createMap('canvas');
let line = new LineString();
line.setFlatCoordinates('XY', nicePath);
let line = new LineString(nicePath, 'XY');
const geom = new MultiLineString(null);
geom.appendLineString(line);
line = line.clone();