use of de.fhpotsdam.unfolding.utils.MapPosition in project constellation by constellation-app.
the class ConstellationAbstractMarker method draw.
@Override
public void draw(final UnfoldingMap map) {
final PGraphics graphics = map.mapDisplay.getOuterPG();
final List<MapPosition> positions = locations.stream().map(location -> new MapPosition(map.mapDisplay.getObjectFromLocation(location))).collect(Collectors.toList());
final boolean validMarker = draw(graphics, positions, map);
// draw label
if (validMarker && getId() != null) {
final MapPosition center = new MapPosition();
positions.forEach(center::add);
center.div(positions.size());
graphics.fill(FONT_COLOR);
graphics.textSize(FONT_SIZE);
graphics.text(id, center.x - (CHAR_WIDTH * id.length() * 0.6F), center.y + (FONT_SIZE * 0.35F));
}
}
Aggregations