Class DivPointIcon
java.lang.Object
io.jmix.mapsui.component.layer.style.GeometryStyle
io.jmix.mapsui.component.layer.style.PointStyle
io.jmix.mapsui.component.layer.style.AbstractCustomPointIcon
io.jmix.mapsui.component.layer.style.DivPointIcon
A fully custom lightweight icon for points that uses a
<div>
element instead of an image.
This type of icon allows you to specify an html code that will be used as an icon.
-
Constructor Summary
ModifierConstructorDescriptionprotected
DivPointIcon
(String html) Creates an icon that uses the given<div>
element instead of an image. -
Method Summary
Modifier and TypeMethodDescriptiongetIcon()
setIconAnchor
(double x, double y) Sets the coordinates of the "tip" of the icon in pixels (relative to its top left corner).setIconSize
(double x, double y) Does not affect size of the html content.setPopupAnchor
(double x, double y) Sets the coordinates of the point from which popups will open (relative to the icon anchor).Sets one or more user-defined CSS style names for the<div>
element.Methods inherited from class io.jmix.mapsui.component.layer.style.AbstractCustomPointIcon
getIconAnchor, getIconSize, getPopupAnchor
-
Constructor Details
-
DivPointIcon
Creates an icon that uses the given<div>
element instead of an image.
-
-
Method Details
-
getIcon
-
getStyles
-
setStyles
Sets one or more user-defined CSS style names for the<div>
element. Multiple styles can be specified as space-separated list of style names.Replaces the default style, which is a white square. So, to get rid of the white square, specify any style name (for example,
my-div-style
). -
setIconAnchor
Description copied from class:AbstractCustomPointIcon
Sets the coordinates of the "tip" of the icon in pixels (relative to its top left corner). The icon will be aligned so that this point matches the geographical coordinates of a layer's point. By default: centered if size is specified and equals the top left corner when size is not specified.- Overrides:
setIconAnchor
in classAbstractCustomPointIcon
- Returns:
- the instance on which this method was called. Useful for a fluent API.
-
setIconSize
Does not affect size of the html content. Effectively needed for specifyingiconAnchor
andpopupAnchor
options.- Overrides:
setIconSize
in classAbstractCustomPointIcon
- Returns:
- the instance on which this method was called. Useful for a fluent API.
-
setPopupAnchor
Description copied from class:AbstractCustomPointIcon
Sets the coordinates of the point from which popups will open (relative to the icon anchor). By default: equals the icon anchor, so relative coordinates = [0, 0].- Overrides:
setPopupAnchor
in classAbstractCustomPointIcon
- Returns:
- the instance on which this method was called. Useful for a fluent API.
-