Merge pull request #14750 from ccurrens/leafletjs-marker-icon-types

leaflet: Update marker classes to accept both Icon and DivIcon
This commit is contained in:
Mine Starks 2017-03-07 15:54:19 -08:00 committed by GitHub
commit dc81dd25e0
2 changed files with 14 additions and 2 deletions

4
leaflet/index.d.ts vendored
View File

@ -1466,7 +1466,7 @@ declare namespace L {
export function divIcon(options?: DivIconOptions): DivIcon;
export interface MarkerOptions extends InteractiveLayerOptions {
icon?: Icon;
icon?: Icon | DivIcon;
clickable?: boolean;
draggable?: boolean;
keyboard?: boolean;
@ -1483,7 +1483,7 @@ declare namespace L {
getLatLng(): LatLng;
setLatLng(latlng: LatLngExpression): this;
setZIndexOffset(offset: number): this;
setIcon(icon: Icon): this;
setIcon(icon: Icon | DivIcon): this;
setOpacity(opacity: number): this;
getElement(): HTMLElement;

View File

@ -448,6 +448,17 @@ L.marker([1, 2], {
})
}).bindPopup('<p>Hi</p>');
L.marker([1, 2], {
icon: L.divIcon({
className: 'my-icon-class'
})
}).setIcon(L.icon({
iconUrl: 'my-icon.png'
})).setIcon(L.divIcon({
className: 'my-div-icon'
}));;
L.Util.extend({});
L.Util.create({});
L.Util.bind(() => {}, {});
@ -466,3 +477,4 @@ L.Util.indexOf([], {});
L.Util.requestAnimFrame(() => {});
L.Util.cancelAnimFrame(1);
L.Util.emptyImageUrl;