Search in sources :

Example 1 with MapIcon

use of org.activityinfo.legacy.shared.reports.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) Icon(org.activityinfo.legacy.shared.reports.model.MapIcon.Icon) MapIcon(org.activityinfo.legacy.shared.reports.model.MapIcon) Image(com.google.gwt.user.client.ui.Image) ContentPanel(com.extjs.gxt.ui.client.widget.ContentPanel)

Example 2 with MapIcon

use of org.activityinfo.legacy.shared.reports.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));
    setModel(markerOptions.getJSObject(), model);
    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.legacy.shared.reports.model.MapIcon) Point(org.discotools.gwt.leaflet.client.types.Point) Icon(org.discotools.gwt.leaflet.client.types.Icon) MapIcon(org.activityinfo.legacy.shared.reports.model.MapIcon) BubbleMapMarker(org.activityinfo.legacy.shared.reports.content.BubbleMapMarker) PieMapMarker(org.activityinfo.legacy.shared.reports.content.PieMapMarker) CircleMarker(org.discotools.gwt.leaflet.client.marker.CircleMarker) IconMapMarker(org.activityinfo.legacy.shared.reports.content.IconMapMarker) MapMarker(org.activityinfo.legacy.shared.reports.content.MapMarker) Marker(org.discotools.gwt.leaflet.client.marker.Marker) IconOptions(org.discotools.gwt.leaflet.client.types.IconOptions)

Aggregations

MapIcon (org.activityinfo.legacy.shared.reports.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.legacy.shared.reports.content.BubbleMapMarker)1 IconMapMarker (org.activityinfo.legacy.shared.reports.content.IconMapMarker)1 MapMarker (org.activityinfo.legacy.shared.reports.content.MapMarker)1 PieMapMarker (org.activityinfo.legacy.shared.reports.content.PieMapMarker)1 Icon (org.activityinfo.legacy.shared.reports.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