View Full Version : Google Maps API

08-15-2007, 07:23 AM
Anyone know anything about this?

I have a KML file from Google Earth. I would like to merely load up the API on a website and have it zoom to the KML file, that is it. It should be easy right, but I think doing simple things like that are lost in the documentation overload the provide for the thousands of other features they have.

08-15-2007, 05:24 PM
I did one not long ago... and remember having to strip down the info required - all I did was settle for a latitude and longitude - so my final code looked like this:
<script type="text/javascript">
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(-28.167140,153.538000, 0.010510,0.000000), 16);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());


The only setting I really need is this one
map.setCenter(new GLatLng(-28.167140,153.538000, 0.010510,0.000000), 16);which sets the zoom and area I want in the center of the map - the rest is all the various controllers you can add.

So I think if you just look for one setting in your KML and go from there, you should be OK :)

08-16-2007, 08:22 AM
Ahh... but the KML includes a bunch of other stuff like pictures & placemarks I want pulled too.

08-16-2007, 05:05 PM
Well - I think you will just need to go through the documentation in order to add new things... I did add a textnode by adding this:
document.createTextNode("Marine Parade, Coolangatta")); - so I presume there will be something available.

I have never added a KML file - although I did find this on adding KML files (http://www.google.com/apis/maps/documentation/index.html#XML_Overlays) when skimming through the documentation - although I'm not sure if its what you want.

Maplets (http://www.google.com/apis/maps/documentation/mapplets/) look interesting also - although these weren't available when I used Google Maps

08-17-2007, 05:07 AM
interesting, thanks Agua.