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