Friday, June 29, 2007

[Gd] Geotagged Picasa JSON/KML Output + Driving Directions = Instant Scenic Tours!

| More

Official Google Maps API Blog: Geotagged Picasa JSON/KML Output + Driving Directions = Instant Scenic Tours!

If you were following the Google blogs yesterday, you would have heard that Picasa now gives you a sleek drag+drop interface for geotagging your photos, and that the Picasa Google data API now outputs the geotagged data using GeoRSS & GML elements. And if you were excited by all that news and immediately visited Picasa to try out the new feature, you might have noticed the big blue KML icon next to a "View in Google Earth" hyperlink. So Picasa now gives developers geotagged photo data both in KML output and the standard Google data API output formats, and that means we map developers have a lot of ways to start playing around with Picasa photos. :)

To start off the Picasa-Maps mashups, I've put together an example that combines a Picasa photo album feed with the Map API's recently announced Driving Directions feature to calculate a driving route that will get you a similar set of photos. Now, no need to be jealous of your friends' pretty landscape albums - just copy them! Try it out below by clicking "Load Album & Route." If you want to be daring, you can try it out with your own geotagged photos by copying and pasting the "View in Google Earth" hyperlink into the box. Note that it will only work in the countries where driving directions can be calculated in the API.

Link to Picasa Scenic Tour Example

How's it done? First, I pass the URL for the KML output into GGeoXML, which displays the photo markers and info windows. Then, I turn the URL for the KML output into the URL for the JSON output by replacing "alt=kml" with "alt=json-in-script", add a callback with "&callback;=loadAlbumJSON", and append a script tag to the page with that new URL. When the JSON is loaded, I parse through it to find all the valid GeoRSS elements, and I add them to a waypoints array. I then use GDirections.loadFromWaypoints to get a route calculated between all the points. Once the directions has loaded, I enable the buttons that allow you to toggle the markers, route, or photos for a better view (I personally prefer no markers). If you want to delve into the code more, view source on the page. Enjoy!


URL: http://googlemapsapi.blogspot.com/2007/06/geotagged-picasa-jsonkml-output-driving.html

Thursday, June 28, 2007

[Gd] Google Earth Outreach and KML Tutorials

| More

Official Google Maps API Blog: Google Earth Outreach and KML Tutorials

Today, Google launched the Google Earth Outreach program to help non-profit organizations showcase their content in Google Earth using KML. This site is a great resource for non-profits, and also for the rest of us. These are some of the great resources on the site:

Check it out, there's something for everyone!


URL: http://googlemapsapi.blogspot.com/2007/06/google-earth-outreach-and-kml-tutorials.html

[Gdev] Facebook Gadget

| More

Google Code - Featured Projects: Facebook Gadget

Screenshot
Author: Brian Ngo
Google APIs used:
Recieve your latest notifications on Facebook, check out your friends' latest updates, view photos, and even launch searches all from your Google Homepage.

URL: http://google-code-featured.blogspot.com/2007/06/facebook-gadget.html

Tuesday, June 26, 2007

[Gd] Validate your KML (Online or Offline!)

| More

Official Google Maps API Blog: Validate your KML (Online or Offline!)

KML is being widely adopted by applications like Mapufacture, ESRI ArcGIS, Yahoo Pipes, NASA WorldWind, Google Earth, Google Maps, Google Maps Mobile, Flickr and Platial. It's now more important than ever to make sure that your KML files are compliant with the KML standards. Here are two ways to validate your KML.

Online Validation with the Feedvalidator

Just go to feedvalidator.org and enter the URL of your KML. The Feed Validator will analyze your KML and where appropriate, will offer suggestions for how to improve your KML. Note that your KML files need to be on a publicly accessible URL to work with feedvalidator.org. If that is a problem for you, then you can install your own copy of Feed Validator (written in Python) and run it on your intranet. Feed Validator also handles RSS and Atom feeds, if you'd like to validate those as well.

Offline Validation with XML Schema

You can also validate your KML against the KML Schema . Many XML editors allow for schema validation, or you can download a validating XML parser like Xerces, libxml and validate your KML on the command line or from within your applications.

Try out the FeedValidator below! <br><a href="http://feedvalidator.org" target="_blank">Link to KML FeedValidator</a><br>

URL: http://googlemapsapi.blogspot.com/2007/06/validate-your-kml-online-or-offline.html