code: function(obj) {
          var context = {};
          if(obj.CLASS_NAME == "OpenLayers.Map") {
              context.bounds = obj.getExtent();
              context.maxExtent = obj.maxExtent;
              context.projection = obj.projection;
              context.size = obj.getSize();
              context.layers = obj.layers;
          }
          return context;
      }
docs: Method: toContext
  Create a context object free from layer given a map or a
  context object.
  
  Parameters:
  obj - {<OpenLayers.Map> | Object} The map or context.
  
  Returns:
  {Object} A context object.