I’m porting an iOS app to Android, and using Google Maps Android API v2.
The application needs to draw a heatmap overlay onto the map.
So far, it looks
MaciejGórski if you don't mind (if you do, I will remove this post) I compiled your code into ready to use method:
private LatLngBounds boundsOfTile(int x, int y, int zoom) {
int noTiles = (1 << zoom);
double longitudeSpan = 360.0 / noTiles;
double longitudeMin = -180.0 + x * longitudeSpan;
double mercatorMax = 180 - (((double) y) / noTiles) * 360;
double mercatorMin = 180 - (((double) y + 1) / noTiles) * 360;
double latitudeMax = toLatitude(mercatorMax);
double latitudeMin = toLatitude(mercatorMin);
LatLngBounds bounds = new LatLngBounds(new LatLng(latitudeMin, longitudeMin), new LatLng(latitudeMax, longitudeMin + longitudeSpan));
return bounds;
}