docs: function(json, type, filter) {
          type = (type) ? type : "FeatureCollection";
          var results = null;
          var obj = null;
          if (typeof json == "string") {
              obj = OpenLayers.Format.JSON.prototype.read.apply(this,
                                                                [json, filter]);
          } else { 
              obj = json;
          }    
          if(!obj) {
              OpenLayers.Console.error("Bad JSON: " + json);
          } else if(typeof(obj.type) != "string") {
              OpenLayers.Console.error("Bad GeoJSON - no type: " + json);
          } else if(this.isValidType(obj, type)) {
              switch(type) {
                  case "Geometry":
                      try {
                          results = this.parseGeometry(obj);
                      } catch(err) {
                          OpenLayers.Console.error(err);
                      }
                      break;
                  case "Feature":
                      try {
                          results = this.parseFeature(obj);
                          results.type = "Feature";
                      } catch(err) {
                          OpenLayers.Console.error(err);
                      }
                      break;
                  case "FeatureCollection":
                      // for type FeatureCollection, we allow input to be any type
                      results = [];
                      switch(obj.type) {
                          case "Feature":
                              try {
                                  results.push(this.parseFeature(obj));
                              } catch(err) {
                                  results = null;
                                  OpenLayers.Console.error(err);
                              }
                              break;
                          case "FeatureCollection":
                              for(var i=0, len=obj.features.length; i<len; ++i) {
                                  try {
                                      results.push(this.parseFeature(obj.features[i]));
                                  } catch(err) {
                                      results = null;
                                      OpenLayers.Console.error(err);
                                  }
                              }
                              break;
                          default:
                              try {
                                  var geom = this.parseGeometry(obj);
                                  results.push(new OpenLayers.Feature.Vector(geom));
                              } catch(err) {
                                  results = null;
                                  OpenLayers.Console.error(err);
                              }
                      }
                  break;
              }
          }
          return results;
      }