On Sep 9, 5:48 pm, GG <[email protected]> wrote: > > I can't seem to hammer the last feature. When a user drags the map, I > need to re-query my database for new marker points based on the new > map center.
Oh yeah, I forgot to ask on this part ... why do you query the DB each time someone pans the map? Are you showing only markers that reside in the current viewport? I mean, someone can sit there and move the map just a tiny bit at a time and your DB gets hammered with every movement. That's not to say that you shouldn't or can't do that, I'm just curious. If I have to speculate, and you'll have to help a little here, you're only displaying markers based on the viewport. If that's the case, I would suggest displaying markers that fall within the viewport +2 zoomlevels (out, not in). This does two things: a) it allows someone to pan the map without instantly causing another call to your DB, and it also allows someone to zoom out at least 2 levels before you have to query your DB again. (2 levels is just a suggestion, you can go as far as you want obviously.) You could also do background querying ... let the user pan, wait a few seconds (maybe display a message), and then query the DB. Considering that when I first loaded your map up (and thanks to Comcast), it placed me so far away from my actual location, I started panning back to where I'm actually at. Now I pan fairly fast ... would you want your script to hit your DB every time I clicked-dragged the map? I wouldn't. I'd wait a second or two (or longer) to make sure the user is done panning before I do my query. Just my 2 cents ... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
