/ui/elements/legendIcon
The legendIcon module exports the default legendIcon(style) method.
- Source
Methods
(inner) createIconFromArray(style) → {HTMLElement}
The createIconFromArray method iterates through an style.icon[] array to create a layered and scaled icon element for displaying an icon style.
| Name | Type | Description |
|---|---|---|
style | feature-style | A JSON style object. |
A HTML element for the style.
- Type:
- HTMLElement
(inner) createIconFromInlineStyle(style) → {HTMLElement}
The createIconFromInlineStyle creates an icon from an inline style object.
| Name | Type | Description |
|---|---|---|
style | feature-style | A JSON style object. |
A HTML element for the style.
- Type:
- HTMLElement
(inner) createLineSymbol(style) → {HTMLElement}
The createLineSymbol creates an icon for a stroke [line] style object.
| Name | Type | Description |
|---|---|---|
style | feature-style | A JSON style object. |
A HTML element for the style.
- Type:
- HTMLElement
(inner) createPolygonSymbol(style) → {HTMLElement}
The createPolygonSymbol creates an icon for a fill [polygon] style object.
| Name | Type | Description |
|---|---|---|
style | feature-style | A JSON style object. |
A HTML element for the style.
- Type:
- HTMLElement
(inner) legendIcon(style) → {HTMLElement}
The legendIcon method returns an icon for displaying a mapp-style object outside the mapview.Map canvas.
| Name | Type | Description |
|---|---|---|
style | feature-style | A JSON style object. |
A HTML element for the style.
- Type:
- HTMLElement
(inner) svgSymbolUrl(icon) → {SVGElement}
The svgSymbolUrl function returns the URL for an SVG symbol based on its type.
The method will return undefined if the symbol type is not found in the mapp.utils.svgSymbols object. This is to prevent errors when an invalid symbol type is provided.
| Name | Type | Description |
|---|---|---|
icon | string | The icon type to create from svgSymbols. |
Icon SVG element from mapp.utils.svgSymbols.
- Type:
- SVGElement