map.draw();
fill(0);
List<PVector> vertices = new ArrayList<PVector>();
for (Location location : locations) {
ScreenPosition pos = map.getScreenPosition(location);
ellipse(pos.x, pos.y, 10, 10);
vertices.add(pos);
}
fill(0, 100);
beginShape();
for (PVector pos : vertices) {
vertex(pos.x, pos.y);
}
endShape();
Location centroid = GeoUtils.getCentroid(locations);
ScreenPosition centroidPos = map.getScreenPosition(centroid);
fill(255, 0, 0);
ellipse(centroidPos.x, centroidPos.y, 10, 10);
PVector centroidPos1 = getCentroidOfPolygon(vertices);
fill(0, 255, 0);