From 1333c733e0d6c8b51f5a64730e82894c1378fb97 Mon Sep 17 00:00:00 2001 From: oterral Date: Tue, 21 Jan 2014 09:38:37 +0100 Subject: [PATCH] Fix drawinteraction example --- examples/draw-features.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/draw-features.js b/examples/draw-features.js index 76fde2ebc9..31d658dd9c 100644 --- a/examples/draw-features.js +++ b/examples/draw-features.js @@ -32,8 +32,10 @@ var styleArray = [new ol.style.Style({ }) })]; +var source = new ol.source.Vector(); + var vector = new ol.layer.Vector({ - source: new ol.source.Vector(), + source: source, styleFunction: function(feature, resolution) { return styleArray; } @@ -54,7 +56,7 @@ var typeSelect = document.getElementById('type'); var draw; // global so we can remove it later function addInteraction() { draw = new ol.interaction.Draw({ - layer: vector, + source: source, type: /** @type {ol.geom.GeometryType} */ (typeSelect.options[typeSelect.selectedIndex].value) });