Search in sources :

Example 1 with MapIcon

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;
        }
    }
}
Also used : RowLayout(com.extjs.gxt.ui.client.widget.layout.RowLayout) Radio(com.extjs.gxt.ui.client.widget.form.Radio) MapIcon(org.activityinfo.shared.report.model.MapIcon) Icon(org.activityinfo.shared.report.model.MapIcon.Icon) Image(com.google.gwt.user.client.ui.Image) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 2 with MapIcon

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);
}
Also used : IconOptions(org.discotools.gwt.leaflet.client.types.IconOptions) Options(org.discotools.gwt.leaflet.client.Options) MarkerOptions(org.discotools.gwt.leaflet.client.marker.MarkerOptions) MarkerOptions(org.discotools.gwt.leaflet.client.marker.MarkerOptions) MapIcon(org.activityinfo.shared.report.model.MapIcon) Point(org.discotools.gwt.leaflet.client.types.Point) MapIcon(org.activityinfo.shared.report.model.MapIcon) Icon(org.discotools.gwt.leaflet.client.types.Icon) MapMarker(org.activityinfo.shared.report.content.MapMarker) IconMapMarker(org.activityinfo.shared.report.content.IconMapMarker) PieMapMarker(org.activityinfo.shared.report.content.PieMapMarker) CircleMarker(org.discotools.gwt.leaflet.client.marker.CircleMarker) Marker(org.discotools.gwt.leaflet.client.marker.Marker) BubbleMapMarker(org.activityinfo.shared.report.content.BubbleMapMarker) IconOptions(org.discotools.gwt.leaflet.client.types.IconOptions)

Aggregations

MapIcon (org.activityinfo.shared.report.model.MapIcon)2 ContentPanel (com.extjs.gxt.ui.client.widget.ContentPanel)1 Radio (com.extjs.gxt.ui.client.widget.form.Radio)1 RowLayout (com.extjs.gxt.ui.client.widget.layout.RowLayout)1 Image (com.google.gwt.user.client.ui.Image)1 BubbleMapMarker (org.activityinfo.shared.report.content.BubbleMapMarker)1 IconMapMarker (org.activityinfo.shared.report.content.IconMapMarker)1 MapMarker (org.activityinfo.shared.report.content.MapMarker)1 PieMapMarker (org.activityinfo.shared.report.content.PieMapMarker)1 Icon (org.activityinfo.shared.report.model.MapIcon.Icon)1 Options (org.discotools.gwt.leaflet.client.Options)1 CircleMarker (org.discotools.gwt.leaflet.client.marker.CircleMarker)1 Marker (org.discotools.gwt.leaflet.client.marker.Marker)1 MarkerOptions (org.discotools.gwt.leaflet.client.marker.MarkerOptions)1 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