Hello!
Recently I am trying to find a solution to limit the dragable map layer in my tour, I add a layer as map container, and in which there is a map image with the action draglayer(), everything goes well but the map can be dragged out of the screen. I am wondering if there is a method to limit the draggable map image in the map container all the time. Is there an example source code of limiting draglayer for me take study? Or someone could teach me how to make it happen? I will be very appreciated for your any response on my question. Thanks very much!!
By the way, the tour is at
http://www.cnvtgo.com/shangxi/tourmap.html
and the source xml is at
http://www.cnvtgo.com/shangxi/tour_map.xml
The following codes are for the action draylayer, I take them in the krpano examples

, I think it should be to add some lines in the following codes but I have no idea what to add

:
<action name="draglayer">
if(%1 != dragging,
copy(drag_currentx, x);
copy(drag_currenty, y);
copy(drag_stagex, mouse.stagex);
copy(drag_stagey, mouse.stagey);
set(drag_sx, +1);
set(drag_sy, +1);
if(align == righttop, set(drag_sx,-1); );
if(align == right, set(drag_sx,-1); );
if(align == rightbottom, set(drag_sx,-1); set(drag_sy,-1); );
if(align == bottom, set(drag_sy,-1); );
if(align == leftbottom, set(drag_sy,-1); );
draglayer(dragging);
,
if(pressed,
sub(dx, mouse.stagex, drag_stagex);
sub(dy, mouse.stagey, drag_stagey);
mul(dx, drag_sx);
mul(dy, drag_sy);
add(x, drag_currentx, dx);
add(y, drag_currenty, dy);
delayedcall(0, draglayer(dragging) );
);
);
</action>