use of org.activityinfo.shared.report.model.MapIcon in project activityinfo by bedatadriven.
the class IconLayerOptions method populateWithIcons.
private void populateWithIcons() {
boolean isFirst = true;
for (Icon mapIcon : Icon.values()) {
ContentPanel iconPanel = new ContentPanel();
iconPanel.setHeaderVisible(false);
iconPanel.setLayout(new RowLayout(Orientation.VERTICAL));
iconPanel.setAutoWidth(true);
Radio radiobuttonIcon = new Radio();
iconPanel.add(radiobuttonIcon);
iconPanel.add(new Image(MapIcon.fromEnum(mapIcon)));
radioIcons.put(radiobuttonIcon, mapIcon);
iconRadios.put(mapIcon, radiobuttonIcon);
radioGroup.add(radiobuttonIcon);
contentPanel.add(iconPanel);
if (isFirst) {
radiobuttonIcon.setValue(true);
isFirst = false;
}
}
}
use of org.activityinfo.shared.report.model.MapIcon in project activityinfo by bedatadriven.
the class LeafletMarkerFactory method createIconMapMarker.
/**
* Creates a Leaflet marker based on an ActivityInfo MapIcon
*/
public static Marker createIconMapMarker(IconMapMarker model) {
MapIcon iconModel = model.getIcon();
String iconUrl = "mapicons/" + iconModel.getName() + ".png";
IconOptions iconOptions = new IconOptions();
iconOptions.setIconUrl(iconUrl);
iconOptions.setIconAnchor(new Point(iconModel.getAnchorX(), iconModel.getAnchorY()));
iconOptions.setIconSize(new Point(iconModel.getWidth(), iconModel.getHeight()));
Options markerOptions = new MarkerOptions();
markerOptions.setProperty("icon", new Icon(iconOptions));
return new Marker(toLatLng(model), markerOptions);
}
Aggregations