diff --git a/leaflet/index.d.ts b/leaflet/index.d.ts index bf6f9103a1..66a18a7e4c 100644 --- a/leaflet/index.d.ts +++ b/leaflet/index.d.ts @@ -406,7 +406,7 @@ declare namespace L { getPane(name?: string): HTMLElement; // Popup methods - bindPopup(content: (layer: Layer) => Content | Content | Popup, options?: PopupOptions): this; + bindPopup(content: ((layer: Layer) => Content) | Content | Popup, options?: PopupOptions): this; unbindPopup(): this; openPopup(latlng?: LatLngExpression): this; closePopup(): this; @@ -416,7 +416,7 @@ declare namespace L { getPopup(): Popup; // Tooltip methods - bindTooltip(content: (layer: Layer) => Content | Tooltip | Content, options?: TooltipOptions): this; + bindTooltip(content: ((layer: Layer) => Content) | Tooltip | Content, options?: TooltipOptions): this; unbindTooltip(): this; openTooltip(latlng?: LatLngExpression): this; closeTooltip(): this; @@ -1098,7 +1098,7 @@ declare namespace L { getLatLng(): LatLng; setLatLng(latlng: LatLngExpression): this; getContent(): Content; - setContent(htmlContent: (source: Layer) => Content | Content): this; + setContent(htmlContent: ((source: Layer) => Content) | Content): this; getElement(): HTMLElement; update(): void; isOpen(): boolean; @@ -1129,7 +1129,7 @@ declare namespace L { getLatLng(): LatLng; setLatLng(latlng: LatLngExpression): this; getContent(): Content; - setContent(htmlContent: (source: Layer) => Content | Content): this; + setContent(htmlContent: ((source: Layer) => Content) | Content): this; getElement(): HTMLElement; update(): void; isOpen(): boolean; @@ -1464,7 +1464,7 @@ declare namespace L { riseOnHover?: boolean; riseOffset?: number; - options: DivIconOptions; + options?: DivIconOptions; } export class Marker extends Layer { diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index 0c1122f6fc..8d9b91e37b 100644 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -434,3 +434,9 @@ export class MyNewControl extends L.Control { }); } } + +L.marker([1, 2], { + icon: L.icon({ + iconUrl: 'my-icon.png' + }) +}).bindPopup('
Hi
');