<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear List!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have made a sortable Legend management based on
the LegendTemplate widget but using drag and drop to move the layers. It works
very well but since I do not need to refresh the layer list anymore (reload the
page). Is it possible to tell mapserver about the new order WITHOUT reloading
the whole page?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Right now, my JavaScript layer ordering code
returns a string with the order of the layers stored in a hidden form element
called 'setlayerorder'.</FONT></DIV>
<DIV><FONT face=Arial size=2>In the base phtml file of my solution, I simply
split this string to an array which I pass to the setlayersdrawingorder
function.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>$layerlist = split('~~', $_REQUEST['setlayerorder']
);<BR> $oApp->moMapSession->oMap->setlayersdrawingorder(
$layerlist );</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The amount of code in the solution starts to be
large why I want to minimize unnecessary reload of the page with
JSAPI.</FONT></DIV>
<DIV><FONT face=Arial size=2>The layer list does not need to be reloaded anymore
since I simply drag around the layers to wished position. Dropping the element
should trigger the mapserver legend ordering if the
element's position has changed.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I think this approach is far more intuitive (and
cool!) than having a radio button with option to promote or demote the layer. If
you add a layer it will automatically get on top of all the others. The user
might have to click several times on the demote button (with page reload in
between) to get the layer to wished position.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Any ideas how to avoid the page reloading but still
tell mapserver to regenerate the map with the new legend order?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Carlo</FONT></DIV></BODY></HTML>