<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=IS>Hi all.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>I currently have function that I am using that
systematically goes through an array it&#8216;s passed and walks through the
layer legend to see if it finds a layer. So for every layername in a
layerarray, I check if that layer exists and then if the checkbox is checked I
show it, else I hide it. Now I&#8216;ve been debugging this and for an array of
3 layers (this also happens for layers more than 1), I get 3 times the debug
message &#8222;showing layer&#8220;, when I check the checkbox again I get the
debug message &#8222;hiding layer&#8220; 3 times as well.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>So I know this is working properly, however
Mapguide Server does not think so. Or at least the images I get back from the
server are missing one layer (the first one, every time). So according to the
legend all 3 layers are visible. However, the map shows everyone except the
first one. Now I figured this was weird, especially since when I try to hide
them, they all are hidden except the first one which is now visible. And now
for the final twist.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>If I do nothing else but reload the map (i.e.
pan the map, zoom or refresh it) the correct layers are displayed on the map
(all 3 or none at all).<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>So I figure this has something to do with
timing or something like that, of the fetching of the map itself?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>Please let me know if this is not clear to you
and I&#8216;ll try to explain better, but I find it weird I can not hide more
than 2 layers at a time.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=IS>Kind regards,<o:p></o:p></span></p>

<p class=MsoNormal><span lang=IS>Tómas<o:p></o:p></span></p>

</div>

</body>

</html>