Hide Timeline in Plugin

37 views
Skip to first unread message

boak

unread,
Jun 4, 2009, 3:01:32 PM6/4/09
to KML Developer Support - Google Earth Plug-in
I am creating a little KML gallery page, which includes some KML files
that have time-based features and some that don't.
Once I've loaded a KML file with time-based features into the plugin,
the timeline won't go away. As I click from one item to the next, the
timeline just stays around.
Is there a way to either unload a KML file using the API (in my
searches I'm fairly confident it's not) or to simply hide the timeline
when the next file is loaded?
Thanks!

fraser (Earth API Guru)

unread,
Jun 5, 2009, 7:29:13 AM6/5/09
to KML Developer Support - Google Earth Plug-in
Hi boak,

It's pretty hard to say without seeing your code.
Can I ask, have you tried the standard way? i.e.
-------------------------------------------
ge.getTourPlayer().setTour(null);
-------------------------------------------

F.

boak

unread,
Jun 5, 2009, 9:47:28 AM6/5/09
to KML Developer Support - Google Earth Plug-in
I don't have a problem with tours, those I can enter and exit freely.
This is a time-based KML, like the following:
http://earth-api-samples.googlecode.com/svn/trunk/examples/kml-parse-timespan.html

When I navigate away from a KML file with time-based features the
timeline doesn't disappear, so if multiple KML files are loaded it
causes an issue. I've noticed that the Google playground demos seem
to do it by just reloading the plugin each time a new demo is clicked
on. I'm not sure how to do this either, though :(
> > Thanks!- Hide quoted text -
>
> - Show quoted text -

Roman N

unread,
Jun 10, 2009, 7:36:15 PM6/10/09
to KML Developer Support - Google Earth Plug-in
A complete and utter hack for turning the time slider on and off:

var timeProxyPlacemark = ge.parseKml(
'<?xml version="1.0" encoding="UTF-8"?>' +
'<kml xmlns="http://www.opengis.net/kml/2.2">' +
' <Placemark>' +
' <TimeSpan>' +
' <begin>2007-01-14T21:05:02Z</begin>' +
' <end>2007-01-14T21:05:20Z</end>' +
' </TimeSpan>' +
' </Placemark>' +
'</kml>');

ge.getFeatures().appendChild(timeProxyPlacemark);

// hide the slider
timeProxyPlacemark.setVisibility(false);

// show the slider
timeProxyPlacemark.setVisibility(true);


This only works because the feature is the only time-aware object
'visible'. If other time-aware features are visible, the time slider
will remain shown when calling setVisibility(false).

Hope that superhack helps somewhat,
Roman

On Jun 5, 6:47 am, boak wrote:
> I don't have a problem with tours, those I can enter and exit freely.
> This is a time-based KML, like the following:http://earth-api-samples.googlecode.com/svn/trunk/examples/kml-parse-...
Reply all
Reply to author
Forward
0 new messages