use of org.activityinfo.legacy.shared.reports.content.MapMarker in project activityinfo by bedatadriven.
the class GeoDigestRenderer method renderDatabase.
private void renderDatabase(StringBuilder html, DatabaseModel databaseModel) throws IOException {
html.append("<div class='geo-database' style='margin-top:20px'>");
html.append("<span class='geo-header' style='font-weight:bold; color: #" + BUBBLE_COLOR + ";'>");
html.append(databaseModel.getName());
html.append("</span><br>");
html.append("<img class='geo-graph' width=\"450px\" src=\"");
html.append(databaseModel.getUrl());
html.append("\" /><br><br>");
for (MapMarker marker : databaseModel.getContent().getMarkers()) {
String label = ((BubbleMapMarker) marker).getLabel();
html.append("<span class='geo-marker-header' style='color: #" + BUBBLE_COLOR + "; font-weight:bold;'>");
html.append(label);
html.append(":</span><br>");
LOGGER.finest(marker.getSiteIds().size() + " sites for marker " + label + ": " + marker.getSiteIds());
renderSites(html, databaseModel, marker.getSiteIds());
}
if (!databaseModel.getContent().getUnmappedSites().isEmpty()) {
html.append("<br><span class='geo-unmapped-header' style='color:black; font-weight:bold;'>");
html.append(I18N.MESSAGES.geoDigestUnmappedSites());
html.append(":</span><br>");
LOGGER.finest(databaseModel.getContent().getUnmappedSites().size() + " unmapped sites");
renderSites(html, databaseModel, databaseModel.getContent().getUnmappedSites());
}
html.append("</div>");
}
use of org.activityinfo.legacy.shared.reports.content.MapMarker in project activityinfo by bedatadriven.
the class LRTBComparatorTest method testComparator.
@Test
public void testComparator() {
MapMarker ul = new BubbleMapMarker();
ul.setX(1);
ul.setY(1);
MapMarker ul2 = new BubbleMapMarker();
ul2.setX(60);
ul2.setY(0);
MapMarker c = new BubbleMapMarker();
c.setX(30);
c.setY(50);
MapMarker ll = new BubbleMapMarker();
ll.setX(0);
ll.setY(80);
List<MapMarker> list = new ArrayList<MapMarker>();
list.add(ll);
list.add(c);
list.add(ul2);
list.add(ul);
Collections.sort(list, new MapMarker.LRTBComparator());
for (MapMarker marker : list) {
System.out.println(marker.toString());
}
Assert.assertEquals(ul, list.get(0));
Assert.assertEquals(ul2, list.get(1));
Assert.assertEquals(c, list.get(2));
Assert.assertEquals(ll, list.get(3));
}
use of org.activityinfo.legacy.shared.reports.content.MapMarker in project activityinfo by bedatadriven.
the class MgMapIntegrationTest method siteBoundsToAdminLevelsAreMappedAsIcons.
@Test
public void siteBoundsToAdminLevelsAreMappedAsIcons() throws IOException {
IconMapLayer layer = new IconMapLayer();
layer.setIcon("educ");
layer.getIndicatorIds().add(NUMBER_OF_BENE_INDICATOR_ID);
generateMap(layer, "mg-icons");
assertThat(content.getMarkers().size(), equalTo(10));
MapMarker marker = getMarkerForSite(1336279918);
assertThat(marker.getX(), equalTo(262));
assertThat(marker.getY(), equalTo(113));
}
Aggregations