Search in sources :

Example 1 with IconOptions

use of org.discotools.gwt.leaflet.client.types.IconOptions in project opennms by OpenNMS.

the class NodeMapConnector method initializeIcons.

private void initializeIcons() {
    if (m_icons == null) {
        m_icons = new HashMap<String, Icon>();
        for (final String severity : new String[] { "Normal", "Warning", "Minor", "Major", "Critical" }) {
            IconOptions options = new IconOptions();
            options.setIconSize(new Point(25, 41));
            options.setIconAnchor(new Point(12, 41));
            options.setPopupAnchor(new Point(1, -34));
            options.setShadowUrl(new Point(41, 41));
            String basePath = GWT.getModuleBaseForStaticFiles() + "images/";
            if (isRetina()) {
                options.setIconUrl(basePath + severity + "@2x.png");
            } else {
                options.setIconUrl(basePath + severity + ".png");
            }
            Icon icon = new Icon(options);
            m_icons.put(severity, icon);
        }
    }
}
Also used : Icon(org.discotools.gwt.leaflet.client.types.Icon) Point(org.discotools.gwt.leaflet.client.types.Point) IconOptions(org.discotools.gwt.leaflet.client.types.IconOptions)

Aggregations

Icon (org.discotools.gwt.leaflet.client.types.Icon)1 IconOptions (org.discotools.gwt.leaflet.client.types.IconOptions)1 Point (org.discotools.gwt.leaflet.client.types.Point)1