From 478ef05b4fcba9d1d8a33c1a0cf55f47b9ae6962 Mon Sep 17 00:00:00 2001 From: MateuszSapielakGSI <41114042+MateuszSapielakGSI@users.noreply.github.com> Date: Tue, 24 Jul 2018 17:03:10 +0100 Subject: [PATCH] OpenLayers - allow null in setStyle() (#27485) * Update index.d.ts allow null as per method description * update setStyle for layers and add a test --- types/openlayers/index.d.ts | 4 ++-- types/openlayers/openlayers-tests.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index a4d4f52d5e..a6122c8477 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -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; } /** diff --git a/types/openlayers/openlayers-tests.ts b/types/openlayers/openlayers-tests.ts index d97a96c9de..fcf925886d 100644 --- a/types/openlayers/openlayers-tests.ts +++ b/types/openlayers/openlayers-tests.ts @@ -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);