Search in sources :

Example 6 with Marker

use of org.discotools.gwt.leaflet.client.marker.Marker 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

Marker (org.discotools.gwt.leaflet.client.marker.Marker)6 Options (org.discotools.gwt.leaflet.client.Options)5 BubbleMapMarker (org.activityinfo.legacy.shared.reports.content.BubbleMapMarker)3 IconMapMarker (org.activityinfo.legacy.shared.reports.content.IconMapMarker)3 MapMarker (org.activityinfo.legacy.shared.reports.content.MapMarker)3 PieMapMarker (org.activityinfo.legacy.shared.reports.content.PieMapMarker)3 CircleMarker (org.discotools.gwt.leaflet.client.marker.CircleMarker)3 MarkerOptions (org.discotools.gwt.leaflet.client.marker.MarkerOptions)3 IconOptions (org.discotools.gwt.leaflet.client.types.IconOptions)3 MapIcon (org.activityinfo.legacy.shared.reports.model.MapIcon)2 AiLatLng (org.activityinfo.model.type.geo.AiLatLng)2 MapOptions (org.discotools.gwt.leaflet.client.map.MapOptions)2 Icon (org.discotools.gwt.leaflet.client.types.Icon)2 Point (org.discotools.gwt.leaflet.client.types.Point)2 BaseEvent (com.extjs.gxt.ui.client.event.BaseEvent)1 StoreEvent (com.extjs.gxt.ui.client.store.StoreEvent)1 LocationDTO (org.activityinfo.legacy.shared.model.LocationDTO)1 SliceValue (org.activityinfo.legacy.shared.reports.content.PieMapMarker.SliceValue)1 Event (org.discotools.gwt.leaflet.client.events.Event)1 MouseEvent (org.discotools.gwt.leaflet.client.events.MouseEvent)1