Hi Chad Thanks so much for your reply - I think seem to have cracked it thanks to your tips.
Overall I think I simply overcomplicated things, and stripping it back has solved many problems (isn't that always the way?!). My problem with using bounds_changed was that it triggered as soon as the map loaded, which I had set up to initialise with a sample dataset of the latest 100 images. But you saying that then prompted me to question why I was doing that when I could actually use that event to set the first dataset, not just when the user intercated. That in turn solved the problem with having to re-attach the listener - I only had to do it once so there was no need. One thing I did find was that when the user dragged bounds_changed was repeatedly triggering, so I swapped it for 'idle' which appears to work well (though you don't get to specify a delay like you do with a kml NetworkLink onStop property, so if a user drags then stops and drags again, you get two triggers and two kml calls). You can see my latest efforts at http://www.whatsthatpicture.com/flickr/commons-map-v2.php Rather than annoying alerts I've now got any debugging info going into the left window, latest at top. The problem now seems to be impatience on Google's part, and the slowness of my response. This is mainly because when an event is triggered it calls my sevrer, which fetches data 'live' from the Flickr api, and then has to be converted into kml before being returned. And the unique nature of every call due to the variation in bbox parameters means caching is tricky using this method. So I do think I'll end up creating a local database of all image data (currently c. 17,000) which just gets updated periodically, perhaps overnight. This will take out the Flickr requests and responses. Aside from that, some little niggles that remain though ... I used to have it set so that on any change the existing cleared and then new data loaded - now it just seems to add extra points and I'm not sure I'd love to set a custom icon based on the one specified in the kml style, and also to have a different style one for the placemark that has just been clicked. Is this relatively straight forward? I'd also really like to have some sort of 'loading' image to show the server is doing something. Actually, thinking about this, I wonder if the map could send a request to my server to a script that kicks off the generation of the kml, and then wait for a prescribed period whilst the data is generated and cached, and then request it? A bit clumsy, but I could see this working. Anyway, thanks again for your help. As you say, it's a cool project and I've already had some positive response from some of the museums involved in the Commons. This was in response to a blog post I wrote - http://www.whatsthatpicture.com/2011/12/mapping-flickr-commons Regards, James -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/3f2GOl3kdRUJ. 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-js-api-v3?hl=en.
