Search in sources :

Example 1 with Options

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

the class NodeMapWidget method addTileLayer.

private void addTileLayer(String tileUrl, List<Option> optionsList) {
    LOG.info("NodeMapWidget.setTileLayer(String, Option...) start");
    LOG.info("NodeMapWidget.setTileLayer tileServerUrl: " + tileUrl + "," + optionsList);
    final Options tileOptions = new Options();
    for (Option eachOption : optionsList) {
        tileOptions.setProperty(eachOption.getKey(), eachOption.getValue());
    }
    m_layer = new TileLayer(tileUrl, tileOptions);
    m_map.addLayer(m_layer, true);
    LOG.info("NodeMapWidget.setTileLayer(String, Option...) end");
}
Also used : MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) Options(org.discotools.gwt.leaflet.client.Options) ZoomOptions(org.discotools.gwt.leaflet.client.controls.zoom.ZoomOptions) TileLayer(org.discotools.gwt.leaflet.client.layers.raster.TileLayer) Option(org.opennms.features.vaadin.nodemaps.internal.gwt.client.Option)

Example 2 with Options

use of org.discotools.gwt.leaflet.client.Options in project activityinfo by bedatadriven.

the class LeafletMarkerFactory method createPieMapMarker.

public static Marker createPieMapMarker(PieMapMarker marker) {
    StringBuilder sb = new StringBuilder();
    sb.append("/icon?t=piechart&r=").append(marker.getRadius());
    for (SliceValue slice : marker.getSlices()) {
        sb.append("&value=").append(slice.getValue());
        sb.append("&color=").append(slice.getColor());
    }
    String iconUrl = sb.toString();
    int size = marker.getRadius() * 2;
    IconOptions iconOptions = new IconOptions();
    iconOptions.setIconUrl(iconUrl);
    iconOptions.setIconAnchor(new Point(marker.getRadius(), marker.getRadius()));
    iconOptions.setIconSize(new Point(size, size));
    Options markerOptions = new MarkerOptions();
    markerOptions.setProperty("icon", new Icon(iconOptions));
    setModel(markerOptions.getJSObject(), marker);
    return new Marker(toLatLng(marker), 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) SliceValue(org.activityinfo.legacy.shared.reports.content.PieMapMarker.SliceValue) 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) Point(org.discotools.gwt.leaflet.client.types.Point) IconOptions(org.discotools.gwt.leaflet.client.types.IconOptions)

Example 3 with Options

use of org.discotools.gwt.leaflet.client.Options in project activityinfo by bedatadriven.

the class LeafletMarkerFactory method createBubbleMapMarker.

public static Marker createBubbleMapMarker(BubbleMapMarker marker) {
    Options options = new Options();
    options.setProperty("radius", marker.getRadius());
    options.setProperty("fill", true);
    options.setProperty("fillColor", LeafletUtil.color(marker.getColor()));
    options.setProperty("fillOpacity", marker.getAlpha());
    // stroke color
    options.setProperty("color", LeafletUtil.color(marker.getColor()));
    // stroke opacity
    options.setProperty("opacity", 0.8);
    setModel(options.getJSObject(), marker);
    return new CircleMarker(toLatLng(marker), options);
}
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) CircleMarker(org.discotools.gwt.leaflet.client.marker.CircleMarker)

Example 4 with Options

use of org.discotools.gwt.leaflet.client.Options in project activityinfo by bedatadriven.

the class LocationMap method createNewLocationMarker.

private void createNewLocationMarker() {
    DivIcon icon = createIcon("");
    Options markerOptions = new Options();
    markerOptions.setProperty("icon", icon);
    markerOptions.setProperty("draggable", true);
    newLocationMarker = new Marker(newLatLng(newLocationPresenter.getLatLng()), markerOptions);
    EventHandlerManager.addEventHandler(newLocationMarker, org.discotools.gwt.leaflet.client.events.handler.EventHandler.Events.dragend, new EventHandler<Event>() {

        @Override
        public void handle(Event event) {
            newLocationPresenter.setLatLng(new AiLatLng(newLocationMarker.getLatLng().lat(), newLocationMarker.getLatLng().lng()));
        }
    });
    map.addLayer(newLocationMarker);
}
Also used : MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) Options(org.discotools.gwt.leaflet.client.Options) MouseEvent(org.discotools.gwt.leaflet.client.events.MouseEvent) Event(org.discotools.gwt.leaflet.client.events.Event) StoreEvent(com.extjs.gxt.ui.client.store.StoreEvent) BaseEvent(com.extjs.gxt.ui.client.event.BaseEvent) AiLatLng(org.activityinfo.model.type.geo.AiLatLng) Marker(org.discotools.gwt.leaflet.client.marker.Marker)

Example 5 with Options

use of org.discotools.gwt.leaflet.client.Options in project activityinfo by bedatadriven.

the class LocationMap method createMarker.

private Marker createMarker(LatLng latLng, String label) {
    DivIcon icon = createIcon(label);
    Options markerOptions = new Options();
    markerOptions.setProperty("icon", icon);
    Marker marker = new Marker(latLng, markerOptions);
    return marker;
}
Also used : MapOptions(org.discotools.gwt.leaflet.client.map.MapOptions) Options(org.discotools.gwt.leaflet.client.Options) Marker(org.discotools.gwt.leaflet.client.marker.Marker)

Aggregations

Options (org.discotools.gwt.leaflet.client.Options)10 MapOptions (org.discotools.gwt.leaflet.client.map.MapOptions)5 Marker (org.discotools.gwt.leaflet.client.marker.Marker)5 CircleMarker (org.discotools.gwt.leaflet.client.marker.CircleMarker)4 MarkerOptions (org.discotools.gwt.leaflet.client.marker.MarkerOptions)4 IconOptions (org.discotools.gwt.leaflet.client.types.IconOptions)4 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 TileLayer (org.discotools.gwt.leaflet.client.layers.raster.TileLayer)3 MapIcon (org.activityinfo.legacy.shared.reports.model.MapIcon)2 AiLatLng (org.activityinfo.model.type.geo.AiLatLng)2 ZoomOptions (org.discotools.gwt.leaflet.client.controls.zoom.ZoomOptions)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 TileBaseMap (org.activityinfo.legacy.shared.model.TileBaseMap)1 SliceValue (org.activityinfo.legacy.shared.reports.content.PieMapMarker.SliceValue)1