Thank you for the code.
I went up with using :
layer.gameObject.name = tileMap.data.Layers[layerId].name;
if (layer.gameObject.name != "top objects")
layer.gameObject.transform.localPosition = new Vector3(0, 0, accumulatedLayerZ);
else
layer.gameObject.transform.localPosition = new Vector3(0, 12, accumulatedLayerZ);
Since I have 3 layers for the level, they would of all been offset by 12 pixels.
Would it be possible to acquire the X and Y local values of the layers position and use them in? I have seen in the code that there is a Z value ( tileMap.data.Layers[layerId].z ), X and Y would be mighty useful if ever someone has many layers. This way I would not have to hardcode any values in and the code would be kept to one line, clean and beautiful.
layer.gameObject.transform.localPosition = new Vector3(tileMap.data.Layers[layerId].x, tileMap.data.Layers[layerId].y, accumulatedLayerZ);
This way the layers would always stay put, where they are needed. I tried browsing in the code for a way to acquire the data, I guess for now it would have to be with prefabs or going the hardcoded way?