From 514ebb752b3a3ede55f6df0d19ea2f15fdb3dde1 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Wed, 4 Dec 2013 17:21:12 +0100 Subject: [PATCH] Use ol.format.GeoJSON in icon example --- examples/icon.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/icon.js b/examples/icon.js index 4297145edf..377a9a51af 100644 --- a/examples/icon.js +++ b/examples/icon.js @@ -18,9 +18,7 @@ var raster = new ol.layer.Tile({ }) }); -var vectorSource = new ol.source.Vector(); - -new ol.format.GeoJSON().readObject({ +var features = new ol.format.GeoJSON().readFeatures({ 'type': 'FeatureCollection', 'features': [{ 'type': 'Feature', @@ -34,7 +32,11 @@ new ol.format.GeoJSON().readObject({ 'coordinates': [0, 0] } }] -}, vectorSource.addFeature, vectorSource); +}); + +var vectorSource = new ol.source.Vector({ + features: features +}); var styleArray = [new ol.style.Style({ image: ol.icon.renderIcon('data/icon.png')