Then trying to close a kml file that is not existing on the webserver
it crashes.
Is there anyway to check wether a KML file is a valid one? using
javascript or or V3 api or so?
****************************************************************************************************
var KmlLayer=new Array();
KmlLayer[1]= new google.maps.KmlLayer("http://chalmersmotorklubb.se/
google/KML/108030.KML");
KmlLayer[2]= new google.maps.KmlLayer("http://chalmersmotorklubb.se/
google/KML/1080301.KML");
function checbox(){
if (document.myForm.chkKML.checked == true) {
openKML();
}
else
if (KmlLayer.length!=0) {
clearArrays();
}
}
// HERE IT CRASHES AS THE URL "http://chalmersmotorklubb.se/google/KML/
1080301.KML" is not a file
function clearArrays() {
for (i = 1; i < KmlLayer.length; i++) {
if (KmlLayer[i]!= null) {
alert(KmlLayer[i]);
KmlLayer[i].setMap(null);
}
}
KmlLayer = [];
}
**********************************************************************************************
If checking the checkbox it adds the kml array
nr2 is a faulty url, no file like that exists.
There is no problem adding them to the map but when removing it
(uncheck) it crashes.
Live map:
http://www.chalmersmotorklubb.se/google/Example.htm
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.