Andrew, Seems there is a problem with the 10% difference approach. The difference or fraction is not constant at different zoom levels and at different regions.
For example the fraction (NE lat - SW lat)/SW lat gives me 0.048 (if i multiply by 100, it comes to 4.8%) at zoom level 4 for a certain amount of pan, but for the same amount of pan, the fraction becomes 0.029 (2.9%) at zoom level 5 and it goes on decreasing at higher zoom levels. So, this approach of finding the difference between centers in terms of latitude or longitude will not track the map panning exactly. Please guide me if am wrong. What I would need now is to have a pixel based difference between the old center and new center, which would give me like 5px for a certain amount of pan at all the zoom levels. Please do post your views. On Dec 30 2008, 2:53 pm, "warden [Andrew Leach - Maps API Guru]" <[email protected]> wrote: > On Dec 30, 6:14 am, Satish Rapalli <[email protected]> wrote: > > > > >Whenevertheuserpansby asmallamount, it ismakinganajaxcall. > > Instead, it should allow a tolerance of say 10% panning. > > > I have worked out one solution for this, but works for only few zoom > > levels. > > ( (NElat ~ SW lat) / SWlat )*100 > 10 > > I have no idea what the ~ operator is. Javascript uses ~ as a unary > bitwise NOT operator. > > I would suggest using the movestart and moveend events. Store the map > centre on movestart, and compare it with the new map centre on > moveend. If the difference is more than 10% of the map bounds, redo > theAJAXcall. > > movestart/moveend will fire for any movement of the map, whether > panned using the control, dragged or automatically moved by opening an > infoWindow. > > Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
