New demo: KML DOM Tree

47 views
Skip to first unread message

TPo

unread,
Nov 17, 2009, 2:43:40 AM11/17/09
to KML Developer Support - Google Earth Plug-in
Please Help:

apologize for not being a developer - I have been looking for a
solution to post my kml file structure for my projects in a webpage,
and came across the demo by Roman using dojo 1.2.3.


I've gotten as far as I can get without a little feedback. It seems
easy enough to hard code in the path to the files instead of using the
load button: I'm assuming I load my files as default, - haven't
gotten that far though.

would someone be kind enough to look at the site:

http://www.civitaz.com/earth/index.html

I thought I had everything working correctly, but I can't seem to get
it to fire like Roman's original api sample here:

http://earth-api-samples.googlecode.com/svn/trunk/demos/dom-tree/index.html

My goal is to just export my own kml structure from Google Earth and
import using this format so I can update occasionally, without having
to learn how to hard code everytime and this would be perfect (if I
could get it to work for me!).

would love to just drop a new .kmz file and my site would be updated!

sorry for the amature post - just trying to find a solution that works
for so I can export my kml/kmz files and import them complete with
tree structure into my web page!

already have my own api code etc... just can't figure out what I'm
doing wrong?

ChAoS

unread,
Nov 17, 2009, 8:06:45 AM11/17/09
to KML Developer Support - Google Earth Plug-in
Hi,
I've recently tried the same demo for a project of mine and
experienced the same error. The silly solution to make it work is to
load dojo 1.2.3 and not the latest version (at the moment 1.3.2);
locate the line
google.load('dojo', '1.3.2');
and change it back to
google.load('dojo', '1.2.3');

I've understood that dojo 1.3 library changed some basic mechanics
that seem to make the demo crash during KML parsing. I've tried to fix
the demo to work also with dojo 1.3 but I failed. I hope some better
web developer could help us with this task...

jmatthews

unread,
Nov 17, 2009, 11:42:43 PM11/17/09
to KML Developer Support - Google Earth Plug-in
Just a suggestion, but have you put alerts in strategic places to test
your values and see if they are what you think they should be?

One line I am looking at is:

var url = dijit.byId('kml-url').getValue();

Have you tested the value of url after setting it here?

Just put alerts everywhere until you isolate the problem.

fraser (Earth API Guru)

unread,
Nov 18, 2009, 8:04:39 AM11/18/09
to KML Developer Support - Google Earth Plug-in
Hi,

Just to note, using alerts to help debugging can be more trouble than
it is worth.
This is because alerts (and other blocking calls) can in themselves
effect the functionality of the script.
I would strongly suggest you use firebug or similar to trace the
values you require or alternatively write them out to a DOM element.

F.

TPo

unread,
Nov 18, 2009, 4:03:21 PM11/18/09
to KML Developer Support - Google Earth Plug-in
Will check out Firebug, thanks for the tip.
> > > web developer could help us with this task...- Hide quoted text -
>
> - Show quoted text -

TPo

unread,
Nov 20, 2009, 12:43:24 AM11/20/09
to KML Developer Support - Google Earth Plug-in
ChAoS,

good tip - picking up my errors, little slow on the basics but I went
through the exercise from the start again tonight again and was
successfull in recreating the example from Ramon

for anyone non-tecnical like me: another good tip
copy, paste etc... the javascript file carefully so that you don't
paste as one long string - that was my error and the breaks were not
copied so the javascript stopped at the first instance of a comment!!!

Now on to the task of figuring out how to change it so it
- loads a base map automatically on page load
- keeps the file download text box / button
- adds several "buttons" on top for different base layers for my data
set

any ideas or examples would again be REALLY appreciated since i'm new
to all this!

Thanks again.

On Nov 17, 6:06 am, ChAoS wrote:
> Hi,
>  I've recently tried the same demo for a project of mine and
> experienced the same error.  The silly solution to make it work is to
> load dojo 1.2.3 and not the latest version (at the moment 1.3.2);
> locate the line
> google.load('dojo', '1.3.2');
> and change it back to
> google.load('dojo', '1.2.3');
>
> I've understood that dojo 1.3 library changed some basic mechanics
> that seem to make the demo crash duringKMLparsing. I've tried to fix

TPo

unread,
Nov 20, 2009, 2:54:04 AM11/20/09
to KML Developer Support - Google Earth Plug-in
dojo.io.bind help?

I've been trying to convert the

<input id="kml-url" dojoType="dijit.form.TextBox" value="http://
s3.amazonaws.com/kml-kmz/Phoenix Hiking Routes.kmz"/>
<button id="load-button" dojoType="dijit.form.Button"
onclick="loadKml();">Load KML or KMZ</button>

into an onload event for the page (i think) so that I can load the map
and call the file automatically on page load and remove the button,
user click element so I just have a page that loads with the map and
tree - no user input required.

Does anyone know if its possible to bind the arguments in the input/
button function above into the page load function using dojo.io.bind
instead of the dijit.form.Button?

NEW PAGE URL (that works now!): http://www.civitaz.com/earth/earth_api__kml_dom_tree.htm

On Nov 17, 6:06 am, ChAoS wrote:
> Hi,
>  I've recently tried the same demo for a project of mine and
> experienced the same error.  The silly solution to make it work is to
> load dojo 1.2.3 and not the latest version (at the moment 1.3.2);
> locate the line
> google.load('dojo', '1.3.2');
> and change it back to
> google.load('dojo', '1.2.3');
>
> I've understood that dojo 1.3 library changed some basic mechanics
> that seem to make the demo crash duringKMLparsing. I've tried to fix
Reply all
Reply to author
Forward
0 new messages