Let's make a map of dungeon Long time ago, when I was spending more time playing RPG, one of the issues what some players had, was to track party movement and to draw proper map.
So I come with idea, to check how you guys come deal with this issue.

Task is to write a function, which takes as input parameter list of directions (passed as structure of your choice) ^v&lt;&gt;, display map of dungeon.
In example for input: &gt;&gt;&gt;vvv&lt;&lt;&lt;^^^ output will be:

+----+               +----+
|    |               |&gt;&gt;&gt;v|
| ++ |               |^++v|
| ++ |  because      |^++v|
|    |               |^&lt;&lt;&lt;|
+----+               +----+


Testcases

&gt;&gt;&gt;&gt;&gt;&gt;vvvvv&lt;&lt;&lt;&lt;^^^&gt;&gt;v



 +-------+
 |       |
 +-+---+ |
   |   | |
   | + | |
   | +-+ |
   |     |
   +-----+


^^^^^vvv&lt;&lt;&lt;^^vv&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;vv&gt;&gt;&lt;&lt;^^^^v&gt;&gt;&gt;&gt;v^&lt;^

          +-+ 
       +-+| | +-++-+
       | || | | ++ ++
       | ++ +-+     |
       |        +-+ |
       +--+ +-+ +-+-+
          | | |   |
          +-+ +---+


As it is golf code challenge, shortest code wins. 

Happy golfing.

EDIT
Sorry for late edit, I didn't have much time recently.

Map is generated based on movement.  It should contain only corridors which were visited during walk. Hence creating one big room won't be a valid answer.

There are three valid symbols in the map:


| vertical wall
| horizontal wall
+ intersection of vertical and horizontal wall.


Maximum length of the path is 255 character (but if you can, do not limit yourself).

More test cases:

 &gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;

 +--+
 |  |
 +--+

 &gt;^&lt;v

 +--+
 |  |
 |  |
 +--+


I hope now everything is clear.
Javascript (ES6), 261 254 243 bytes

s=&gt;{v=Array(w=32);p=526;b=n=&gt;v[n&gt;&gt;5]&amp;(1&lt;&lt;(n&amp;31));B=(n,i)=&gt;b(p+n)|b(p-n)?i:0;[...0+s].map(c=&gt;v[(p+=[0,1,-1,w,-w]['0&gt;&lt;v^'.indexOf(c)])&gt;&gt;5]|=1&lt;&lt;(p&amp;31));for(z='',p=0;p&lt;w*w;z+=' |-+'[b(p)?0:B(1,1)|B(w,2)||B(31,3)|B(33,3)],p++%w||(z+=`
`));return z}


JSFiddle