From 305be3c6890ff558870cd08c3356507cbc7ce180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 26 Nov 2013 11:08:22 +0100 Subject: [PATCH] Adapt styleFunction in synthetic-lines example --- examples/synthetic-lines.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/synthetic-lines.js b/examples/synthetic-lines.js index 3ca961cb52..f563115837 100644 --- a/examples/synthetic-lines.js +++ b/examples/synthetic-lines.js @@ -37,17 +37,19 @@ for (i = 0; i < count; ++i) { startPoint = endPoint; } +var styleArray = [new ol.style.Style({ + stroke: new ol.style.Stroke({ + color: '#666666', + width: 1 + }) +})]; + var vector = new ol.layer.Vector({ source: new ol.source.Vector({ features: features }), - styleFunction: function(feature) { - return new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: '#666666', - width: 1 - }) - }); + styleFunction: function(feature, resolution) { + return styleArray; } });