[Leaflet] Correct DivIconOptions html type union (#36841)

* [Leaflet] correct DivIconOptions.html type union (https://leafletjs.com/reference-1.5.0.html#divicon-html)

* Add test for commit 29b2f15

* Replace false option for DivIconOptions.html (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/36841#pullrequestreview-260962388)
This commit is contained in:
Zac Mullett
2019-07-15 10:01:29 -07:00
committed by Andrew Branch
parent f6ddc0feca
commit ea15603c5b
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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;
+3 -1
View File
@@ -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' });