DomUtil class

Annotations
  • @JS('L.DomUtil')

Constructors

DomUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

TRANSFORM String
String Vendor-prefixed transform style name (e.g. 'webkitTransform' for WebKit).
no setter
TRANSITION String
Vendor-prefixed transition style name.
no setter
TRANSITION_END String
no setter

Static Methods

addClass(Element el, String name) → void
Adds name to the el's class attribute.
create(String tagName, [String? className, Element? container]) Element
Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.
disableImageDrag() → void
As disableTextSelection, but for dragstart DOM events, usually generated when the user drags an image.
disableTextSelection() → void
Prevents the user from generating selectstart DOM events, usually generated when the user drags the mouse through a page with text. Used internally by Leaflet to override the behaviour of any click-and-drag interaction on the map. Affects drag interactions on the whole document.
empty(Element el) → void
Removes all of el's children elements from el.
enableImageDrag() → void
Cancels the effects of a previous disableImageDrag.
enableTextSelection() → void
Cancels the effects of a previous disableTextSelection.
get(dynamic id) Element
Returns an element given its DOM id, or returns the element itself if it was passed directly.
getClass(Element el) String
Returns the el's class.
getPosition(Element el) Point
Returns the coordinates of an element previously positioned with setPosition.
getScale(Element el) ComputedScale
Computes the CSS scale currently applied on the element. Returns an object with x and y members as horizontal and vertical scales respectively, and boundingClientRect as the result of getBoundingClientRect().
getSizedParentNode(Element el) Element
Finds the closest parent node which size (width and height) is not null.
getStyle(Element el, String styleAttrib) String
Returns the value for a certain style attribute on an element, including computed values or values set through CSS.
hasClass(Element el, String name) bool
Returns true if the el's class attribute contains name.
preventOutline(Element el) → void
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.
remove(Element el) → void
Removes el from its parent element.
removeClass(Element el, String name) → void
Removes name from the el's class attribute.
restoreOutline() → void
Cancels the effects of a previous preventOutline.
setClass(Element el, String name) → void
Sets the el's class.
setOpacity(Element el, num opacity) → void
Set the opacity of an element (including old IE support). opacity must be a number from 0 to 1.
setPosition(Element el, Point position) → void
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).
setTransform(Element el, Point offset, [num? scale]) → void
Resets the 3D CSS transform of el so it is translated by offset pixels and optionally scaled by scale. Does not have an effect if the browser doesn't support 3D CSS transforms.
testProp(List props) → dynamic
Goes through the array of style names and returns the first name that is a valid style name for an element. If no such name is found, it returns false. Useful for vendor-prefixed styles like transform.
toBack(Element el) → void
Makes el the first child of its parent, so it renders behind the other children.
toFront(Element el) → void
Makes el the last child of its parent, so it renders in front of the other children.