Hi, I'm fairly new to the Maps API, but I developed a simple kml service for displaying images from Flickr Commons in Google Earth and I was looking to see if there was a quick way of displaying this on an embedded map. The service is delivered via a NetworkLink in the kml file at
http://www.whatsthatpicture.com/flickr/commons.kml which calls
http://www.whatsthatpicture.com/flickr/commons-kml.php?BBOX=a,b,c,dI can of course get a crude web visualisation of this at e.g.
http://maps.google.com/maps?q=http:%2F%2Fwhatsthatpicture.com%2Fflickr%2Fcommons.kml but there are several limitations and I want to create my own custom map.
I have got tantalisingly close using API v3. You can see the latest efforts at
http://www.whatsthatpicture.com/flickr/commons-map-v1.php. This is intended to work as follows:
- initially calls the dynamic kml
http://www.whatsthatpicture.com/flickr/commons-kml.php with no BBOX (retrieves latest 100 images globally) and loads into into kmlLayer (works fine)
- when the user pans or zooms it refreshes the kmlLayer with data called using the current parameters from getBounds (works with manually set BBOX value, not with getBounds - see below)
Sorry, long winded introduction, now onto the problems and questions ...
- I have managed to add listeners to get the basic user events, although I think they're a bit clumsy - suggestions welcome
- I seem to be able to manually construct a url to pass to my kml service and then display the results (currently set as a region covering western Europe). I can also capture the current view using getBounds(). But trying to shape this into a standard BBOX format (removing parentheses and spaces) seems to break it, no matter what I try, so my ultimate aim of constructing the url using this has so far failed.
- when it has changed the view and layer, the listener that handles the placemark click seems to be lost, I assume because I've emptied the original layer and reloaded it?
- This was only intended as a 'quick win' re-using the existing kml, but I'm now starting to think that the effort I am putting into this would be better spent re-engineering it all to deliver json. Agreed?!
- I've also now got the 'bug' and want to try more things with this, like custom icons (including a clear indication of the 'current' icon), a 'loading' image when data is being fetched, user input queries (the kml service accepts a simple q= to run a text search), and enhanced navigation. I'd also quite like to display more placemarks and cluster them.
But before I plunge headlong into anything I'd welcome any advice, whether it's quick fixes, or longer-term approaches.
Thanks, James