Kazu46Machi / earth-api-samples

Automatically exported from code.google.com/p/earth-api-samples
0 stars 0 forks source link

Tour-playback doesn't work with specific kml-files #207

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The tour playback is really cool!!!
2. But unfortunately not all "touring-enabled" kml-files are supported
3. Example: The tour-playback doesn't work with this kml from the official
"Touring in kml" documentation:
http://code.google.com/apis/kml/documentation/kmlfiles/complete_tour_example.kml

What is the expected output or behavior? What do you see instead?
Playback doesn't work with kmls containing placemarks/polygons (+ touring
option)
Javascript Error: "Error calling method on NPObject!"

Which plugin version are you using?
5.0.11655.6079

Which browsers and operating systems are affected?
Tested on Firefox 3/Windows XP

Please provide any additional information (code snippets/links) below.
http://earth-api-samples.googlecode.com/svn/trunk/examples/tour-player.html
(official example without placemarks = OK!)
http://www.glotter.com/test/testtour.html (example-kml
"http://code.google.com/apis/kml/documentation/kmlfiles/complete_tour_example.km
l"
with placemarks/polygons = NOK!)

Original issue reported on code.google.com by glotter....@gmail.com on 3 Apr 2009 at 6:00

GoogleCodeExporter commented 8 years ago
Hi,

GETourPlayer needs to take a KmlTour object... with most KML, the KmlTour is the
first or second child of the KmlDocument... in the basic sample, the KmlTour is 
the
actual document-level object in the KML file.

You can find the KmlTour in the document by walking the DOM:

http://code.google.com/p/earth-api-samples/source/browse/trunk/lib/kmldomwalk.js

and then passing the tour to setTour

Original comment by api.roman.public@gmail.com on 3 Apr 2009 at 5:57

GoogleCodeExporter commented 8 years ago
Thanks for the explanation/link.
If I understand right, I have to use two different KML-files (one for the
placemarks/polygons and the second for the touring option)!? Or is it possible 
to
integrate the touring option into an existing KML?

Original comment by glotter....@gmail.com on 5 Apr 2009 at 5:16

GoogleCodeExporter commented 8 years ago
You don't need to have two different files. Say you have the following 
structure:

<Document>
  <Placemark>...
  <gx:Tour>...
</Document>

All you'd need to do is add the Document to the DOM via appendChild, walk the 
DOM
looking for the <gx:Tour> and setTour(tour) on the tour you found during 
traversal.

Original comment by api.roman.public@gmail.com on 6 Apr 2009 at 5:18