Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Real-Time Tour Simulator
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Markw65  
View profile  
 More options Jan 5 2009, 2:46 pm
From: Markw65
Date: Mon, 5 Jan 2009 11:46:25 -0800 (PST)
Local: Mon, Jan 5 2009 2:46 pm
Subject: Re: Real-Time Tour Simulator

On Jan 4, 10:23 pm, Nymor wrote:

> Bugette 1: When you initialise and Alert comes up says the KML has
> loaded. I wish I didn't have to do that but if I don't it it tries to
> parse the KML before it's finished loading. Help to sort that would be
> appreciated.

Well, you're not using the callback (properly).

Your LoadKml completes immediately, and then drops through to the rest
of the code - which fails (absent the "alert") because the kml hasnt
loaded yet.

Some time later, your finishLoadKml function executes. But thats too
late.

The "correct" way to use the callback would be something like
(untested):

function finishLoadKml(kmlObject) {
   // check if the KML was fetched properly
   if (kmlObject) {
                currentKmlObject = kmlObject;
                if (chkbox_linestringVisibility.checked) ge.getFeatures().appendChild
(currentKmlObject);
                obj_linestring_placemark = currentKmlObject;
                var la = ge.createLookAt('');

/* this code moved here from InitializeTour */
        var init_options = [];
        init_options.kmlModelUrl = kmlModelUrlBox.value;
        init_options.speed = SpeedBox.value - 0;
        init_options.range = AltitudeBox.value - 0;
        init_options.range = RangeBox.value - 0;
        init_options.tilt = TiltBox.value - 0;
        init_options.rotation = RotationBox.value - 0;

        init_pathtour(obj_linestring_placemark, init_options);

        } else {
     alert('Bad KML');
   }
 }

function InitialiseTour() {
        if (t_simulator) {
                t_simulator.destroy();
                clear_features();
        }

        kmlPathUrl = kmlPathUrlBox.value;
        //kmlModelUrl = kmlModelUrlBox.value;

        LoadKml(kmlPathUrl);

       /* rest of the code moved into finishLoadKml, because it
          hasnt finished loading until that executes */

}


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.