KMLDomwalk, folders and placemarks ,

37 views
Skip to first unread message

phil....@sunandshadows.net

unread,
Dec 17, 2009, 2:03:28 PM12/17/09
to KML Developer Support - Google Earth Plug-in
I have used Roman's KMLDomWalk in a simple way to create an array of
placemarks after from using fetchKML for my KML file.

I now have a more complicated KML file with several nodes deep:

Kml
Document
Folder
Folder
Placemark
.........
Placemark
/Folder
Folder
Placemark
.........
Placemark
/Folder
/Folder
/ Document
/Kml

I need to create arrays in memory which mirror the KML file with the
intention of making a sidebar where the viewer can click on the
placemark text, to fly to the placemark's icon in the GE map.

I have looked for appropriate examples of how the KMLDocWalk would
work in this type of situation, without success.

Your help and advice, preferably with examples, would be much
appreciated.

Phil

phil....@sunandshadows.net

unread,
Dec 20, 2009, 7:14:26 AM12/20/09
to KML Developer Support - Google Earth Plug-in
Here is now a detailed KML snippet showing the problem I have:

<Folder id = 'Australia'>
<name>Australia</name>
<Placemark>
..........................
..........................
</Placemark>
</Folder>
<Folder id = 'Canada'>
<name>Canada</name>
<Placemark>
..........................
..........................
</Placemark>
<Placemark>
..........................
..........................
</Placemark>
</Folder>
<Folder id = 'England'>
<name>England</name>
<Placemark>
..........................
..........................
</Placemark>
<Placemark>
..........................
..........................
</Placemark>
<Placemark>
..........................
..........................
</Placemark>
<Placemark>
..........................
..........................
</Placemark>
<Placemark>
..........................
..........................
</Placemark>
<Placemark>
..........................
..........................
</Placemark>
</Folder>

The folders are for countries and the placemarks are places within the
countries.

I intend to make a sidebar like

Country( e.g. England)

Placemark ( e.g. cities)
Bristol
London
Winchester

How do you use KMLDocWalk to make arrays for two or more KML nodes?
For example
Folder (Country)
Placemark (Cities)

or

Folder ( Continent)
Folder (Country)
Placemark (Cities)

or even

Folder ( Continent)
Folder (Country)
Fulder (State)
Placemark (Cities)


Again, your help would be appreciated from an (almost) newbie.

Phil

phil....@sunandshadows.net

unread,
Dec 24, 2009, 6:37:17 AM12/24/09
to KML Developer Support - Google Earth Plug-in

What a dummy!

The answer is in Roman's KML DOM Tree demo
http://earth-api-samples.googlecode.com/svn/trunk/demos/dom-tree/index.html

phil....@sunandshadows.net

unread,
Dec 24, 2009, 12:34:44 PM12/24/09
to KML Developer Support - Google Earth Plug-in
Roman's choice of the KML Documentation as a sample KML, to show his
KML DOM Tree demo, threw me initially but then light dawned and WOW!
Great!

Here is my mashed-up webpage:

http://www.artisanindustrials.com/world-of-sundials/artisan-sundials-world-71.html

It incorporates 70% of original Roman's demo code, 10% of Roman's CSS,
amended to alter the appearance, 10% of Roman's Dojo/Dijit code to
alter the layout etc. and 10% of my own KML file. My KML file
contains four levels of folders and sub-folders which lends itself
well to Roman's Dojo/Dijit code.

For those amateur newbies, (like me), who were not aware of the use of
Dojo/Dijit, here are a couple of links:

http://dojotoolkit.org/projects/dijit
http://docs.dojocampus.org/welcome

Many thanks , Roman, and Season's Greetings to all,
Phil



On Dec 24, 11:37 am, "[email address]" wrote:
> What a dummy!
>
> The answer is in Roman's  KML DOM Tree demohttp://earth-api-samples.googlecode.com/svn/trunk/demos/dom-tree/inde...
Reply all
Reply to author
Forward
0 new messages