Disconnecting from Google Earth

Properly disconnecting the GE SDK from Google Earth is a critical requirement for maintaining a link between the host application and its KML objects in Google Earth. The GE_Disconnect() function, when called, will save all KML objects so that when the host application restarts and reconnects, these objects will be restored by the GE SDK.

if (GE_IsConnected())
  GE_Disconnect();

The GE SDK maintains all its KML objects in sequential collections, so the host application may obtain all restored objects by using the GetCount() and GetName() functions for the particular object. The following code below demonstrates how to obtain a list of recovered Placemark names after reconnecting.

int placemarkCount = GE_GetPlacemarkCount();
if (placemarkCount > 0)
{
  // recover all placemarks
  for (int i=0; i<placemarkCount; i++)
    myPlacemarkList.Add(GE_GetPlacemarkName(i));
}

<< Back to Code Samples


Generated on Wed Sep 16 23:50:34 2009 for Google Earth SDK by  doxygen 1.6.1