[FIX] maps: When layer param was specified in the searchlayer the name was getting lost so layers weren't being created (re-declaring the var "layer" in the loop was causing it to be cleared, so using layerName now). Also an attempt at improving z-index control, still more to do on that...

git-svn-id: file:///var/local/code.tiki.org/tikisvn/branches/12.x@49851 b456876b-0849-0410-b77d-98878d47e9d5