Commit 7ce22d6e authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

1. save kml records based on timestamp rather than unique icon name

parent 583463e8
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,9 @@ function generateKML(nodes){
        '     <tilt>'+nodes[i].tilt+'</tilt>',
        '     <tilt>'+nodes[i].tilt+'</tilt>',
        '     <roll>'+nodes[i].roll+'</roll>',
        '     <roll>'+nodes[i].roll+'</roll>',
        '   </Camera>',
        '   </Camera>',
        '   <TimeStamp>',
        '     <when>'+nodes[i].timestamp+'</when>',
        '   </TimeStamp>',
        '   <Icon>',
        '   <Icon>',
        '     <href>'+nodes[i].href+'</href>',
        '     <href>'+nodes[i].href+'</href>',
        '   </Icon>'].join('\n');
        '   </Icon>'].join('\n');
+2 −1
Original line number Original line Diff line number Diff line
@@ -311,7 +311,8 @@ function parse_light_init_response(response,state,mode){
      name        : $(response).find("name").text(),
      name        : $(response).find("name").text(),
      description : $(response).find("Camera").find("description").text(),
      description : $(response).find("Camera").find("description").text(),
      visibility  : $(response).find("visibility").text(),
      visibility  : $(response).find("visibility").text(),
      href        : $(response).find("Icon").find("href").text()
      href        : $(response).find("Icon").find("href").text(),
      timestamp   : $(response).find("TimeStamp").find("when").text(),
  };
  };


  if (state=="init"){
  if (state=="init"){
+3 −2
Original line number Original line Diff line number Diff line
@@ -58,9 +58,10 @@ $old_PhotoOverlay = $target_xml->Document->PhotoOverlay;


foreach ($new_PhotoOverlay as $new_node) {
foreach ($new_PhotoOverlay as $new_node) {
    foreach ($old_PhotoOverlay as $old_node) {
    foreach ($old_PhotoOverlay as $old_node) {
	$old_str = "{$old_node->Icon->href}";
	$old_str = "{$old_node->TimeStamp->when}";
	$new_str = "{$new_node->Icon->href}";
	$new_str = "{$new_node->TimeStamp->when}";
	//if ("{$new_node->Icon->href}"=="{$old_node->Icon->href}") {
	//if ("{$new_node->Icon->href}"=="{$old_node->Icon->href}") {
	//if ($new_str==$old_str) {
	if (strstr($new_str,$old_str)!=false) {
	if (strstr($new_str,$old_str)!=false) {
	    $old_node->name              = $new_node->name;
	    $old_node->name              = $new_node->name;
	    $old_node->description       = $new_node->description;
	    $old_node->description       = $new_node->description;