function __construct()
 {
     parent::__construct();
     $this->zIndex = 1000;
     $this->imageMapAreas = array();
     $this->descendents = array();
     $this->parent = null;
 }
 /**
  * So that memory is deallocated correctly, go through and remove all the
  * references to other objects. The PHP GC doesn't deal with circular
  * references, so this stops the memory usage from ballooning up.
  */
 function cleanUp()
 {
     parent::cleanUp();
     $all_layers = array_keys($this->seen_zlayers);
     foreach ($all_layers as $z) {
         $this->seen_zlayers[$z] = null;
     }
     foreach ($this->links as $link) {
         $link->cleanUp();
         unset($link);
     }
     foreach ($this->nodes as $node) {
         // destroy all the images we created, to prevent memory leaks
         $node->cleanUp();
         unset($node);
     }
     // Clear up the other random hashes of information
     $this->dsinfocache = null;
     $this->colourtable = null;
     $this->usage_stats = null;
     $this->scales = null;
 }