IconLibrary
As part of loading plans, the Viewer loads additional resources needed to display plans such as icon libraries, theme libraries, and more. These resources can be edited through PlanStudio and set on a per-partnership and per-client basis to customise the appearance of plans.
The IconLibrary is a wrapper provided by the SDK that allows you to query icon libraries for information about specific icons, primarily to assist with creating icon legends.
You cannot directly create IconLibrary instances, and you cannot modify any of their properties.
iconLibrary.getIconByType(iconType)
iconLibrary.getAssemblyAreaIcon()
iconLibrary.getEvacSignIcon()
iconLibrary.getExitSignIcon()
iconLibrary.getFireSafetyIcon()
iconLibrary.getSmokeSafetyIcon()
iconLibrary.getIconByType(iconType)
Returns details about the given icon type. If the IconLibrary does not contain an icon with the given type, details about a placeholder “unknown” icon type will be returned instead to ensure compatibility with plans that contain icons which aren’t in the icon library.
The name
property is a human-readable name for the icon. This name may differ significantly from the icon type, as some partners may prefer to use different names for icons that have a standard type (for example, the icon type "mcp"
may be called a “Manual Call Point” in some libraries, and a “Break Glass” in others).
The legendName
property is similar to the name
property except it is pre-formatted with newlines so that it can sit nicely next to an icon. You should use white-space: pre;
in your CSS when displaying the legendName
property.
The color
property is a CSS color that matches the dominant color of the icon. There is no guarantee about the formatting of this color, except that it will be a valid CSS color (e.g rgb(255, 0, 0)
is just as valid as #ff0000
, which is just as valid as red
).
The imageUrl
property is a data URL that can be used as the src
attribute for an <img>
element. The image will always be square.
The groupName
property is an enum string that will be one of the strings Safety
, Evacuation
, Fire
, or the value null
.
iconLibrary.getAssemblyAreaIcon()
Returns details about the built-in Assembly Area icon.
iconLibrary.getEvacSignIcon()
Returns details about the built-in Evac Sign icon.
iconLibrary.getExitSignIcon()
Returns details about the built-in Exit Sign icon.
iconLibrary.getFireSafetyIcon()
Returns details about the built-in Fire Safety icon.
iconLibrary.getSmokeSafetyIcon()
Returns details about the built-in Smoke Safety icon.