diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index abd91b4982..eadcef4b4b 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -1512,7 +1512,7 @@ export namespace Icon { export function icon(options: IconOptions): Icon; export interface DivIconOptions extends BaseIconOptions { - html?: string | false; + html?: string | HTMLElement | false; bgPos?: PointExpression; iconSize?: PointExpression; iconAnchor?: PointExpression; diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index 429062ac3b..b9c48ebd5e 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -482,7 +482,9 @@ class MyDivIcon extends L.DivIcon { } } -const divIcon = L.divIcon({ html: '' }); +const divIconHtmlAsString = L.divIcon({ html: '' }); +const divIconHtmlAsElement = L.divIcon({ html: htmlElement }); +const divIconHtmlAsFalse = L.divIcon({ html: false }); let defaultIcon = new L.Icon.Default(); defaultIcon = new L.Icon.Default({ imagePath: 'apath' });