Learning Google Maps API

Day 4 – a bit more of KML, custom icons and info boxes

Posted on: March 2, 2009

I have read few articles about KML, creating KML documents, loading KML documents into Google Earth and Google Maps… And must admit it’s pretty much straight forward task.

There is great article describing how to create KML files using PHP4 and PHP5.

One thing to note (that I have read in other place):

When a call is made from the client (Google Earth) to the server, the server must (1) return a response code of HTTP 200 and (2) set the response’s content type to text/plain or application/vnd.google-earth.kml+xml.

At this point there are still two things missing in GoogleMaps jigsaw:

  • how to change the draggable icon image, so it still shows the ‘cloud info’
  • how to create a box with checkboxes to switch off and on the overlayed KML data layers

After a while it seams like the first issue has been solved by itself… I’ve added G_DEFAULT_ICON to my GIcon definition and it started to work
icon = new GIcon(G_DEFAULT_ICON);

Reply on the second issue I’ve managed to find here:
http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/ggeoxml_loader.html

Haven’t tested it yet, but looks fairly simple to implement.

BTW, had a while working with Info Boxes (you know, those white Clouds) and there is quite a lot you can do with them, to get the ball-park idea have a look here.

Ah, and this tutorial is fantastic! Number of articles and examples huge… I would even say overwhelming. ALthough, to be honest Google Maps Documentation seams to be all you may need during the way. At least it did well to me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: