mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Added support for className option in ImageOverlayOptions. (#27077)
ImageOverlayOptions extends InteractiveLayerOptions as described in Leaflet docs. Added bubblingMouseEvents option to InteractiveLayerOptions.
This commit is contained in:
4
types/leaflet/index.d.ts
vendored
4
types/leaflet/index.d.ts
vendored
@@ -390,6 +390,7 @@ export interface LayerOptions {
|
||||
|
||||
export interface InteractiveLayerOptions extends LayerOptions {
|
||||
interactive?: boolean;
|
||||
bubblingMouseEvents?: boolean;
|
||||
}
|
||||
|
||||
export class Layer extends Evented {
|
||||
@@ -542,12 +543,13 @@ export namespace tileLayer {
|
||||
function wms(baseUrl: string, options?: WMSOptions): TileLayer.WMS;
|
||||
}
|
||||
|
||||
export interface ImageOverlayOptions extends LayerOptions {
|
||||
export interface ImageOverlayOptions extends InteractiveLayerOptions {
|
||||
opacity?: number;
|
||||
alt?: string;
|
||||
interactive?: boolean;
|
||||
attribution?: string;
|
||||
crossOrigin?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export class ImageOverlay extends Layer {
|
||||
|
||||
@@ -251,6 +251,29 @@ tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png');
|
||||
tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', tileLayerOptions);
|
||||
tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''});
|
||||
|
||||
// imageOverlay
|
||||
let imageOverlayOptions: L.ImageOverlayOptions;
|
||||
imageOverlayOptions = {
|
||||
opacity: 100,
|
||||
alt: 'alt',
|
||||
interactive: true,
|
||||
attribution: 'attribution',
|
||||
crossOrigin: true,
|
||||
className: 'className',
|
||||
bubblingMouseEvents: false,
|
||||
pane: 'pane'
|
||||
};
|
||||
|
||||
const imageOverlayBounds = latLngBounds;
|
||||
let imageOverlay: L.ImageOverlay;
|
||||
imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds);
|
||||
imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds, imageOverlayOptions);
|
||||
imageOverlay = L.imageOverlay('https://www.google.ru/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png', imageOverlayBounds, {
|
||||
opacity: 100,
|
||||
alt: 'alt',
|
||||
className: 'className',
|
||||
});
|
||||
|
||||
const eventHandler = () => {};
|
||||
const domEvent: Event = {} as Event;
|
||||
L.DomEvent
|
||||
|
||||
Reference in New Issue
Block a user