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:
silh
2018-07-09 21:25:33 +03:00
committed by Ryan Cavanaugh
parent 50c50a8eb2
commit ebcb52fb25
2 changed files with 26 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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