mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
Merge pull request #11137 from osechet/types-2.0
Fix Openlayers StyleFunction returned type
This commit is contained in:
Vendored
+1
-1
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Vendored
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user