Is there a way to auto pan the map in the direction of mouse location if it hits the extents of the window when drawing line or polygon? It seems inefficient to have to pan by clicking the pan arrow if the polygon goes outside the map window. Hope this makes sense?
You shouldn't have to click the pan arrow, you should be able to drag the map the normal way even with the draw feature control active, as in this example. Just drag the map the way you usually would when the draw control is active and you'll see it won't draw any extra nodes. Other than this,I don't think there is a default OpenLayers way to do this, as it can't really know why your mouse has left the map viewport. Imagine if, whilst drawing your polygon, you received an email you wanted to read, you mouse would leave the viewport and OpenLayers would only be able to interpret this by panning the map. By the time you came back to your map it probably would've panned itself all the way to the Antarctic.
You can (apparently) do this for when you are modifying a feature, so that if you drag a node or the entire object to the edge of the window it will move. This option is available as a property of your modifyFeature object called 'documentDrag'. However, I have never got this to work myself (although I haven't really properly tried).
See the example below http://dev.openlayers.org/examples/draw-feature.html I hope you help.