Z axis in Isometric tilemap
===

I'm experimenting with Isometric Tile Map's in JavaScript and HTML5 Canvas.
I'm storing Tile Map data in JavaScript 2D Array.

    // 0 - Grass
    // 1 - Dirt
    // ...
    var mapData = [
        [0, 0, 0, 0, 0],
        [0, 0, 1, 0, 0,
        ...
    ]

and draw

    for(var i = 0; i < mapData.length; i++) {
        for(var j = 0; j < mapData[i].length; j++) {
            var p = iso2screen(i, j, 0); // X, Y, Z
            context.drawImage(tileArray[mapData[i][j]], p.x, p.y);
        }
    }

but this function mean's all tile Z axis is equal to zero.

    var p = iso2screen(i, j, 0);

Maybe anyone have idea and how to do something like mapData[0][0] Z axis equal to 3; mapData[5][5] Z axis equal to 5; ?

I'm have idea: Write function for Grass, Dirt and store this function to 2D Array and draw and later mapData[0][0].setZ(3); But it is good idea to write functions for each tiles?

Thanks and sorry for my bad English language.