code: function(geometry) {
              if (geometry == null) {
                  return null;
              }
              if (this.internalProjection && this.externalProjection) {
                  geometry = geometry.clone();
                  geometry.transform(this.internalProjection, 
                                     this.externalProjection);
              }                       
              var geometryType = geometry.CLASS_NAME.split('.')[2];
              var data = this.extract[geometryType.toLowerCase()].apply(this, [geometry]);
              var json;
              if(geometryType == "Collection") {
                  json = {
                      "type": "GeometryCollection",
                      "geometries": data
                  };
              } else {
                  json = {
                      "type": geometryType,
                      "coordinates": data
                  };
              }
              
              return json;
          }
docs: Method: extract.geometry
  Return a GeoJSON object representing a single geometry.
  
  Parameters:
  geometry - {<OpenLayers.Geometry>}
  
  Returns:
  {Object} An object representing the geometry.