How to get KML for current GE session

68 views
Skip to first unread message

zoka

unread,
Sep 9, 2008, 7:45:52 PM9/9/08
to KML Developer Support - Google Earth Browser Plugin
Hello,

how to get using GE plugin KML file and save it from a script to a
file localy.
What object what method to use please?

Thanks.
Zoran.

Roman N

unread,
Sep 11, 2008, 2:08:31 PM9/11/08
to KML Developer Support - Google Earth Browser Plugin
Hi Zoran,

All objects deriving from KmlObject (pretty much everything) have a
getKml() method that returns the KML string representing that object.
You can call this function and do whatever you need with it. Here's
the starting point for the KmlObject reference:

http://code.google.com/apis/earth/documentation/reference/interface_kml_object.html

To enumerate through the root-level KML features in your plugin
instance, use ge.getFeatures()

If you want users to be able to save the file locally, you'll probably
need some sort of server-side scripting. If you're comfortable with
server-side scripting and AJAX topics, I could give you some
suggestions on how to implement this.

- Roman

zoka

unread,
Sep 16, 2008, 10:42:07 AM9/16/08
to KML Developer Support - Google Earth Browser Plugin
Hello Roman,

I need the whole kml document that representing the whole setup on
globe (placemarks, paths, layers...) with all objects so. Is there any
way get root kml document so when I open KML file I will get the same
globe features?
Or only your suggestion to browse all objects and get partial kml
files.
In that case how to put them togheter in one master KML file?

Thank you for your time.

Zoran.


On Sep 11, 12:08 pm, Roman N wrote:
> Hi Zoran,
>
> All objects deriving from KmlObject (pretty much everything) have a
> getKml() method that returns the KML string representing that object.
> You can call this function and do whatever you need with it. Here's
> the starting point for the KmlObject reference:
>
> http://code.google.com/apis/earth/documentation/reference/interface_k...
>
> To enumerate through the root-level KML features in your plugin
> instance, use ge.getFeatures()
>
> If you want users to be able to save the file locally, you'll probably
> need some sort of server-side scripting. If you're comfortable with
> server-side scripting and AJAX topics, I could give you some
> suggestions on how to implement this.
>
> - Roman
>
> On Sep 9, 4:45 pm, zoka wrote:
>
>
>
> > Hello,
>
> > how to get using GE plugin KML file and save it from a script to a
> > file localy.
> > What object what method to use please?
>
> > Thanks.
> > Zoran.- Hide quoted text -
>
> - Show quoted text -

Roman N

unread,
Sep 17, 2008, 9:03:23 PM9/17/08
to KML Developer Support - Google Earth Browser Plugin
Hi zoka,

The only way to do that is to add one root element, say a KmlDocument
object, and subsequently add all other features (point placemarks,
paths, etc.) to that element. You could then do getKml() on the
KmlDocument to get the full KML string.

- Roman

zoka

unread,
Sep 18, 2008, 5:26:09 PM9/18/08
to KML Developer Support - Google Earth Browser Plugin
Thank you Roman.
Your help is appreciated.

Zoran.
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages