tag:blogger.com,1999:blog-185498452024-02-28T00:56:40.506-08:00Official Google Maps API BlogPamela Foxhttp://www.blogger.com/profile/15947664772001597300noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-18549845.post-84213439859120792912008-05-19T17:04:00.000-07:002020-07-17T16:07:45.692-07:00libkml Marches On!<span class="byline-author">Posted by Mano Marks, Geo APIs Team</span>
<p>Google has released version 0.2 of <a href="http://code.google.com/p/libkml/">libkml</a>, an open source library for serializing and deserializing KML files. libkml now uses a memory management scheme based on "smart pointers", and has deprecated the use of SCons. On Linux and Mac OS X it now use the traditional automake, and on Windows Microsoft Visual Studio. The "smart pointer" scheme presently restricts support for some alternate language bindings, so libkml 0.2 can only be called from C++, Java, and Python. Version 0.1 also supported PHP, Perl, and Ruby, and is still available in the subversion repository if you're interested. We plan on restoring the those bindings as soon as we can.</p>
<p>Check out the <a href="http://code.google.com/p/libkml/wiki/UserGuide02x">User Guide</a>, and particularly the <a href="http://code.google.com/p/libkml/wiki/UserGuide02x#Future_development">future development list</a>.</p>
Here's an example of what the code looks like:</p>
<pre>
// createkml.cc
// This program uses the KmlFactory to create a Point Placemark and
// prints the resultant KML on standard output.
#include <iostream>
#include <string>
#include "kml/dom.h"
// libkml types are in the kmldom namespace
using kmldom::CoordinatesPtr;
using kmldom::KmlPtr;
using kmldom::KmlFactory;
using kmldom::PlacemarkPtr;
using kmldom::PointPtr;
int main() {
// Get the factory singleton to create KML elements.
KmlFactory* factory = KmlFactory::GetFactory();
// Create <coordinates>.
CoordinatesPtr coordinates = factory->CreateCoordinates();
// Create <coordinates>-122.0816695,37.42052549<coordinates>
coordinates->add_point2(-122.0816695,37.42052549);
// Create <Point> and give it <coordinates>.
PointPtr point = factory->CreatePoint();
point->set_coordinates(coordinates);
// Create <Placemark> and give it a <name> and the <Point>.
PlacemarkPtr placemark = factory->CreatePlacemark();
placemark->set_name("Cool Statue");
placemark->set_geometry(point);
// Create <kml> and give it <Placemark>.
KmlPtr kml = factory->CreateKml();
kml->set_feature(placemark);
// Serialize to XML
std::string xml = kmldom::SerializePretty(kml);
// Print to stdout
std::cout << xml;
}</pre>
<p>
<p>The engineers who worked on it put a lot of thought into making it fast and light weight. However, it is an alpha release. We really would love to have comments and feedback on it, both in the <a href="http://groups.google.com/group/kml-support/">KML Developer Support forum</a> and in the <a href="http://code.google.com/p/libkml/issues/list">libkml issue tracker</a>.Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-62689942136753038142008-05-07T17:47:00.000-07:002020-07-17T16:07:44.039-07:00Armageddon Pills and KML in Google Earth<span class="byline-author">Guest post by Matt Brown, concept3D</span>
<p>I’m Matt Brown, a kml developer and designer at concept3D in Boulder, Colorado.</p>
<p>Google Earth has provided a new group of developers with the opportunity to build virtual ‘geowebsites’ specific to vertical markets. <a href="http://www.armageddonpills.com/index.html"><i>Armageddon Pills</i></a>, a travel book by John Higham, combines this power of Google Earth and a printed book to illustrate the tale of one family’s journey around the globe in 52 weeks.</p>
<p>After creating numerous kml files, he asked us (concept3d) to create a browser look and feel while in Google Earth. We attempted to simplify the Google Earth experience for a broader audience, focusing on its on-screen and balloon navigation systems.</p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhh4iWkp2Ng4G8ZR7PTGzgFLpnL-zvN8ZopPpbfOGKi2V-wVn5knREQ70-rQAU0Ib-rWL_FAue7Wo9YzC7WAuD0PvST1Pf8q2VIxoqjWLcd8dDQTaUhoRPtcf2nwH19fTNC0K0jQ/s1600-h/ap.png"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 287px; height: 337px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhh4iWkp2Ng4G8ZR7PTGzgFLpnL-zvN8ZopPpbfOGKi2V-wVn5knREQ70-rQAU0Ib-rWL_FAue7Wo9YzC7WAuD0PvST1Pf8q2VIxoqjWLcd8dDQTaUhoRPtcf2nwH19fTNC0K0jQ/s320/ap.png" alt="" id="BLOGGER_PHOTO_ID_5197787913313944626" border="0" /></a>
<p>When opening the file, you will find a main menu, or in this case the table of contents, of on-screen buttons. This menu is broken down into chapter groupings that contain sub-menus of icons related to the book. This allows the reader to find ‘where they are’ in the book, and gives them the ability to ‘read’ the kml from start to finish. Each balloon along the traveled path offers an interesting snippet and sometimes a photo or video associated with their locations. Navigation arrows were added to each balloon to allow the information to be chronologically documented and experienced by the end user, and a “home” button to get back to the main menu. Additionally, there are “menu” placemarks scattered around the globe that will help you find the main menu if you are lost in space.</p><div style="text-align: center;">
</div>
We rely on <a href="http://code.google.com/apis/kml/documentation/kmlreference.html#featureanchor">feature anchors</a> for navigating between balloons and a very high altitude (12680000 meters) to create the effect of a menu. You can download our full KML <a href="http://www.armageddonpills.com/Google_Earth_.html">here</a>.<p></p>A big thanks to Mano Marks for his insight and for taking interest in this project. If you have any questions or comments, please email me at matt.brown@concept3d.com.Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-32309978430311649742008-04-23T22:48:00.000-07:002020-07-17T16:07:41.748-07:00Google Developer Days: Meet the Google Geo Engineers<span class="byline-author">Posted by Mano Marks, Google Geo APIs Team</span>
<p>
<a href="http://code.google.com/events/developerday/">Google Developer Days 2008</a>, a set of one-day developer events, are back and will take place in locations around the world. We've designed these events for developers with strong coding backgrounds, so that we can discuss our APIs, developer tools and applications.
</p>
<p>
We'll host Google Developer Days in these locations:
<ul><li><a href="http://code.google.com/intl/ja/events/developerday/home.html" title="Yokohama, Japan" target="_blank">Yokohama, Japan</a> (June 10)</li><li> <a href="http://code.google.com/intl/zh-CN/events/developerday/home.html" title="Beijing, China" target="_blank">Beijing, China</a> (June 12)</li><li><a href="http://code.google.com/intl/zh-TW/events/developerday/home.html" title="Taipei, Taiwan" target="_blank">Taipei, Taiwan</a> (June 14)</li><li><a href="http://code.google.com/events/developerday/home.html" title="Sydney, Australia" target="_blank">Sydney, Australia</a> (June 18)</li><li> Mexico City, Mexico (June 23)</li><li>Sao Paulo, Brazil (June 27)</li><li>London, UK (Sept 16)</li><li> Paris, France (Sept 18)</li><li> Munich, Germany (Sept 23)</li><li>Madrid, Spain (Sept 25)</li><li> Milan, Italy (Oct 21)</li><li>Prague, Czech (Oct 23)</li><li>Moscow, Russia (Oct 28)</li></ul>If you're based in the US, we encourage you to come to <a href="http://code.google.com/events/io/">Google I/O</a>, on May 28-29 in San Francisco.
</p>
<p>
At Google Developer Day, our Maps and KML engineers will share their inside knowledge on our developer tools and APIs, including the <a href="http://code.google.com/apis/maps/">Google Maps API</a> and <a href="http://code.google.com/apis/kml/">KML</a>. In many locations we'll do deep dives into code and conduct hands-on codelabs. If you come to Yokohama and Mexico City, say hi to me and Pamela Fox.
</p>
<p>
We've posted <a href="http://code.google.com/events/developerday/">detailed information</a> for our early dates and will be adding more information for other locations soon. If you're a developer, we encourage you to <a href="http://code.google.com/events/developerday/">sign-up</a> for a Google Developer Day at a nearby location. I hope to see you there.
</p>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-67122063102770280842008-04-14T13:32:00.000-07:002020-07-17T16:07:44.339-07:00KML is now an open standard<span class="byline-author">Posted by Mano Marks, Geo APIs Team</span>
<p>The Google Geo APIs are all about building powerful tools to share geo information with the world. We've been really interested in seeing the way that KML has been used all across the web to express geographic content, and today we're very excited to announce that the <a href="http://www.opengeospatial.org/">Open Geospatial Consortium</a> has announced its acceptance of KML 2.2 as an official OGC Standard. That means that KML is not just a Google Earth standard, it's not even just a Google standard. It is now an official standard for presenting geographic data. Read more about this great news on the <a href="http://google-latlong.blogspot.com/2008/04/kml-new-standard-for-sharing-maps.html">LatLong blog</a>.</p>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-80450677079772879152008-04-02T20:48:00.000-07:002020-07-17T16:07:45.280-07:00Text images without (much) coding<span class="byline-author">Posted by Mano Marks, Google Geo APIs Team</span>
<br/>
<p><a href="http://xbbster.googlepages.com/">Valery Hronusov</a> has created a <a href="http://ec.geoblogspot.com/GELab/ecLabel.htm">cool visual interface</a> for his <a href="http://text2image.ning.com/">Text to Image</a> service. This service allows you to easily create a text image, control its color, add shadow effects, and then place it on directly a map. It outputs to KML, Maps API JavaScript code, or just a plain URL to an image. This is really useful to creating, for instance, road labels or text based ScreenOverlays. All you have to do is copy the output into your own code. The interface is pretty simple:</p>
<p><img src="http://lh4.google.com/xbbster/R_FT2YJlWCI/AAAAAAAAAwM/L8gzmJMwd5E/texttolabels.jpg?imgmax=512" width="450" height="550"/></p>
<p>Here's a sample of the <a href="http://code.google.com/p/gmaps-samples/source/browse/trunk/text2image/text2image.kml">KML output</a>:</p>
<pre>
<GroundOverlay>
...
<Icon>
<href>http://text2image.ning.com/TextToImage.php?text=San+Francisco%2C+here+we+come%21&LabelType=2&FontSize=24&casing=asis&alignment=1&font=arial&fontStyle=bold&LabelLocation=topleft&dX=11&dY=0&FontColor=00ff00f9&ShadowColor=00000000&depth=3&effect=0&LabelHeight=35&LabelWidth=438&IconHeight=18&IconName=http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png</href>
</Icon>
</pre>
<p>Here's a sample of the JavaScript code it creates:</p>
<pre>
var pointCenter = new GLatLng(37.775196,-122.419204);
var map = new GMap2(document.getElementById("map"));
map.setCenter(pointCenter, 10);
var pointSW = new GLatLng(37.741743,-122.470044);
var pointNE = new GLatLng(37.786659,-122.272387);
var groundOverlay = new GGroundOverlay(
"http://text2image.ning.com/TextToImage.php?text=San+Francisco%2C+here+we+come%21&LabelType=2&FontSize=24&casing=asis&alignment=1&font=arial&fontStyle=bold&LabelLocation=topleft&dX=11&dY=0&FontColor=00ff00f9&ShadowColor=00000000&depth=3&effect=0&LabelHeight=35&LabelWidth=438&IconHeight=18&IconName=http://maps.google.com/mapfiles/kml/shapes/shaded_dot.png",
new GLatLngBounds(pointSW, pointNE));
map.addOverlay(groundOverlay);
</pre>
<p>And here's what it looks like:</p>
<iframe src="http://gmaps-samples.googlecode.com/svn/trunk/text2image/text2image.html" height="325" width="425"></iframe>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-83973785733491588882008-03-31T15:44:00.000-07:002020-07-17T16:07:45.633-07:00We're Going to Google I/O!<span class="byline-author">Posted by Mano Marks, Geo APIs Team</span>
<p>I'm getting excited about <a title="Google I/O" href="http://code.google.com/events/io/">Google I/O</a> May 28th & 29th in San Francisco. The reason I'm excited is that many of you will be there too, and it will be a great chance to meet. Google I/O is like the Google Developer Day we had last year, which in turn was based on Google Geo Developer Day, which we had two years ago. This year, there will be a whole track on <a title="Maps & Geo" href="http://code.google.com/events/io/sessions.html#geo">Maps & Geo</a>, including KML, Maps, and Mapplets. There will, of course, be other tracks, AJAX, APIs & Tools, Social, and Mobile. Both Pamela and I will be there, along with all the Google Geo stars.</p>
<p>The event won’t be limited to just Google APIs and developer tools. There is a lot of knowledge about web development in general at Google, and we’d like to share that expertise so that all applications on the web get better. And of course, we're focusing a lot on Open Source tools, like the new <a href="http://google-opensource.blogspot.com/2008/03/introducing-libkml-library-for-reading.html">libkml </a>(more about that in a later post).</p>
<p>Over the two days of Google I/O, Google engineers and other leading software developers will share their knowledge in <a title="breakout sessions" href="http://code.google.com/events/io/sessions.html">breakout sessions</a>, hands-on Code Labs, and Q&A Fireside Chats. That's your chance to sit down with Google engineers and ask all the questions you've ever wanted to, as well as meet each other.</p>
<p>Visit the <a title="Google I/O website" href="http://code.google.com/events/io/" id="vxte">Google I/O website</a> to learn more and <a href="https://www.weboom.com/sparks/google_io/forms/">register</a>. Space is limited, so be sure to make plans to attend now.</p>
<p>And after Google I/O, we'll be doing other developer days all over the world, so if you can't make it to SF, hopefully you can make it to one closer to you.</p>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-83604392932082182732007-12-08T08:12:00.000-08:002020-07-17T16:07:45.516-07:00Using the Chart API in KML for Quick Data Visualization<span class="byline-author">Posted by Mano Marks, Geo API Team</span>
<p>Google just released the the <a href="http://code.google.com/apis/chart/">Google Chart API</a>. We don't often boast about other non-Geo APIs in this blog, but this one is amazing, easy to use, and, best of all, has great potential for use in Geo apps.</p>
<p>Using the chart API is simple. By passing various parameters in the URL to the chart server, you can control how the chart looks in the image that is returned. Your custom chart image can be placed in Maps API info windows, KML <description> balloons, etc. Let's look at how that second scenario works.</p>
<p>Let's suppose that you wanted to show pizza deliveries at particular locations based on significant points in a romantic relationship. You know how it goes — someone likes pizza, they order it. When they get involved with someone, sometimes they order at a that person's house, so deliveries go down. Around the holidays, they eat less pizza because they're going to parties, but when they break up with someone, they eat a lot of pizza because they're lonely and depressed at home. Very sad. Anyway, I've created a sample using KML, and I placed it in a park in New York so no one thinks I'm watching their actual pizza consumption.</p>
<pre class = "code">
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name />
<visibility>1</visibility>
<Snippet>Relationship versus Pizza</Snippet>
<description><![CDATA[<img src="http://chart.apis.google.com/chart?cht=bvs&
chs=200x150&chd=t:10,15,25,13,3,35&
chxt=x,x&chxl=0:|Jul|Aug|Sept|Oct|Nov|Dec|1:|Start|||Thanksgiving||Breakup&
chtt=Pizza%20Deliveries|by%20Relationship%20Progress"/>]]></description>
<Point>
<coordinates>-74.01490535558324,40.70396174218289,0</coordinates>
</Point>
</Placemark>
</kml></pre>
<p>See, pretty simple. I'll leave it up to you exploring the Chart API documentation to get more info on creating the chart, but I wanted to show something else you could do with KML 2.2. <b>This will only work in Google Earth</b>, but it's pretty cool. You use the new <code><ExtendedData></code> and <code><Data></code> elements to create a Balloon template, putting the entity replacements (those codes that look like: $[something]) in the URL. That way, you can put only the data relevant to a particular point in a particular balloon, and you don't have to recreate the whole URL for each <code><Placemark></code>. And if you change the chart, but not the data, all you have to change is one <code><BalloonStyle></code>.
<pre class = "code">
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
<name></name>
<open>1</open>
<Style id="pizza">
<BalloonStyle>
<text><![CDATA[<img src="http://chart.apis.google.com/chart?cht=bvs&chs=200x150&chd=t:$[PizzaDeliveries1],$[PizzaDeliveries2],$[PizzaDeliveries3],$[PizzaDeliveries4],$[PizzaDeliveries5],$[PizzaDeliveries6]&chxt=x,x,y&chxl=0:|$[PizzaDeliveries1/displayName]|$[PizzaDeliveries2/displayName]|$[PizzaDeliveries3/displayName]|$[PizzaDeliveries4/displayName]|$[PizzaDeliveries5/displayName]|$[PizzaDeliveries6/displayName]|1:|$[RelationshipDataPoint1]|$[RelationshipDataPoint2]|$[RelationshipDataPoint3]|$[RelationshipDataPoint4]|$[RelationshipDataPoint5]|$[RelationshipDataPoint6]&chtt=Pizza%20Deliveries|by%20Relationship%20Progress"/>]]></text>
</BalloonStyle>
</Style>
<Placemark>
<name>Pizza Deliveries</name>
<styleUrl>#pizza</styleUrl>
<...
<ExtendedData>
<Data name="PizzaDeliveries1">
<displayName>Jul</displayName>
<value>10</value>
</Data>
...
</ExtendedData>
...
</pre>
You can find the full sample here: <a href="http://gmaps-samples.googlecode.com/svn/trunk/extendeddata/ext-data-charts.kml">here</a>. For more info about creating templates, check out <a href="http://code.google.com/apis/kml/documentation/extendeddata.html">Adding Custom Data</a>.Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-56486011517620429692007-10-29T16:15:00.000-07:002020-07-17T16:07:43.509-07:00KML Articles Abound: It's About Time<span class="byline-author">Posted by Mano Marks, Geo APIs Team</span>
<br/>
<p>
We've added two great new KML articles to <a href="http://code.google.com/">code.google.com</a>.
</p>
<br/>
<img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnrUnY1gc_C-Tzemaya9oFxtyahQ9skmLJ7FGalsX2egq2LrF9-0QGSOES8L7YsN0thYnwmk9JydAnp3NAkxCinWFpQzJTyM0esE4VmovAPJmfuzzx3chTYAX2d3u325F1f-Marw/s320/statehood_thumb.gif" alt="" id="BLOGGER_PHOTO_ID_5126912355029607362" border="0" /> <p style="text-align: left;">First, we've added a new article on "Time and Animation" to our "Topics in KML" series. The ability to associate geospatial elements with temporal data was added about a year ago to Google Earth 4.0, but this is the first extensive article we've published about time in KML. It includes information on using <code><a href="http://code.google.com/apis/kml/documentation/kml_tags_beta1.html#timestamp">TimeStamp</a></code>, <code><a href="http://code.google.com/apis/kml/documentation/kml_tags_beta1.html#timespan">TimeSpan</a></code>, and animation of 3D models in Google Earth.</p>
<a href="http://code.google.com/apis/kml/documentation/time.html">Click here to read!</a>
<br clear="all"/>
<img style="margin: 0pt 10px 10px 0pt; float: right; cursor: pointer; width: 170px; height: 122px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip5oW-6g0U4vdS5_GaTxfkKWAZUhVEX8_6Zr2bwmr2KEQ1z-D8dw1znljhiKBqTU1GFlLqJ2csIMUAfgegFqeb9KCwsATSJnJMVlGSh0yDgDl2c8cvWzX486CSfWFjEiXwXjBgzw/s320/kmlgme2_thumb.jpg" alt="" id="BLOGGER_PHOTO_ID_5126913806728553426" align="right" border="0" />
<p>Second, we've published a guest article by Valery Hronusov, from Perm State University in Russia, "Using KML in Google Mashup Editor." He shows how you can easily include a KML file in a Google Mashup Editor project to create a Google Maps mashup. Valery is a long-time KML developer who has produced a lot of innovative work. Most recently, he helped found <a href="http://pictearth.com/">Pict'Earth</a>, which combines advanced image acquisition products and services. Check out some of their <a href="http://pictearth.com/missions.html">amazing imagery</a>.</p>
<a href="http://code.google.com/support/bin/answer.py?answer=78649&topic=11367">Click here to read!</a>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-17433864369395874992007-10-23T15:30:00.000-07:002020-07-17T16:07:40.864-07:00Make your KML Flash-y!<span class="byline-author">Posted by Mano Marks, Geo API Team</span>
<p>
The recent Google Earth 4.2 release added the ability to view Flash content, in Windows versions of Earth. This is great news for KML authors, especially given how easy it is to include Flash in your info bubbles. All you have to do is use the param and embed tags, just as if you were embedding it in a normal webpage. I was looking at one of the <a href="http://www.youtube.com/earthoutreach">youtube videos</a> from the <a href="http://earth.google.com/outreach/index.html">Google Earth Outreach team</a>, and noticed the "Embed" text box. I selected, copied and pasted, and got this:
</p>
<pre class = "code">
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/5LzPw8-CGdA"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/5LzPw8-CGdA"
type="application/x-shockwave-flash" wmode="transparent"
width="425" height="350"></embed></object>
</pre>
<p>
After putting that code directly in the description element of a KML Placemark and decreasing the width and height a bit, I got this:
</p>
<pre class = "code">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>Declan Butler's Avian Flu Outbreaks in Google Earth</name>
<description><![CDATA[
<object width="240" height="200">
<param name="movie" value="http://www.youtube.com/v/_N805-TyUiY"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/_N805-TyUiY"
type="application/x-shockwave-flash" wmode="transparent" width="240"
height="200"></embed></object>]]>
</description>
<LookAt>
<longitude>101.5513816532019</longitude>
<latitude>13.65113039555518</latitude>
<altitude>0</altitude>
<range>3571781.303404128</range>
<tilt>0</tilt>
<heading>10.18456659033348</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<Point>
<coordinates>100.3689268271656,15.74695793086107,0</coordinates>
</Point>
</Placemark>
</kml>
</pre>
<p>
Here's what this looks like in Earth - a nice description balloon with an embedded YouTube video:
<img src="http://gmaps-samples.googlecode.com/svn/trunk/flashinkml/youtube-kml.png"/>
<p>
And this works just the same on Maps too. Here's what it looks like in a Maps API map:
</p>
<iframe src="http://gmaps-samples.googlecode.com/svn/trunk/flashinkml/youtube-kml.html" height="350" width="550" frameborder="0">
<a href="http://gmaps-samples.googlecode.com/svn/trunk/flashinkml/youtube-kml.html">Youtube in KML Example</a>
</iframe>
<p>
But video isn't all you can do - any Flash application can be embedded. <a href="http://www.gearthhacks.com/">Google Earth Hacks</a> allows you to <a href="http://www.gearthhacks.com/geboards/">view and post to their forums</a> from within their info bubbles, and <a href="http://gisplanet.blogspot.com/2007/10/geochat-room.html">Valery Hronusov</a> puts a <a href="http://wwwl.meebo.com/">Meebo</a> chat room in his.
</p>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-62813811106213684992007-10-16T15:05:00.000-07:002020-07-17T16:07:44.098-07:00Better KML Support in Maps API (Dynamic Streaming Markers, Oh my!)<span class="byline-author">Posted by Mano Marks, Geo APIs Team</span>
<p>
Maps has just added support for view and interval based refresh in KML Network Links. This means that NetworkLinks can now provide you with dynamic, living content. You can, for instance, refresh marker locations every few seconds, or load only the geometry contained within the current viewport. This reduces load on your server and the browser, and provides for a richer experience for the user. These types of network links have worked in Google Earth for quite a while now, but this is the first time that they're working in Maps, and in the Maps API using GGeoXml.
</p>
<p>
OK, enough said, let's see some code. The following is an example of a <code>NetworkLink</code> that uses view based refresh:
</p>
<pre class="code">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<NetworkLink>
<description>photos, updates once you stop moving the map.</description>
<name>Panoramio</name>
<Link>
<href>http://www.panoramio.com/kml.php</href>
<viewRefreshMode>onStop</viewRefreshMode>
<viewRefreshTime>1</viewRefreshTime>
</Link>
</NetworkLink>
</kml>
</pre>
<p>
This network link retrieves KML through a PHP script hosted at <a href="http://panoramio.com" target="_blank">panoramio.com</a>. Since this network link has a <code>viewRefreshMode</code> of <code>onStop</code>, it will automatically append a bounding box parameter to the end of the URL - <code>BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]</code> - with the bracketed parameters replaced by values that describes the current map viewport. So, one second after the user stops panning or zooming the map, the NetworkLink might call a URL like this:
<pre class = code>
http://www.panoramio.com/kml.php?BBOX=-10,-10,10,10
</pre>
Then the <code>kml.php</code> file looks at the BBOX parameter value sent in and sends back a KML document that only contains the placemarks visible inside that bounding box. The end result, when embedded on a Maps API map, looks something like this:
</p>
<iframe src="http://gmaps-samples.googlecode.com/svn/trunk/vbr/vbr.html" frameborder="0" width="550" height="700">
</iframe>
<p>If you want more information on view based refresh, check out the <a href="http://code.google.com/apis/kml/documentation/kml_tags_beta1.html#viewformat">KML Reference</a>. If you want more information on using KML in the Google Maps API, check out the <a href="http://www.google.com/apis/maps/documentation/reference.html#GGeoXml">Maps API documentation</a>.</p>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-12447831399392692612007-06-28T11:32:00.000-07:002020-07-17T16:07:40.386-07:00Google Earth Outreach and KML Tutorials<span class="byline-author">Posted by Mano Marks, Geo API Team</span>
<p>
Today, Google launched the <a href="http://earth.google.com/outreach/index.html">Google Earth Outreach</a> 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:
</p>
<ul>
<li><a href="http://earth.google.com/outreach/tutorials.html" target="_blank">Tutorials</a> on a variety of topics. Particularly interesting is the <a href="http://earth.google.com/outreach/tutorial_spreadsheet.html" target="_blank">tutorial on using Google Spreadsheets to produce KML</a>.</li>
<br /><img src="http://earth.google.com/outreach/images/spreadsheet_placemarks.png" alt="Spreadsheets tutorial" width="250" style="border:1px solid black"/><br />
<br/>
<li>A <a href="http://earth.google.com/outreach/showcase.html" target="_blank">showcase</a> of what others have created</li>
<br /><img src="http://g.codesite.articles.googlepages.com/mmarks.blogpost.showcasestitched.jpg" alt="showcase" width="250" style="border:1px solid black"/><br />
<br/>
<li><a href ="http://earth.google.com/outreach/case_studies.html" target="_blank">Case studies</a> in how non-profits have used Google Earth to tell their stories.</li>
<br />
<li>Information on how non-profits can obtain a <a href="http://services.google.com/googlegrants/earth_application" target="_blank">Google Earth Pro license</a>.</li>
</ul>
<p>
Check it out, there's something for everyone!
</p>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-71780186465881053612007-05-14T15:22:00.000-07:002020-07-17T16:07:44.633-07:00v2.80: Making Image Overlays Easy with GGroundOverlay & GGeoXML<span class="byline-author">Posted by Pamela Fox, Maps API Team</span>
<p>
In the past, developers who wanted to overlay an image on top of the map either had to use GTileLayerOverlay, creating tiles for each zoom level, or they had to use a user extension. Well, now, we're happy to introduce a quick & easy way to overlay images on the map by using the standalone <a href="http://www.google.com/apis/maps/documentation/reference.html#GGroundOverlay" target="_blank">GGroundOverlay</a> function or by loading a KML file containing ground overlays with <a href="http://www.google.com/apis/maps/documentation/reference.html#GGeoXml" target="_blank">GGeoXML</a>.
</p>
<p>
With GGroundOverlay or <a href="http://code.google.com/apis/kml/documentation/kml_tags_21.html#groundoverlay" target="_blank">GroundOverlay in KML</a>, you can specify a latitude/longitude bounding box to load an image (JPG/PNG/GIF) onto the map. Note that in the current implementation, the opacity and rotation values of the ground overlay can't be specified in the GGroundOverlay function and will be ignored by the GGeoXML renderer when found in a KML file.
</p>
<p>
If you're curious to see how your KML file that contains a ground overlay would look when rendered with GGeoXML, just try loading in the URL at <a href="http://maps.google.com" target="_blank">maps.google.com</a>. It should look the same when used on an API map. If you're new to ground overlays and want to play around, check out the "GroundOverlay resizer" utility below. It lets you enter in a URL, click "Add GroundOverlay," drag the corners around to resize, and then see either the KML or javascript equivalent of what's on the map.
</p>
<iframe frameborder="0" width="500" height="820" src="http://gmaps-samples.googlecode.com/svn/trunk/groundoverlay/groundoverlaysizer.html">
<a href="http://gmaps-samples.googlecode.com/svn/trunk/groundoverlay/groundoverlaysizer.html" target="_blank">Link to GroundOverlay Resizer</a>
</iframe>Pamela Foxhttp://www.blogger.com/profile/08743930131967556235noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-45110482747700641162007-05-03T11:27:00.000-07:002020-07-17T16:07:42.629-07:00Introduction and Yahoo! Pipes<span class="byline-author">Posted by Mano Marks, Geo API Team</span>
<p>
I wanted to introduce myself. Like Pamela Fox and Chris Schalk, I work on the Geo API Team. My focus has been on helping people with KML. Traditionally, this meant working with Google Earth, but increasingly KML is being used in a variety of applications, from Maps, the Maps API, Google Maps for Mobile, and My Maps. Google is also making KML content available through KML Search in Earth and Maps. It's an exciting world, and I often say that I have the best job at Google. If you want more help with KML, check out the <a href="http://groups.google.com/group/kml-support">KML Support group</a> in Google Groups.
</p>
<p>
Now for the announcement. <a href="http://pipes.yahoo.com/pipes/" target="_blank">Yahoo! Pipes</a> now allows output as KML. "Pipes is an interactive feed aggregator and manipulator." Pipes allows you to take feeds from a variety of sources, mash them all together, and create your of custom feed out of them. And now, you can push that content out using KML, even if the original content was not in KML. Consumers of your feed will be able to either click on a link and download KML, or point the Maps API or a NetworkLink directly at the feed. Pipes already accepts KML as an input as they accept any XML files.
</p>
<p>
For example, <a href="http://pipes.yahoo.com/pipes/pipe.info?_id=AjnnIana2xG7EedQYEsBXw">Kiva Loans by Location</a> is a Pipe that takes a listing of open microloans on <a href="http://www.kiva.org">Kiva.org</a> and geocodes each item based on the nationality of the entrepreneur requesting a loan. It's possible to use the <a href="http://pipes.yahoo.com/pipes/pipe.run?_id=AjnnIana2xG7EedQYEsBXw&_render=kml">KML output of this Pipe</a> in a variety of ways including exploring it in Google Earth and plotting it on Google Maps using the maps API, like this example:
</p>
<iframe src="http://gmaps-samples.googlecode.com/svn/trunk/pipes/pipes-sample.html" frameborder="0" width="520" height="350">
<a href="http://gmaps-samples.googlecode.com/svn/trunk/pipes/pipes-sample.html">Link to Pipes sample</a>
</iframe>
<br />
To get the KML output of any Pipes feed, add &_render=kml to the end of the URL. That produces KML that you can use in a NetworkLink or directly in the Maps API. In a NetworkLink, put it in the <href> element:
<pre class="code">
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<NetworkLink>
<name>Yahoo! Pipes Example</name>
<Link>
<href>http://pipes.yahoo.com/pipes/pipe.run?_id=AjnnIana2xG7EedQYEsBXw<b>&amp;</b>_render=kml</href>
</Link>
</NetworkLink>
</kml>
</pre>
There are two things to be careful of, when loading data into Google Earth. First, Pipes adds TimeStamps by default to the KML output, which might mean that if your time slider isn't fully expanded, you won't see all the points. Second, the "&" in the URL that points to the KML file will have to be escaped. I highlighted that in bold in the example above.
If you want to use the KML in the Maps API, just load it using GGeoXML. The code for the example above is
<pre class="code">
<script type="text/javascript">
var map;
var geoXml;
function load() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
geoXml = new GGeoXml("http://pipes.yahoo.com/pipes/pipe.run?_id=MGYBl4H52xGXVIf6y6ky6g&_render=kml");
map.setCenter(new GLatLng(0,0), 1);
map.addOverlay(geoXml);
}
</script>
</pre>Mano Markshttp://www.blogger.com/profile/07480503243910499765noreply@blogger.comtag:blogger.com,1999:blog-18549845.post-76982247678108145202007-02-14T06:20:00.000-08:002020-07-17T16:08:17.776-07:00Search for KML in Google Earth<p><span class="byline-author">Posted by Chikai Ohazama ♥, Product Manager, Google Earth Team </span></p>
<p>Search is at the heart of everything we do here at Google. That's why
I'm excited to announce a new innovation in search available today in
<a href="http://earth.google.com">Google Earth</a>. Users can now search through all of the
world's <a href="http://earth.google.com/kml/">Keyhole Markup Language (KML)</a> files,
making the millions of Google Earth layers on the Web instantly
accessible for geobrowsing and exploration. Last month, we
encouraged you, our Maps API users, to <a href="http://googlemapsapi.blogspot.com/2007/01/get-more-traffic-to-your-maps-api-site.html">create KML site maps for your
mashups</a>. Today's launch is the next step towards making those sitemaps -
and all of the world's geographic information - discoverable by users
worldwide.</p>
<p>To try it out, just start up Google Earth, zoom to a location of
interest, and type in a search query. For example, go to New Zealand,
and search for "Lord of the Rings." You'll see the KML results below
the local results in the search panel on the left hand side:</p>
<p><img src="http://gmaps.blog.googlepages.com/kml_search_results.jpg"></p>
<p>Click on one of the KML results and the pop-up bubble will come up in
the 3D view and you can read more about the KML file:</p>
<p><img src="http://gmaps.blog.googlepages.com/KML_Placemark_Opened.jpg" width="500px" height="550px"></p>
<p>If it seems interesting, then you can click on the link and layer the
KML file over your Google Earth imagery:</p>
<p><img src="http://gmaps.blog.googlepages.com/KML_Results_On_Map.jpg" width="500px" height="550px"></p>
<p>This will initially be available only in Google Earth, but soon the
ability to search and view KML files will be live in Google Maps. Stay tuned...</p>Jess Leehttp://www.blogger.com/profile/09533188615658121518noreply@blogger.com