John Bailey of
It’s best to structure your file as a Document which contains a Folder (with all your Overlays, Placemarks, etc) and a tour (not in the Folder).And later:
Note that Placemarks, description balloons, Polygons, Polylines, Models, Overlays (but no exploring ability for PhotoOverlays), and even NetworkLinks can all accessed by the tour.Good advice there, highlights added by me. I'd already thought that the tour allowed the turning on or off of any element (overlay, placemark, polygon) to be recorded, however, tinkering with the code and the KML example of updates (which is how tour does it) just didn't work for me.
For those of you who want to record a tour but not mess with the KML that drives it:
If the file is loaded already and the features are currently a mixture of on and off, check the top level box (should be for a Document or Folder) and turn everything on. Then start the Tour as described above, and the visibility states set in the feature KML and AnimatedUpdates will take care of everything.I'm not sure John didn't mean 'and turn everything OFF.' as in, turn everything off and then the tour will record you turning them on.
The creator of the GE5 tour has also surfaced as Googler Dan Barcay:
However, don’t take my word for it. This blog post is by the Googler who put an incredible effort into make the tour function a reality.If its possible for one person to give tumultuous applause, Dan gets it from me.
3 comments:
Actually I really did me turn ON, however, for this to be a dead cert way of making sure a tour works I am assuming the KML has been suitably (manually) edited.
If you don't want to tinker with the underlying KML follow Rich's advice of turning everything off and then turning on whilst recording. However, to make this work correctly DO NOT place overlays (etc) in their own folder, place them and the tour in the same Document or Folder. And make sure the tour name has a checkmark by it before you start to play it.
The reason for this is that the "container" (folder or document) holding the overlays (etc) to be shown during the tour must be checked "on", even if all objects are "off" (unchecked). Checking the box by the tour name ensures the Document is "on".
During the Tour the problem of objects not turning on/off arises because they are not in the "correct" state at the start of tour (e.g. you've opened the file already and turned some features off/on randomly). Also, If the container is "off" (because all its contents are "off") nothing will appear when you play the Tour.
Obviously not all content will be needed right at the start of the tour so the first actions of the tour are to turn off stuff, using
gx:AnimatedUpdate to set their visibility to 0.
How to do this is laid out in the Google documentation:
http://code.google.com/apis/kml/documentation/touring.html#updates
Note:
* updates to the KML are reversed when the tour is exited, and
* updates to the KML are not included when the current state is saved.
Hmm. Well that seems to explain some of the odd behaviour I've been seeing. Seems pretty complex for the average user to deal with.
Thanks for adding that in.
Rich
It is confusing...although possibly not as confusing as my "fix".
I guess the lesson is to design you KML well :-)
Post a Comment