Commit dbfa2f03 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

kml save with error codes

parent 89aabfd0
......@@ -100,35 +100,35 @@ function parse_list(res){
//row.append("<td class='acell' valign='top'><div>"+vlist+"</div></td>");
row.attr("index",index);
row.attr("vlist",vlist);
register_row_events(row);
$("#model_table").append(row);
//place markers
var subindex = 0;
$(this).find("Camera").each(function(){
var lat = $(this).find("latitude").text();
var lng = $(this).find("longitude").text();
if (markers[lat+lng]==undefined){
var marker = L.marker([lat, lng]).addTo(map);
marker.bindPopup(name+": "+vlist,{
direction:"top",
});
marker.index = index;
markers[lat+lng] = marker;
}else{
console.log(markers[lat+lng]);
var content = markers[lat+lng]._popup.getContent();
markers[lat+lng]._popup.setContent(content+"<br/>"+name+": "+vlist);
marker.on('click',function(){
//console.log("clicked"+this.index);
$(".arow[index="+this.index+"]").click();
});
if (markers[index]==undefined) {
markers[index] = [];
}
markers[index][subindex] = marker;
subindex++;
});
......@@ -152,6 +152,8 @@ function register_row_events(elem){
});
var index = $(this).attr("index");
var vlist = $(this).attr("vlist");
var name = $(this).find("td").attr("title");
var list = $(List).find("model");
var item = list[index];
......@@ -160,8 +162,9 @@ function register_row_events(elem){
map.panTo(new L.LatLng(lat, lng));
if (markers[lat+lng]!=undefined){
markers[lat+lng].openPopup();
if (markers[index]!=undefined){
markers[index][0]._popup.setContent(name+": "+vlist);
markers[index][0].openPopup();
}
}
......
......@@ -226,7 +226,7 @@ function light_init(){
function reset_to_initial_position(){
$.ajax({
url: SETTINGS.basepath+"/"+SETTINGS.path+"/"+SETTINGS.path+".kml",
url: SETTINGS.files.kml+"?"+Date.now(),
success: function(response){
var longitude = parseFloat($(response).find("Camera").find("longitude").text());
......
......@@ -43,8 +43,13 @@ if (substr($target_filename,-4,4)!=".kml"){
if (!is_file($target_filename)){
die("-2");
}
if(!is_writable($target_filename)){
die("-3");
}
}
$target_xml = simplexml_load_file($target_filename);
$changes_xml = simplexml_load_file('php://input');
......@@ -92,6 +97,6 @@ foreach ($new_PhotoOverlay as $new_node) {
file_put_contents($target_filename, $target_xml->asXML());
echo "ok";
die("0");
?>
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