GGeoXML and addOverlay

166 views
Skip to first unread message

sabrick

unread,
Jun 17, 2008, 5:36:40 PM6/17/08
to KML Developer Support - Getting Started with KML
I've very new to this...

I have the following:

function point() {
var kml = new GGeoXml("http://code.google.com/apis/kml/
documentation/KML_Samples.kml");
map.addOverlay(kml)
}

and it's been called by a button:

<input id="Button2" type="button" value="placemark"
onclick="javascript:point()" />

what am I doing wrong? It just gives errors

barryhunter [KML Guru]

unread,
Jun 18, 2008, 8:28:55 AM6/18/08
to KML Developer Support - Getting Started with KML
The possiblities are many:

1. the map vaiable is not global
2. the point function is not global
3. you are using an old/wrong/broken version of the Maps API
4. you are simply looking at the wrong part of the earth
5. your browser is faulty
6. you have some other error

The most concise way to help diagnose the above possibilities is to
give a link to your map.

But I would also suggest that the Google Maps API group, might be able
to help you quicker and more concisely (in particular by looking are
recent and previous threads)
http://groups.google.com/group/Google-Maps-API

ravenblade

unread,
Jun 18, 2008, 9:44:03 AM6/18/08
to KML Developer Support - Getting Started with KML
I have a similar problem, my kml file doesnt want to load on my map
but when i check the kml into maps.google.com
it loads its fine,

link to my map:
http://www.engenpromotions.co.za/maps/

:S

barryhunter [KML Guru]

unread,
Jun 18, 2008, 12:18:29 PM6/18/08
to KML Developer Support - Getting Started with KML
ravenblade, see pt3 in my previous reply, and in particular the
suggestion of looking at a more relevant group where this issue is
dicussed.

sabrick

unread,
Jun 18, 2008, 1:56:33 PM6/18/08
to KML Developer Support - Getting Started with KML
Here is my website: http://65.68.82.120/Map.aspx

I have a button labeled "placemark" that's tied to:

function point() {
var kml = new GGeoXml("http://65.68.82.120/GALTEX.kml");
map.addOverlay(kml)
}

give me script errors, any ideas?

ManoM

unread,
Jun 18, 2008, 3:24:32 PM6/18/08
to KML Developer Support - Getting Started with KML
Hi sabrick,

Did you check out barry's earlier post?

Also, your site is not available to me, it times out. for GGeoXml to
work, your KML needs to be on a web-accessible site. If I can't get to
it, Google can't either to process it.

Mano

sabrick

unread,
Jun 18, 2008, 4:45:44 PM6/18/08
to KML Developer Support - Getting Started with KML
sorry, long story, it works now, can you try it again?

ManoM

unread,
Jun 18, 2008, 5:39:53 PM6/18/08
to KML Developer Support - Getting Started with KML
Nope, still not working.

barryhunter [KML Guru]

unread,
Jun 18, 2008, 5:40:15 PM6/18/08
to KML Developer Support - Getting Started with KML
sebrick, you have got what appears to be Google Maps API code (the
GGeoXML class) in what is estentially Google Earth API code (the rest
of it).

You do have the Maps API loaded but you dont have a 'map' object,
instead you have a 'ge' object.


I suggest you look at the 'Create NetworkLink' sample on the Earth API
samples page:
http://www.google.com/earth/plugin/examples/samples/index.html

which will load a remote KML file into the Earth Plugin.

sabrick

unread,
Jun 19, 2008, 11:09:26 AM6/19/08
to KML Developer Support - Getting Started with KML
That did the trick!

Is there any way for me to have it zoom to a pre-define set of
coordinates upon starting up for the first time?

barryhunter [KML Guru]

unread,
Jun 19, 2008, 12:37:27 PM6/19/08
to KML Developer Support - Getting Started with KML
Have a look at the other samples, on that page, IIRC one (or more) of
the them does that.
Reply all
Reply to author
Forward
0 new messages