From 82aa5cc675817dada4893b86ce91069948b329c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 26 Nov 2013 11:05:23 +0100 Subject: [PATCH] Adapt styleFunction in rtree example --- examples/rtree.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/rtree.js b/examples/rtree.js index fc59d1f1d1..07fd1fa12d 100644 --- a/examples/rtree.js +++ b/examples/rtree.js @@ -29,10 +29,10 @@ var vectorSource = new ol.source.Vector({ features: features }); -var style = new ol.style.Style({ +var styleArray = [new ol.style.Style({ image: ol.shape.renderCircle(3, null, new ol.style.Stroke({color: 'red', width: 1})) -}); +})]; var colors = ['red', 'orange', 'yellow', 'blue', 'green', 'indigo', 'violet']; var depthStyle = []; @@ -73,7 +73,7 @@ for (i = 0, ii = extentsByDepth.length; i < ii; ++i) { ]]); var feature = new ol.Feature({ 'geometry': geometry, - 'style': depthStyle[i] + 'styleArray': [depthStyle[i]] }); rtreeExtentFeatures.push(feature); } @@ -81,8 +81,8 @@ for (i = 0, ii = extentsByDepth.length; i < ii; ++i) { var vector = new ol.layer.Vector({ source: vectorSource, - styleFunction: function(feature) { - return style; + styleFunction: function(feature, resolution) { + return styleArray; } }); @@ -90,8 +90,8 @@ var rtree = new ol.layer.Vector({ source: new ol.source.Vector({ features: rtreeExtentFeatures }), - styleFunction: function(feature) { - return feature.get('style'); + styleFunction: function(feature, resolution) { + return feature.get('styleArray'); } });