Class: IWIconManager

IWIconManager

A class to get icons from a SVG sprite.

new IWIconManager()

Singleton constructor

Methods


createIcon(iconName, color, width, height)

Creates a DOM Element containing the requested icon.
Parameters:
Name Type Description
iconName string the name of the icon to use. Use IWIconManager.getAvailableIcons() to see all available icons.
color string a color used as fill color, or 'none' to set no fill color at all (optional, default is white)
width string the width of the element (optional, default is 100%)
height string the height of the element (optional, default is 100%)
Returns:
the SVG element
Type
Element

getAvailableIcons()

Gets a list of all available icons.
Returns:
the icon names
Type
Array.<String>

initialize(map, url)

Initializes the icon manager with the provided SVG or the default icons.
Parameters:
Name Type Description
map IWMap a map
url string URL to a SVG with the icons (optional, default icons are used if no URL is provided)
Returns:
Type
void