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");
}
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);
}
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);
}
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);
}
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;
}
Aggregations