sg

Pazar, Kasım 27, 2005

Re: Catching multiple XMLHttpRequests


I'll answer a few questions, and then go look at all the suggestions
and see if I can fix it now.
1. Is there a reason I didn't use the GXmlHttp class? Because there
is only one line of "documentation" about it in the API
documentation and none of the examples I've found use it. I'll look
at some of the pointers I got here and check it out.
2. Under what conditions do I see problems? I use FireFox 1.07 here at
home where I've seen the errors most recently. I have a dial up
connection here and it is easy to click multiple times on zoom or do
multiple moves while waiting for the map to catch up. Each click sends
another request. In the JavaScript Console I'll start seeing
"Variable 'req' undefined" error messages after a while. On a
high speed connection I assume the map has time to update before users
have time to click so many more times and the problem happens less
often.
3. How do I select the points based on the zoom level? How do I decide
which points to include? I do this in the PHP code back on the server,
and it never needs to know the zoom level. (I'd be happy to send you
a copy as an example). That code receives the bounding box of the map
in the URL parameters of the XmlHttp request and uses that to limit the
MySQL search only to pictures in the displayed area. This can still
result in thousands of hits, so I have the PHP code fill in a low
resolution array of where points have landed, and reject points that
land in the same cell. To prevent near points on both sides of a
boundary in this array from both being allowed, I build the array at 2x
the maximum number of points I want across or down, and set all 9
points around a hit as "occupied". Without an ORDER BY clause, SQL
has no guarantee that the points will come out of the DB in any order,
so I hoped that the same map would display a different random set of
images at different times. (Doesn't exactly work that way, oh well).
The images were originally set to very approximate locations, only
close enough to make them land in my old set of static maps and often
hundreds were lumped in the same location. I have written a private
Google map (violating the terms of use?) that allows me to step rapidly
through the images and click on better locations for each of them. This
makes updating the DB easy and fun but it will still take me a while to
get through all 7000 of them.

Thanks for all your suggestions, links and questions. I'll go look
and see if I can clean this up. It isn't "live" on my site yet
but I'm getting close to putting it there and throwing out all my old
static maps.

0 Comments:

Yorum Gönder

<< Home


Komik Videolar   islam  şarkı sözleri  yemek tarifleri  gelibolu  huzur   sağlık