155156157158159160161162163164165
public static Location getEuclideanCentroid(List<Location> locations) { Location center = new Location(0, 0); for (Location loc : locations) { center.add(loc); } center.div((float) locations.size()); return center; } /** * Returns the geometric center of the locations of a polygon.
5657585960616263646566
public Location getLocation() { Location center = new Location(0, 0); for (Marker marker : markers) { center.add(marker.getLocation()); } center.div((float) markers.size()); return center; } @Override public void setLocation(float lat, float lng) {