Skip to content

Basic lines of code for creating KMLs

OtavioJFOliveira edited this page Aug 26, 2020 · 1 revision

This is the basic function for creating KMLs for browsing on Liquid Galaxy.

This function has an extremely simple operation, just concatenates all the coordinates in a single String, which is sent to the Liquid Galaxy Master.

String MakeKML(String longitude, String latitude, String range)
{
  CoordOrbit[0] = longitude;  
  CoordOrbit[1] = latitude; 
  CoordOrbit[2]= range;
  String kml ="flytoview=<LookAt><longitude>";
  kml += longitude;
  kml += "</longitude><latitude>";
  kml +=latitude ;
  kml += "</latitude><range>";
  kml += range;
  kml += "</range></LookAt>";
  return kml;
}

The KML is a text file that must be written to /tmp/query.txt on the Liquid Galaxy master PC. Performing this command Liquid Galaxy will know where to go and will fly to that point, then this file is automatically deleted and the user can send a new KML with new coordinates or actions.

For more information on creating KMLs and their main features click here

void MakeOrbit()
{
  String kmlOrbit = "";
   for(int g =0; g<361; g ++)
    {
      kmlOrbit = "";
      kmlOrbit = "flytoview=<LookAt><longitude>";
      kmlOrbit += CoordOrbit[0];
      kmlOrbit += "</longitude><latitude>";
      kmlOrbit += CoordOrbit[1];
      kmlOrbit += "</latitude><heading>";
      kmlOrbit += String(g);
      kmlOrbit += "</heading><range>";
      kmlOrbit += CoordOrbit[2];
      kmlOrbit += "</range><tilt>40</tilt></LookAt>";
      return kmlOrbit;
   }
}

To perform an orbit in a specific location, just pass the coordinates and add the heading reference in the creation of the KML, thus changing the headin value and updating directly with the liquid galaxy, a complete orbit will be performed or it can be moved a few degrees in the camera angle, to the user’s taste.

Clone this wiki locally