1

Given the size of my map div, lat-lng of the centre and the zoom, I want to find out what are the bounds of the map (i.e. the top-left and bottom-right lat-lngs)

The problem is that I need to know this before the map is loaded. Therefore, I cannot simply call map.getBounds to get this information.

How should I calculate this information?

arahant
  • 2,203
  • 7
  • 38
  • 62
  • "[...] I need to know this before the map is loaded." Why? The map needs to be loaded before you can start interacting with its API... – André Dion Jul 26 '13 at 16:18
  • The use case is a rather lengthy. Anyway, this question is exact duplicate of http://stackoverflow.com/questions/3774579/calculate-bounds-from-center-and-zoom-google-maps-api-v3?rq=1 so I will close it. – arahant Jul 26 '13 at 16:28
  • @ André Dion: you don't need to load a map to be able to interact with the API, you don't need a map at all to use the API(there are a lot of objects and methods that don't require a map) – Dr.Molle Jul 26 '13 at 20:25

0 Answers0