question: public boolean addOverlay ( Overlay overlay , KmlDocument kmlDoc ) { if ( overlay == null ) return false ; KmlFeature kmlItem ; if ( overlay instanceof GroundOverlay ) { kmlItem = new KmlGroundOverlay ( ( GroundOverlay ) overlay ) ; } else if ( overlay instanceof FolderOverlay ) { kmlItem = new KmlFolder ( ( FolderOverlay ) overlay , kmlDoc ) ; } else if ( overlay instanceof MarkerClusterer ) { kmlItem = new KmlFolder ( ( MarkerClusterer ) overlay , kmlDoc ) ; } else if ( overlay instanceof Marker ) { Marker marker = ( Marker ) overlay ; kmlItem = new KmlPlacemark ( marker ) ; } else if ( overlay instanceof Polygon ) { Polygon polygon = ( Polygon ) overlay ; kmlItem = new KmlPlacemark ( polygon , kmlDoc ) ; } else if ( overlay instanceof Polyline ) { Polyline polyline = ( Polyline ) overlay ; kmlItem = new KmlPlacemark ( polyline , kmlDoc ) ; } else { return false ; } mItems . add ( kmlItem ) ; return true ; }
target:  Converts the overlay to a KmlFeature and add it inside this.  Conversion from Overlay subclasses to KML Features is as follow: <br> FolderOverlay, MarkerClusterer => Folder<br> Marker => Point<br> Polygon => Polygon<br> Polyline => LineString<br> GroundOverlay => GroundOverlay<br> Else, add nothing. 