Commit 25dc5ff9 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

select kml file in master_kml.xml

parent b5de0689
<?php
$path = $_GET['path']."/master_kml.xml";
if (is_file($path)){
//print("There's master kml");
$xml = simplexml_load_file($path);
print($xml->name);
}else{
// return empty, don't update
print(-1);
}
?>
...@@ -287,18 +287,30 @@ function light_init(){ ...@@ -287,18 +287,30 @@ function light_init(){
x3delement.append(model); x3delement.append(model);
// get master kml file if possible
$.ajax({ $.ajax({
url: SETTINGS.files.kml+"?"+Date.now(), url: "check_master_kml.php?path="+SETTINGS.basepath+"/"+SETTINGS.path,
success: function(response){ success: function(response){
parse_light_init_response(response,"init",mode); if (response!="-1"){
}, SETTINGS.files.kml = SETTINGS.basepath+"/"+response+"/"+response+".kml";
error: function(response){
console.log("Init: KML not found. Using defaults");
parse_light_init_response(response,"init",mode);
} }
// ready to read kml files
$.ajax({
url: SETTINGS.files.kml+"?"+Date.now(),
success: function(response){
parse_light_init_response(response,"init",mode);
},
error: function(response){
console.log("Init: KML not found. Using defaults");
parse_light_init_response(response,"init",mode);
}
});
}
}); });
} }
function parse_light_init_response(response,state,mode){ function parse_light_init_response(response,state,mode){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment