コード例 #1
0
  @Override
  protected void finalize() throws Throwable {
    // ok, ditch the layer
    if (_myLayer != null) _myLayer.dispose();

    // and let the parent do it's stuff
    super.finalize();
  }
コード例 #2
0
 /** forget about any existing map/layer */
 public void clearMap() {
   if (_myLayer != null) {
     // remove ourselves from the map
     if (_myMap != null) {
       _myMap.removeLayer(_myLayer);
     }
     _myLayer.dispose();
     _myLayer = null;
   }
   _myMap = null;
 }