<!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.6000.16525" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT size=2>what do you have at line 478 of your </FONT><FONT
size=3>ClientLayerReorder.php file?</FONT></DIV>
<DIV>I only see a comment at that line</DIV>
<DIV> </DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=simon.ortet@silogic.fr href="mailto:simon.ortet@silogic.fr">Simon
ORTET</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=cartoweb-users@lists.maptools.org
href="mailto:cartoweb-users@lists.maptools.org">cartoweb</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, October 08, 2007 10:15
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Cartoweb-users] Show layers in
a defined order</DIV>
<DIV><BR></DIV>Hi everyone.<BR><BR>I'm trying to do a 2 in 1 action with
Cartoweb: Show some layers in a special order. So it means i have to check
some layers in the layers tree and reorder them. Finally i make the ajax call
to make Cartoweb apply the changes.<BR><BR>The problem is Cartoweb seems not
to know the layers i just checked. Here's the error message.<BR><PRE>version: 3.3.0 [$Revision: 1.2 $]
class: CartocommonException
message: Error [8, Undefined index: 1, /opt/cartoweb/cartoweb3/projects/aeag/plugins/layerReorder/client/ClientLayerReorder.php, 478]
</PRE><BR>So here's the function i made to do this.<BR><BR>
<BLOCKQUOTE><I>function chargeVue() {
</I><BR><I> <FONT color=#009900>// Here i get the layers i
need to show in a field of my form</FONT></I><BR><I> for
(var i=0; i<$('selectVue').options.length; i++)
{</I><BR><I> if ($('selectVue').options[i].selected
) {</I><BR><I> selectione =
$('selectVue').options[i].value;</I><BR><I>
}</I><BR><I> }
</I><BR><I> </I><BR><I> <FONT
color=#009900>// Here i check the layers i got in the layer
tree</FONT></I><BR><I> var tabSel =
$('vue_'+selectione).value.split(";");</I><BR><I> var
tabOrdre = new Array();</I><BR><I> var celts =
$('layersroot').getElementsByTagName('input');</I><BR><BR><I>
for (var j = 0; j < celts.length; j++) {</I><BR><I>
if (!celts[j].checked &&
inArray(tabSel,celts[j].value)) {</I><BR><I>
celts[j].checked =
true;</I><BR><I><FONT color=#009900>
// Here i store the order of the layers in the layers
tree</FONT></I><BR><I>
tabOrdre.push(celts[j].value);</I><BR><I>
}else</I><BR><I>
celts[j].checked = false;</I><BR><I>
}</I><BR><I> </I><BR><I> <FONT
color=#009900>// Here i fill an array with the new layers
order</FONT></I><BR><I> var tabNewOrdre = new
Array();</I><BR><I> for (j = 0; j < tabSel.length; j++)
{</I><BR><I> // Ajoute l'indice de la
couche dans tabOrdre</I><BR><I>
tabNewOrdre.push(indexInArray(tabOrdre,tabSel[j]));</I><BR><I>
}</I><BR><I> $('layersReorder').value =
tabNewOrdre.join(",");</I><BR><I>
</I><BR><I> <FONT color=#009900>// Here i update the
map</FONT></I><BR><I>
CartoWeb.trigger('Layers.LayerShowHide');</I><BR><I>}</I><SPAN
class=sourceRowText></SPAN><BR><SPAN
class=sourceRowText></SPAN></BLOCKQUOTE><BR><BR><BR><B>Is there a way to
achieve this without making 2 ajax calls (one to check the layers, the other
to order them)?<BR><BR></B>Thanks for your help<BR><BR>Simon
Ortet<BR>Silogic<BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Cartoweb-users
mailing
list<BR>Cartoweb-users@lists.maptools.org<BR>http://lists.maptools.org/mailman/listinfo/cartoweb-users<BR></BLOCKQUOTE></BODY></HTML>