OpenLayers - allow null in setStyle() (#27485)

* Update index.d.ts

allow null as per method description

* update setStyle for layers and add a test
This commit is contained in:
MateuszSapielakGSI
2018-07-24 09:03:10 -07:00
committed by Andy
parent c081a1380d
commit 478ef05b4f
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -1734,7 +1734,7 @@ export class Feature extends Object {
* @api stable
* @observable
*/
setStyle(style: (ol.style.Style | ol.style.Style[] | ol.FeatureStyleFunction | ol.StyleFunction)): void;
setStyle(style: (ol.style.Style | ol.style.Style[] | ol.FeatureStyleFunction | ol.StyleFunction | null)): void;
/**
* Set the feature id. The feature id is considered stable and may be used when
@@ -6424,7 +6424,7 @@ export namespace layer {
* @param style Layer style.
* @api stable
*/
setStyle(style: (ol.style.Style | ol.style.Style[] | ol.StyleFunction)): void;
setStyle(style: (ol.style.Style | ol.style.Style[] | ol.StyleFunction | null)): void;
}
/**
+1
View File
@@ -411,6 +411,7 @@ feature.setGeometry(geometry);
feature.setGeometryName(stringValue);
feature.setId(stringValue);
feature.setId(numberValue);
feature.setStyle(null);
feature.setStyle(style);
feature.setStyle(styleArray);
feature.setStyle(featureStyleFunction);