DomUtil

external object DomUtil(source)

Utility functions to work with the DOM tree, used by Leaflet internally.

Most functions expecting or returning a HTMLElement also work for SVG elements. The only difference is that classes refer to CSS classes in HTML and SVG classes in SVG.

See https://leafletjs.com/reference.html#domutil

Properties

Link copied to clipboard

Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).

Link copied to clipboard

Vendor-prefixed transition style name.

Link copied to clipboard

Vendor-prefixed transitionend event name.

Functions

Link copied to clipboard
fun addClass(el: HTMLElement, name: String)
Link copied to clipboard
fun create(tagName: String, className: String = definedExternally, container: HTMLElement = definedExternally): HTMLElement

Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun get(element: String): HTMLElement?

Get Element by its ID

fun get(element: HTMLElement): HTMLElement?

Get Element by the given HTML-Element

Link copied to clipboard
Link copied to clipboard

Returns the coordinates of an element previously positioned with setPosition.

Link copied to clipboard
fun getStyle(el: HTMLElement, styleAttrib: String): String?

Returns the value for a certain style attribute on an element, including computed values or values set through CSS.

Link copied to clipboard
Link copied to clipboard

Makes the outline of the element el invisible. Used internally by Leaflet to prevent focusable elements from displaying an outline when the user performs a drag interaction on them.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Cancels the effects of a previous preventOutline.

Link copied to clipboard
fun setClass(el: HTMLElement, name: String)
Link copied to clipboard
fun setOpacity(el: HTMLElement, opacity: Number)
Link copied to clipboard
fun setPosition(el: HTMLElement, position: Point)

Sets the position of el to coordinates specified by position, using CSS translate or top/left positioning depending on the browser (used by Leaflet internally to position its layers).

Link copied to clipboard
fun setTransform(el: HTMLElement, offset: Point, scale: Number = definedExternally)
Link copied to clipboard
fun testProp(props: Array<String>): dynamic
Link copied to clipboard
Link copied to clipboard