I want to divide the map display area into a number of equal parts. For example: 10 parts horizontally and 15 parts vertically, resulting in 150 equal parts.
I do not know if Google Maps support such a thing...
map.getBounds()
return the total visible area;
so ,
var bounds = map.getBounds();
alert("main: "+bounds.isEmpty());
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var tileWidth = (northEast.lng() - southWest.lng()) / 10;
var tileHeight = (northEast.lat() - southWest.lat()) / 2;
for (var x=0; x < 10 ; x++)
{
for (var y=0; y < 2 ; y++)
{
var northLat = bounds.getNorthEast().lat () + (tileHeight * y);
var westLng = bounds.getSouthWest().lng () + (tileWidth * x);
var southLat = northLat + tileHeight;
var eastLng = westLng + tileHeight;
var tileBounds = new GLatLngBounds(new GLatLng(southLat, westLng), new GLatLng(northLat, eastLng));
alert(tileBounds.isEmpty());
}
}
now the problem is tileBounds.isEmpty() returns TRUE !!
I cant able to find where I am missing something !! Any Help !!