Fix drawinteraction example

This commit is contained in:
oterral
2014-01-21 09:38:37 +01:00
committed by Éric Lemoine
parent 8b52adfce3
commit 1333c733e0

View File

@@ -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)
});