Search in sources :

Example 6 with IconMapMarker

use of org.activityinfo.shared.report.content.IconMapMarker in project activityinfo by bedatadriven.

the class PPTMapRenderer method render.

public void render(MapReportElement element, SlideShow ppt) throws IOException {
    // add first slide
    Slide slide = ppt.createSlide();
    // calculate map offset
    Dimension pageSize = ppt.getPageSize();
    int offsetX = ((int) pageSize.getWidth() - element.getWidth()) / 2;
    int offsetY = ((int) pageSize.getHeight() - element.getHeight()) / 2;
    // add the map background image
    drawBasemap(element, new PPTTileHandler(ppt, slide));
    // keep a list of map icons
    Map<String, Integer> iconPictureIndex = new HashMap<String, Integer>();
    // Add the indicator markers to the slide as shapes
    for (MapMarker marker : element.getContent().getMarkers()) {
        if (inView(element, marker)) {
            if (marker instanceof IconMapMarker) {
                addIconMarker(ppt, slide, offsetX, offsetY, iconPictureIndex, (IconMapMarker) marker);
            } else if (marker instanceof BubbleMapMarker) {
                addBubble(slide, offsetX, offsetY, (BubbleMapMarker) marker);
            }
        }
    }
}
Also used : MapMarker(org.activityinfo.shared.report.content.MapMarker) IconMapMarker(org.activityinfo.shared.report.content.IconMapMarker) BubbleMapMarker(org.activityinfo.shared.report.content.BubbleMapMarker) Slide(org.apache.poi.hslf.model.Slide) HashMap(java.util.HashMap) IconMapMarker(org.activityinfo.shared.report.content.IconMapMarker) BubbleMapMarker(org.activityinfo.shared.report.content.BubbleMapMarker) Dimension(com.google.code.appengine.awt.Dimension)

Aggregations

IconMapMarker (org.activityinfo.shared.report.content.IconMapMarker)6 BubbleMapMarker (org.activityinfo.shared.report.content.BubbleMapMarker)4 MapMarker (org.activityinfo.shared.report.content.MapMarker)4 MapContent (org.activityinfo.shared.report.content.MapContent)3 MapReportElement (org.activityinfo.shared.report.model.MapReportElement)3 IconMapLayer (org.activityinfo.shared.report.model.layers.IconMapLayer)2 Test (org.junit.Test)2 Dimension (com.google.code.appengine.awt.Dimension)1 HashMap (java.util.HashMap)1 Cluster (org.activityinfo.server.report.generator.map.cluster.Cluster)1 TileBaseMap (org.activityinfo.shared.map.TileBaseMap)1 AiLatLng (org.activityinfo.shared.report.content.AiLatLng)1 PieMapMarker (org.activityinfo.shared.report.content.PieMapMarker)1 ReportContent (org.activityinfo.shared.report.content.ReportContent)1 MapIcon (org.activityinfo.shared.report.model.MapIcon)1 PointValue (org.activityinfo.shared.report.model.PointValue)1 Report (org.activityinfo.shared.report.model.Report)1 AdministrativeLevelClustering (org.activityinfo.shared.report.model.clustering.AdministrativeLevelClustering)1 Extents (org.activityinfo.shared.util.mapping.Extents)1 Slide (org.apache.poi.hslf.model.Slide)1