diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index a70f3b115b..2c0367e7b7 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -4495,7 +4495,7 @@ declare namespace ol { /** * A function that takes an ol.Feature and a {number} representing the view's resolution. The function should return an array of ol.style.Style. This way e.g. a vector layer can be styled. */ - interface StyleFunction { (feature: ol.Feature, resolution: number): ol.style.Style } + interface StyleFunction { (feature: ol.Feature, resolution: number): ol.style.Style | ol.style.Style[] } } namespace tilegrid { diff --git a/openlayers/openlayers-3.14.2-tests.ts b/openlayers/openlayers-3.14.2-tests.ts index 1bfdc4bf63..69c44b82d6 100644 --- a/openlayers/openlayers-3.14.2-tests.ts +++ b/openlayers/openlayers-3.14.2-tests.ts @@ -685,6 +685,16 @@ draw = new ol.interaction.Draw({ type: "Point", style: styleFunction }); +var styleFunctionAsStyle = function(feature: ol.Feature, resolution: number): ol.style.Style { return style; } +draw = new ol.interaction.Draw({ + type: "Point", + style: styleFunctionAsStyle +}); +var styleFunctionAsArray = function(feature: ol.Feature, resolution: number): ol.style.Style[] { return styleArray; } +draw = new ol.interaction.Draw({ + type: "Point", + style: styleFunctionAsArray +}); var dragbox: ol.interaction.DragBox = new ol.interaction.DragBox({ className: stringValue, diff --git a/openlayers/openlayers-3.14.2.d.ts b/openlayers/openlayers-3.14.2.d.ts index 5046e1fa8f..23b25f8a2e 100644 --- a/openlayers/openlayers-3.14.2.d.ts +++ b/openlayers/openlayers-3.14.2.d.ts @@ -4651,7 +4651,7 @@ declare namespace ol { /** * A function that takes an ol.Feature and a {number} representing the view's resolution. The function should return an array of ol.style.Style. This way e.g. a vector layer can be styled. */ - interface StyleFunction { (feature: ol.Feature, resolution: number): ol.style.Style } + interface StyleFunction { (feature: ol.Feature, resolution: number): ol.style.Style | ol.style.Style[] } } namespace tilegrid {