use of org.activityinfo.shared.report.model.MapReportElement in project activityinfo by bedatadriven.
the class PPTMapRendererTest method renderGoogleBaseMapsLong.
@Test
public void renderGoogleBaseMapsLong() throws IOException {
MapReportElement map = createMap(GoogleBaseMap.ROADMAP);
map.setHeight(1024);
renderPPT(map, "googleBaseMapLong.ppt");
MapReportElement tiledMap = createMap(referenceBaseMap);
tiledMap.setHeight(1024);
renderPPT(tiledMap, "tiledMapLong.ppt");
}
use of org.activityinfo.shared.report.model.MapReportElement in project activityinfo by bedatadriven.
the class PPTMapRendererTest method createMap.
private MapReportElement createMap(BaseMap baseMap) {
MapContent content = new MapContent();
content.setBaseMap(baseMap);
content.setCenter(new AiLatLng(-0.07965085325106624, 29.326629638671875));
content.setZoomLevel(10);
content.setIndicators(Collections.EMPTY_SET);
content.setMarkers(Collections.EMPTY_LIST);
MapReportElement element = new MapReportElement();
element.setContent(content);
element.setWidth(1022);
element.setHeight(634);
return element;
}
use of org.activityinfo.shared.report.model.MapReportElement in project activityinfo by bedatadriven.
the class MapGeneratorTest method adminMapBubbles.
@Test
public void adminMapBubbles() {
AdministrativeLevelClustering clustering = new AdministrativeLevelClustering();
clustering.getAdminLevels().add(1);
BubbleMapLayer layer = new BubbleMapLayer();
layer.setClustering(clustering);
layer.addIndicator(1);
Filter filter = new Filter();
filter.addRestriction(DimensionType.Site, 3);
MapReportElement map = new MapReportElement();
map.addLayer(layer);
map.setFilter(filter);
MapContent result = (MapContent) execute(new GenerateElement(map));
System.out.println(result.getMarkers());
BubbleMapMarker marker = (BubbleMapMarker) result.getMarkers().get(0);
assertThat(marker.getSiteIds().size(), equalTo(1));
assertThat(marker.getSiteIds().get(0), equalTo(3));
assertThat(marker.getValue(), equalTo(10000d));
assertThat(result.getUnmappedSites().size(), equalTo(0));
System.out.println(marker.getTitle());
}
Aggregations