gf.Map = function(settings) {
    //size of the map
    this.size = new gf.Vector(settings.width, settings.height);

    //orientation of the map
    this.orientation = settings.orientation; //only orthogonal supported

    //layers of the map
    this.layers = [];
};

gf.inherits(gf.Map, Object, {
    //virtual add layer
    addLayer: function(layer) {
        this.layers.push(layer);

        return this;
    },
    getLayer: function(id) {
        if(typeof id === 'number')
            return this.layers[id];

        if(typeof id === 'string') {
            var lyr = null;
            this.eachLayer(function(layer) {
                if(layer.name === id) {
                    lyr = layer;
                    return false;
                }
            });

            return lyr;
        }

        return this;
    },
    //add all layers to the scene
    addToScene: function(scene) {
        this.scene = scene;

        //incase they add layers first, then add the map to the scene
        this.eachLayer(function(layer) {
            if(!layer.scene || layer.scene !== scene)
                layer.addToScene(scene);
        });

        return this;
    },
    //apply an iterator to each layer
    eachLayer: function(fn) {
        for(var i = 0, il = this.layers.length; i < il; ++i) {
            if(fn.call(this, this.layers[i], i, this.layers) === false)
                break;
        }

        return this;
    }
});
@@ -1,12 +1,125 @@
+/**%0A * Base Map implementation, provides common functions for all Map types%0A *%0A * @module gf%0A * @class audio%0A */%0A
 gf.Map = fun
@@ -141,17 +141,30 @@
  %7B%0A    /
-/
+**%0A     * The 
 size of 
@@ -179,369 +179,840 @@
     
-this.size = new gf.Vector(settings.width, settings.height);%0A%0A    //orientation of the map%0A    this.orientation = settings.orientation; //only orthogonal supported%0A%0A    //layers of the map%0A    this.layers = %5B%5D;%0A%7D;%0A%0Agf.inherits(gf.Map, Object, %7B%0A    //virtual add layer%0A    addLayer: function(layer) %7B%0A        this.layers.push(layer);%0A%0A        return this;%0A    %7D,
+ *%0A     * @property size%0A     * @type Vector%0A     * @default new gf.Vector(0, 0)%0A     */%0A    this.size = new gf.Vector(settings.width, settings.height);%0A%0A    /**%0A     * The layers of the map%0A     *%0A     * @property layers%0A     * @type Vector%0A     * @private%0A     * @default %5B%5D%0A     */%0A    this.layers = %5B%5D;%0A%7D;%0A%0Agf.inherits(gf.Map, Object, %7B%0A    /**%0A     * Adds a layer to the map%0A     *%0A     * @method addLayer%0A     * @param layer %7BLayer%7D%0A     * @return %7BMap%7D Returns itself for chainability%0A     */%0A    addLayer: function(layer) %7B%0A        this.layers.push(layer);%0A%0A        return this;%0A    %7D,%0A    /**%0A     * Gets a layer based on the layer's id or name%0A     *%0A     * @method getLayer%0A     * @param id %7BNumber%7CString%7D The layer's number id or string name.%0A     * @return %7BLayer%7D Returns the found layer, or null if not found%0A     */
 %0A   
@@ -1106,17 +1106,52 @@
 yers%5Bid%5D
-;
+ %7C%7C null; //return null if not found
 %0A%0A      
@@ -1438,36 +1438,36 @@
 %0A        return 
-this
+null
 ;%0A    %7D,%0A    //a
@@ -1468,36 +1468,225 @@
    /
-/add all layers to the scene
+**%0A     * Adds the map and all layers to the scene%0A     *%0A     * @method addToScene%0A     * @param scene %7Bgf.game._stage%7D The game stage to add everything to%0A     * @return %7BMap%7D Returns itself for chainability%0A     */
 %0A   
@@ -2001,17 +2001,139 @@
    /
-/apply an
+**%0A     * Applies an iterator function to each of the layers.%0A     *%0A     * @method eachLayer%0A     * @param iterator %7BFunction%7D The
  ite
@@ -2137,24 +2137,33 @@
 iterator to 
+call for 
 each layer%0A 
@@ -2156,24 +2156,96 @@
 r each layer
+ in the Map%0A     * @return %7BMap%7D Returns itself for chainability%0A     */
 %0A    eachLay

Add docs to Map