I have a script running that gets the cross-domain XML data and saves
it to a temporary file for processing by GDownloadURL.  It works
fairly well on the first time around but sometimes you have to click
the "Update Map" button a few times before it works right.  I think
the asynchronous nature of the scripting is trying to display data
before it is actually all downloaded by the proxy script.  When you
change the date and try to get a new XML file it will clear the map
but will often reload the old data.  Sometimes clicking the update map
button a few times will work.

My map is located at http://www.udfcd.org/FWP/LDAD/gmap.html.

To test my problem use the archived date sections at the bottom on the
page.  The default dates will give you some interesting data to look
at and then try changing the date and most of the time the data values
will clear and then reload the old data.  The text boxes show the
GXmlHttp ready state through the process.  I have a lot of scripting
in .js files so you will have to look at those to see what I am
doing.  How do I change my scripting to make sure the XML file is
updated before reloading the labels into mapiconmaker?

Here is the main part of the proxy script for reference:
//fetch XML feed from posted url
$ch = curl_init();
$timeout = 120;
$userAgent = $_SERVER['HTTP_USER_AGENT'];

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
//curl_setopt($ch, CURLOPT_FILE, $localfile);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    //echo curl_error($ch);
    $fl=fopen($logfile, "w");
        fwrite($fl, curl_error($ch)); //write contents of error to log file
        fclose($fl);
} else {
    curl_close($ch);
    echo $response;
    if (!file_exists($localfile)){
                touch($localfile); //create it
            chmod($localfile, 0666);
                $fp=fopen($localfile, "w");
                fwrite($fp, $response); //write contents of feed to cache file
                fclose($fp);
                // write to log
                $fl=fopen($logfile, "w");
                fwrite($fl, $url); //write url to log file
                fclose($fl);
                //sleep(10);
        } else {
                $fp=fopen($localfile, "w");
                fwrite($fp, $response); //write contents of feed to cache file
                fclose($fp);
                // write to log
                $fl=fopen($logfile, "w");
                fwrite($fl, $url); //write url to log file
                fclose($fl);
                //sleep(10);
        }
}

Thanks!
Chad

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to