The plan for this afternoon was to enjoy the afternoon off, ignore work type things and other mountains of stuff that have piled up and can't be sorted until next week; and take a walk over the mountains with the camera and explore another bit of the region that I've not seen yet… But, there's always one of them isn't there… Rain had been forecast and the sky seems to back the weather forecasters up for a change.
That either left me with the choice of going to visit the in-laws for the afternoon (and when I say visiting, go and sit round watching the TV as they watch the TV) or do something involving acronyms and gibberish (as one of my friends puts it). What I'm working through is trying to generate KML, parse that through jQuery and output it as an embedded 3D system on a web page.
The idea behind it, is simply to grab the EXIF out of the images at upload time (or by parsing a directory later on), checking whether these images have Geotags, and if they have, include them in the KML file. The first option of grabbing them at upload time would be preferable as the EXIF can be written off to SQL and when called later on, things like descriptions, titles, etc can be drawn out of the database, placed alongside the images that have the GPS co-ordinates, and then these all fed in to the output system and loaded on to the Google Maps plugin for jQuery.
One plugin I have found that I like the look of, but it's probably a bit cumbersome for most applications, is the kmltree extension for jQuery, which brings up a Google Earth window in the page (assuming that the browser has got Google Earth Plugin installed for it), and then from there in creates a list of the images, so click and you're away to the location, click the link therein, and up pops an image window with the images in there for that location, and the good thing about it… The images don't require sending up to Panoramio to appear within Google Maps for you to show off; so you can maintain and manage what you want folk to see directly through a website.
With working through it this afternoon, whilst the rain was belting down, and me sat here really wishing I could scoot off up the mountains and enjoy my afternoon, the hardest thing I found was to build the actual KML template… Sure, it's just an extension of XML, but just to show a set of images, that was quite atrocious to work through… The template has more lines of echo'd PHP in there than the actual class that builds out the EXIF data has in it.
Sometime, maybe soon, maybe later, I may get round to sharing the PHP and also the KML generation templates, so you could build this in to your own web application should you so need it (that's when I've actually tested it and made sure that it doesn't actually kill kittens or something when it's used!)
No comments:
Post a Comment