Search in sources :

Example 21 with MapReportElement

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");
}
Also used : MapReportElement(org.activityinfo.shared.report.model.MapReportElement) Test(org.junit.Test)

Example 22 with MapReportElement

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;
}
Also used : MapReportElement(org.activityinfo.shared.report.model.MapReportElement) MapContent(org.activityinfo.shared.report.content.MapContent) AiLatLng(org.activityinfo.shared.report.content.AiLatLng)

Example 23 with MapReportElement

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());
}
Also used : MapReportElement(org.activityinfo.shared.report.model.MapReportElement) AdministrativeLevelClustering(org.activityinfo.shared.report.model.clustering.AdministrativeLevelClustering) MapContent(org.activityinfo.shared.report.content.MapContent) BubbleMapLayer(org.activityinfo.shared.report.model.layers.BubbleMapLayer) BubbleMapMarker(org.activityinfo.shared.report.content.BubbleMapMarker) Test(org.junit.Test)

Aggregations

MapReportElement (org.activityinfo.shared.report.model.MapReportElement)23 Test (org.junit.Test)17 MapContent (org.activityinfo.shared.report.content.MapContent)12 Report (org.activityinfo.shared.report.model.Report)8 BubbleMapMarker (org.activityinfo.shared.report.content.BubbleMapMarker)6 IconMapMarker (org.activityinfo.shared.report.content.IconMapMarker)6 TileBaseMap (org.activityinfo.shared.map.TileBaseMap)5 MapMarker (org.activityinfo.shared.report.content.MapMarker)5 BubbleMapLayer (org.activityinfo.shared.report.model.layers.BubbleMapLayer)5 FileOutputStream (java.io.FileOutputStream)4 PivotChartReportElement (org.activityinfo.shared.report.model.PivotChartReportElement)4 AiLatLng (org.activityinfo.shared.report.content.AiLatLng)3 ReportContent (org.activityinfo.shared.report.content.ReportContent)3 TableElement (org.activityinfo.shared.report.model.TableElement)3 PiechartMapLayer (org.activityinfo.shared.report.model.layers.PiechartMapLayer)3 Extents (org.activityinfo.shared.util.mapping.Extents)3 JsonArray (com.google.gson.JsonArray)2 JsonObject (com.google.gson.JsonObject)2 PdfReportRenderer (org.activityinfo.server.report.renderer.itext.PdfReportRenderer)2 IndicatorDTO (org.activityinfo.shared.dto.IndicatorDTO)2