<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:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<base
href="https://nngowa.nngco.com/exchange/Shane.Buscher/Drafts/RE:%20%5bMapguide_users%5d%20FW:%20Remove%20layers%20at%20runtime.EML/1_text.htm">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>FW: Remove layers at runtime</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
font-face {
        FONT-FAMILY: Tahoma
}
font-face {
        FONT-FAMILY: StoneSans
}
font-face {
        FONT-FAMILY: Tahoma
}
font-face {
        FONT-FAMILY: StoneSans
}

 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:StoneSans;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.emailstyle18
        {font-family:Arial;
        color:navy;}
span.emailstyle19
        {font-family:Arial;
        color:navy;}
span.emailstyle20
        {font-family:Arial;
        color:navy;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:Arial;
        color:navy;}
span.EmailStyle26
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

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

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks so much for your help.&nbsp; I&#8217;ll
try the workaround you suggested.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Shane<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal style='margin-left:.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Walt Welton-Lair<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, January 18, 2007
10:54 AM<br>
<b><span style='font-weight:bold'>To:</span></b> mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>I've determined that
there are two problems preventing this from working correctly.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>1) There's a MapGuide
server bug in which the information needed to remove the layer from the DWF
Viewer is not encoded properly.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>2) There's a refresh bug
in DWF Viewer&nbsp;- when a layer is removed the graphics associated with that
layer are not getting removed.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>The first problem will
cause the layer/legend control to not update correctly.&nbsp; But if you're
hiding that control then it doesn't matter all that much.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>The second problem is
what's causing your refresh issues.&nbsp; There is a workaround for this: you
need to force a full refresh of the DWF Viewer.&nbsp; This tells the viewer to
throw&nbsp;away&nbsp;all graphical data and&nbsp;re-request it.&nbsp; You're
actually seeing this happen when you zoom out (after 4-5 zooms, as you
wrote).&nbsp; And note that despite the first bug you'll get back the correct
graphics because the layers have been removed on the server, just not in the
client.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>To force the full refresh
you'll need to modify your&nbsp;script code:</span></font><o:p></o:p></p>

<blockquote style='margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Dim javaScript As String
= &quot;parent.parent.mapFrame.emapViewer.Document.ForceRefresh = true;&nbsp;
parent.parent.mapFrame.Refresh();&quot;</span></font><o:p></o:p></p>

</blockquote>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>You might have to edit
this.&nbsp; Basically you need to get to the instance of the DWF Viewer control
(in MapGuide this is stored in&nbsp;the&nbsp;emapViewer variable - see
dwfmappane.templ), set its&nbsp;Document.ForceRefresh property to true, and
then call Refresh.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>I'll be submitting a fix
for the first bug shortly.&nbsp; The DWF Viewer bug will get addressed in a
future release of the viewer.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Of course your other
option is to use <st1:City w:st="on"><st1:place w:st="on">AJAX</st1:place></st1:City>
viewer...</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Hope this helps.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'>Walt</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, January 18, 2007
3:29 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Walt Welton-Lair; Trevor Wekel<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Walt,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>We&#8217;re using DWF
Viewer 6.5.&nbsp; Unfortunately I&#8217;m not adding the layers to the legend
at runtime, or even displaying the legend so I&#8217;m not sure if it updates
correctly.&nbsp; I&#8217;ll try to test this out though and get back to you.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>-shane<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

<p class=MsoNormal style='margin-left:1.0in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Walt
Welton-Lair [mailto:walt.welton-lair@autodesk.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, January 18, 2007
7:25 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane; Trevor Wekel<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>I've
made progress on this - I think it&nbsp;actually involves a couple of bugs.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Two&nbsp;questions:</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>1/ does
the DWF Viewer's layer/legend control correctly update when you remove the
layers?</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>2/ What
version of DWF Viewer are you using (6.5 or 7.0)?</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Walt</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:1.0in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 16, 2007
8:53 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Trevor Wekel; Walt Welton-Lair<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks
for looking into this!<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

<p class=MsoNormal style='margin-left:1.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Trevor
Wekel [mailto:trevor.wekel@autodesk.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 16, 2007
11:24 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane; Walt
Welton-Lair; mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:1.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Ok.&nbsp;
Looks like this is a bug in trunk and may be a bug in 1.0.2.&nbsp;&nbsp;We are
investigating and will keep you posted.&nbsp;&nbsp; </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks
Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Trevor</span></font>&nbsp;<o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:1.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 16, 2007
6:48 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Trevor Wekel; Walt
Welton-Lair; mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I&#8217;m
running 1.02.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>-shane<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:1.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:2.0in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Trevor
Wekel [mailto:trevor.wekel@autodesk.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
5:58 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane; Walt
Welton-Lair; mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Hi
Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Walt and
I are digging through some code.&nbsp; What version of MapGuide are you on?</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Trevor</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.0in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
2:51 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Walt Welton-Lair;
mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Walt,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>My code works
fine with the <st1:place w:st="on"><st1:City w:st="on">AJAX</st1:City></st1:place>
viewer, so the refresh problem is related exclusively to the DWF viewer.&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Here&#8217;s
the results I&#8217;m seeing in the DWF viewer after trying to remove layers at
runtime: <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><b><u><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy;
font-weight:bold'>Action&nbsp; </span></font></u></b><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><u><span
style='font-weight:bold'>Result</span></u></b><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Javascript
Refresh()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does
not remove layers<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Exec
built in Refresh command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does
not remove layers<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Pan
multiple times
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does
not remove layers<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Zoom In
multiple times&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does
not remove layers<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Zoom Out
multiple times
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Layers
are removed<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Remove
layers when not in their map extent&nbsp; &nbsp;Layers are removed<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Specifically,
when zooming out about 4-5 times the layers are consistently removed.&nbsp;
Hope this helps.&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>-shane<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.0in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:2.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Walt Welton-Lair<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
3:22 PM<br>
<b><span style='font-weight:bold'>To:</span></b> mapguide-users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>There's
a server-side bug in the current MapGuide code where the DWF Viewer isn't
properly refreshed after a pan.&nbsp; I don't know if that bug made it into an
actual released build though.&nbsp; If it did then that could be related to the
refresh problem you're seeing.&nbsp; Try interacting with your map by simply
panning a little and let us know&nbsp;if the view updates correctly.&nbsp; The
AJAX Viewer doesn't have this problem.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Walt</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
10:12 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Walt Welton-Lair;
Mapguide_users@lists.osgeo.org; Trevor Wekel<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Walt/Trevor,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I&#8217;m
definitely refreshing by calling the Refresh method in the viewer api.&nbsp; My
exact code is below.&nbsp; I know the refresh gets executed successfully
because I see a quick status bar in the top left corner of the viewer
flash.&nbsp; If I comment out the javascript call, no status bar flashes.&nbsp;
Furthermore, the built-in RefreshMap command that you can add as a button in
Studio doesn&#8217;t work either after running the code snippet
below.&nbsp;&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I also
know, according to the users guide p. 56, that you don&#8217;t have to refresh
the map from the client after adding layers because the LayerCollection takes
care of this for you.&nbsp; I&#8217;ve tested this when adding layers, and this
is true.&nbsp; I am somewhat assuming that removing a layer would be the
same.&nbsp; I wonder if there is a problem with the DWF viewer.&nbsp; I suppose
I can try the <st1:place w:st="on"><st1:City w:st="on">AJAX</st1:City></st1:place>
viewer&#8230;&nbsp; It might be really helpful if somebody could duplicate the
issue.&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Shane<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Protected</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font> Button2_Click(<font color=blue><span
style='color:blue'>ByVal</span></font> sender <font color=blue><span
style='color:blue'>As</span></font> <font color=blue><span style='color:blue'>Object</span></font>,
<font color=blue><span style='color:blue'>ByVal</span></font> e <font
color=blue><span style='color:blue'>As</span></font> System.EventArgs) <font
color=blue><span style='color:blue'>Handles</span></font> Button1.Click<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp; <font color=green><span style='color:green'>'Remove layers </span></font><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> lyr0 <font
color=blue><span style='color:blue'>As</span></font> MgLayer =
map.GetLayers.GetItem(0)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> lyr1 <font
color=blue><span style='color:blue'>As</span></font> MgLayer =
map.GetLayers.GetItem(1)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.GetLayers.Remove(lyr0)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.GetLayers.Remove(lyr1)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Save(resourceService)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=green><span style='color:green'>'emit javascript to refresh map<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> scriptKey <font
color=blue><span style='color:blue'>As</span></font> <font color=blue><span
style='color:blue'>String</span></font> = <font color=maroon><span
style='color:maroon'>&quot;Refresh&quot;<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>If</span></font> <font color=blue><span
style='color:blue'>Not</span></font>
Page.ClientScript.IsStartupScriptRegistered(<font color=blue><span
style='color:blue'>Me</span></font>.GetType, scriptKey) <font color=blue><span
style='color:blue'>Then<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> javaScript <font
color=blue><span style='color:blue'>As</span></font> <font color=blue><span
style='color:blue'>String</span></font> = <font color=maroon><span
style='color:maroon'>&quot;parent.parent.mapFrame.Refresh();&quot;<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Page.ClientScript.RegisterStartupScript(<font color=blue><span
style='color:blue'>Me</span></font>.GetType, scriptKey, javaScript, <font
color=blue><span style='color:blue'>True</span></font>)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>End</span></font> <font color=blue><span
style='color:blue'>If<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; <font
color=blue><span style='color:blue'>End</span></font> <font color=blue><span
style='color:blue'>Sub</span></font></span></font><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:3.0in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide-users-bounces@lists.osgeo.org
[mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Walt Welton-Lair<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
1:52 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:3.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal style='margin-left:3.0in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>Yeah a missing refresh would make sense.&nbsp; Isn't
it the client's responsibility though to request&nbsp;the refresh?<o:p></o:p></span></font></p>

</div>

<blockquote style='margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'>

<div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><font size=2 face="Times New Roman"><span
style='font-size:10.0pt'>-----Original Message----- <br>
<b><span style='font-weight:bold'>From:</span></b>
mapguide-users-bounces@lists.osgeo.org&nbsp;on behalf of&nbsp;Trevor Wekel <br>
<b><span style='font-weight:bold'>Sent:</span></b> Mon 1/15/2007 7:12 PM <br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane;
Mapguide_users@lists.osgeo.org <br>
<b><span style='font-weight:bold'>Cc:</span></b> <br>
<b><span style='font-weight:bold'>Subject:</span></b> [mapguide-users] RE:
[Mapguide_users] FW: Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Hi Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Hmm... I
wonder if the viewer is not bothering to request the map overlay image
again?&nbsp; That would explain the behaviour you are seeing.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Are you
using a Windows box as a client?&nbsp; Are you familiar with Fiddler?</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Fiddler
is an HTTP proxy that captures HTTP requests and responses.&nbsp; If you
install and use it, you should be able to see all the traffic between the
client and Web Extensions / MapAgent.&nbsp; There should be a
GETDYNAMICMAPOVERLAY request generated by the client.&nbsp; This request should
refresh the map and show the added/removed layers.</span></font><o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Also,
are you using Base Map layers (ie. tiled images)?&nbsp; Base Map layers should
not be changed on the fly.&nbsp; They should be considered static.&nbsp; This
is probably not an issue since you are adding dynamic layers but I just figured
I would check.</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks,</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Trevor</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
11:04 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Trevor Wekel;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Trevor,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I think
I found a big hint after testing what you suggested.&nbsp; When the layers
I&#8217;m trying to remove are within the map view extent, they do not
&#8216;disappear&#8217; upon removing them.&nbsp; However, If the layers are
completely outside the map view extent they indeed get removed with the same
code.&nbsp; It doesn&#8217;t matter if it&#8217;s one layer or multiples.&nbsp;
Hopefully this gives you something to work with.&nbsp; </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Regards,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Shane</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:2.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Trevor
Wekel [mailto:trevor.wekel@autodesk.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, January 15, 2007
11:18 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Hi
Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>My
bad.&nbsp; I've been working with the Mapguide 1.1.x and trunk branches.&nbsp;
You are working on the released 1.0.x branch.&nbsp; Sorry for the confusion.&nbsp;
1.0.x does not have the boolean return.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Is there
any difference if you try to remove only one layer so there are&nbsp;still
layers on the map?</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Trevor</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Saturday, January 13, 2007
1:31 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Trevor Wekel;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

<div id=idOWAReplyText61961>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Trevor,</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>MgLayerCollection.Remove doesn't
return a boolean according to the api documentation, and also doesn't indicate
it in the intellisense.&nbsp; </span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Regards,</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Shane</span></font><o:p></o:p></p>

</div>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Trevor
Wekel [mailto:trevor.wekel@autodesk.com]<br>
<b><span style='font-weight:bold'>Sent:</span></b> Fri 1/12/2007 5:18 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Hi
Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Remove()
should returns a boolean true or false.&nbsp; false indicates that the layer
was not removed.&nbsp; Can you see if the remove was successful? (just trying
to debug a bit)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks,<br>
Trevor</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, January 12, 2007
4:13 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Trevor Wekel;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Trevor,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks
for the response.&nbsp; I think I&#8217;m doing everything you suggested
correctly, but have provided the snippets below.&nbsp; When the page loads the
ConnectToMapGuide() method gets called, which opens up the MgMap and sets it to
a module level variable (map).&nbsp; Then, Button1 is clicked which
successfully adds two layers to the map.&nbsp; When Button2 gets invoked, I try
to remove the layers but the layers still persist in the map.&nbsp; </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I&#8217;m
not sure where to go from here.&nbsp; Do you need to copy the layers in
session, then add them from there in order to have the ability to remove
them?&nbsp; Just reaching&#8230;</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Regards,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Shane</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>&#8216;class vars</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Private</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> resourceService <font
color=blue><span style='color:blue'>As</span></font> MgResourceService</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Private</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> map <font color=blue><span
style='color:blue'>As</span></font> MgMap</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Private</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font> ConnectToMapGuide()</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=green><span style='color:green'>'Connect to MapGuide site</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> userInfo <font
color=blue><span style='color:blue'>As</span></font> <font color=blue><span
style='color:blue'>New</span></font> MgUserInformation(Session.Item(<font
color=maroon><span style='color:maroon'>&quot;mgSessionId&quot;</span></font>))</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> siteConn <font
color=blue><span style='color:blue'>As</span></font> <font color=blue><span
style='color:blue'>New</span></font> MgSiteConnection</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
siteConn.Open(userInfo)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=green><span style='color:green'>'set resource service</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
resourceService = siteConn.CreateService(MgServiceType.ResourceService)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=green><span style='color:green'>'Open map</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map = <font color=blue><span style='color:blue'>New</span></font> MgMap</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Open(resourceService, Session.Item(<font color=maroon><span
style='color:maroon'>&quot;mgMapName&quot;</span></font>))</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>End</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Protected</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font> Button1_Click(<font color=blue><span
style='color:blue'>ByVal</span></font> sender <font color=blue><span
style='color:blue'>As</span></font> <font color=blue><span style='color:blue'>Object</span></font>,
<font color=blue><span style='color:blue'>ByVal</span></font> e <font
color=blue><span style='color:blue'>As</span></font> System.EventArgs) <font
color=blue><span style='color:blue'>Handles</span></font> Button1.Click</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp; <font color=green><span style='color:green'>&#8216;add dwf layer</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in;text-indent:.5in'><font size=2
color=blue face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>&nbsp;&nbsp; Dim</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> schematicId <font
color=blue><span style='color:blue'>As</span></font> <font color=blue><span
style='color:blue'>New</span></font>MgResourceIdentifier _
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:3.0in;text-indent:.5in'><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>(<font
color=maroon><span style='color:maroon'>&quot;Library://VST/Layers/SouthOmahaTeamSchematic.LayerDefinition&quot;</span></font>)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> schematic <font
color=blue><span style='color:blue'>As</span></font> MgLayer =
CreateLayer(schematicId, <font color=blue><span style='color:blue'>False</span></font>)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; map.GetLayers.Insert(index, schematic)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; <font color=green><span style='color:green'>&#8216;add sdf layer</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:3.0in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>&nbsp;&nbsp; Dim</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> valveId <font color=blue><span
style='color:blue'>As</span></font> <font color=blue><span style='color:blue'>New</span></font>
MgResourceIdentifier _ </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:3.0in;text-indent:.5in'><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>(<font
color=maroon><span style='color:maroon'>&quot;Library://VST/Layers/SouthOmahaValves.LayerDefinition&quot;</span></font>)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> valves <font
color=blue><span style='color:blue'>As</span></font> MgLayer =
CreateLayer(valveId, <font color=blue><span style='color:blue'>True</span></font>)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; map.GetLayers.Insert(index, valves)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; map.Save(resourceService)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=green><span style='color:green'>'emit javascript to refresh map</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>End</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Protected</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font> Button2_Click(<font color=blue><span
style='color:blue'>ByVal</span></font> sender <font color=blue><span
style='color:blue'>As</span></font> <font color=blue><span style='color:blue'>Object</span></font>,
<font color=blue><span style='color:blue'>ByVal</span></font> e <font
color=blue><span style='color:blue'>As</span></font> System.EventArgs) <font
color=blue><span style='color:blue'>Handles</span></font> Button2.Click</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> lyr0 <font
color=blue><span style='color:blue'>As</span></font> MgLayer =
map.GetLayers.GetItem(0)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=blue><span style='color:blue'>Dim</span></font> lyr1 <font
color=blue><span style='color:blue'>As</span></font> MgLayer =
map.GetLayers.GetItem(1)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.GetLayers.Remove(lyr0)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.GetLayers.Remove(lyr1)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
map.Save(resourceService)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font color=green><span style='color:green'>'emit javascript to refresh map</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>End</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> <font color=blue><span
style='color:blue'>Sub</span></font></span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:2.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Trevor
Wekel [mailto:trevor.wekel@autodesk.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, January 12, 2007
3:37 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Hi
Shane,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>This
should work.&nbsp; During your setup, are you calling MgMap.Open() or
MgMap.Create()?&nbsp; The MgMap.Open() should set up the resource identifier
correctly so that Save() will have the map to the correct session repository.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Is the
session id being propagated correctly?&nbsp; If you can do the following and
the layer appears in the viewer then the session should be ok.</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>MgMap.Open()</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>MgMap.GetLayers().Insert(layer)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>MgMap.Save()</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>If the
Insert() works and Remove() doesn't</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>MgMap.Open()</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>MgMap.GetLayers().Remove(layer)</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>MgMap.Save()</span></font><o:p></o:p></p>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Then
this is probably a bug.&nbsp; Also, does the behaviour depend on the number
remaining layers?</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Thanks,</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=blue
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'>Trevor</span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

</div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:2.5in'><b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Buscher,
Shane [mailto:Shane.Buscher@nngco.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, January 12, 2007
7:16 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Buscher, Shane;
Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I
haven&#8217;t got any feedback yet, but I have been trying desperately to make
this work.&nbsp; To recap, I&#8217;m finding that adding a layer to a map at
runtime with MgLayerCollection.Add works fine.&nbsp; However, when I try to
remove layer(s) with MgLayerCollection.Clear, MgLayerCollection.Remove, or
MgLayerCollection.RemoveAt the layer(s) are indeed removed from the collection-
but <i><span style='font-style:italic'>not the map</span></i>.&nbsp; I am
saving the map and refreshing the map after removal.&nbsp; </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>So why
does inserting a layer into the MgMapCollection work, but removing not?&nbsp;
Looking at the developers guide on page 56 there is a note for getting a layer
collection from the map (MgMap.GetLayers): </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><i><font size=1 face=StoneSans><span
style='font-size:9.0pt;font-family:StoneSans;font-style:italic'>In the MapGuide
API, getting a collection returns a reference to the collection. So adding the
layer to the layer collection immediately updates the map.</span></font></i><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I am get
the impression that adding a layer to the collection automatically updates the
map, this doesn&#8217;t apply for removing a layer.&nbsp; I can&#8217;t figure
out what I need to do to mimic what the api does for you when inserting a layer
when trying to remove a layer.&nbsp; Or is this a bug?</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks
for any help in advance.&nbsp; </span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Regards,</span></font><o:p></o:p></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:2.5in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Shane</span></font><o:p></o:p></p>

<div>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div style='margin-left:.5in'>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal style='margin-left:2.5in'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
mapguide_users-bounces@lists.osgeo.org
[mailto:mapguide_users-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Buscher, Shane<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 09, 2007
4:49 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Mapguide_users@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [Mapguide_users] FW:
Remove layers at runtime</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-left:2.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>

<p style='margin-left:2.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>I&#8217;ve run into issues with removing all layers
from the map at runtime.&nbsp; See the code snippet below.&nbsp; All the layers
get removed from the layerCollection, but the layers still display.&nbsp;
I&#8217;ve successfully used the same code to insert layers, except I execute
the</span></font> <font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'>layerCollection.Insert(index, layer) method.&nbsp; I
don&#8217;t know why the same code wouldn&#8217;t work for clearing
layers.&nbsp; </span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>I have multiple layers
stored in a library repository that users need to add and remove at
runtime.&nbsp; Do I need to copy each layer in indvidual session repositories
to add and reomove them?&nbsp; If I don&#8217;t, will one user adding/removing
layers affect other user sessions?&nbsp; I know this is the case when you edit
data, but these layers are view only.&nbsp;&nbsp;</span></font> <o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>&#8216;</span></font><font size=2 color=green
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:green'>Connect to site server, set resource service, and open map</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>ConnectToMapGuide()&nbsp; </span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=green face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>'Clear all
layers in the map</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>Dim</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
layerCollection</span></font> <font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>As</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
MgLayerCollection = map.GetLayers()</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>If</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
layerCollection.GetCount &gt; 0</span></font> <font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>Then</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
layerCollection.Clear()</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>End</span></font>
<font size=2 color=blue face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>If</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>map.Save(resourceService)</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=green face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:green'>'emit javascript
to refresh map</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>Dim</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
scriptKey</span></font> <font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>As</span></font> <font
size=2 color=blue face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>String</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> =</span></font> <font
size=2 color=maroon face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:maroon'>&quot;ForceRefresh&quot;</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>If</span></font> <font
size=2 color=blue face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>Not</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>
Page.ClientScript.IsStartupScriptRegistered(<font color=blue><span
style='color:blue'>Me</span></font>.GetType, scriptKey)</span></font> <font
size=2 color=blue face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>Then</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;</span></font> <font
size=2 color=blue face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>Dim</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> javaScript</span></font> <font
size=2 color=blue face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New";color:blue'>As</span></font> <font size=2 color=blue
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:blue'>String</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'> =</span></font> <font
size=2 color=maroon face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:maroon'>&quot;refreshMap(&quot;</span></font><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>
&amp; MapAction.RefreshMap &amp;</span></font> <font size=2 color=maroon
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New";
color:maroon'>&quot;);&quot;</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
Page.ClientScript.RegisterStartupScript(<font color=blue><span
style='color:blue'>Me</span></font>.GetType, scriptKey, javaScript,</span></font>
<font size=2 color=blue face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>True</span></font><font size=2
face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>)</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=blue face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>End</span></font>
<font size=2 color=blue face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>If</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><a name=""><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Regards,</span></font></a><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 face=Arial><span style='font-size:
10.0pt;font-family:Arial'>Shane</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=gray face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:gray'>Operations IT</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=gray face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:gray'>Northern Natural Gas</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><font size=2 color=gray face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:gray'>402.398.7841</span></font><o:p></o:p></p>

<p style='margin-left:2.5in'><i><font size=2 color=gray face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:gray;font-style:italic'>We
think in generalities, but live in detail.&nbsp; </span></font></i><o:p></o:p></p>

<p style='margin-left:2.5in'><i><font size=2 color=gray face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:gray;font-style:italic'>-Alred
North Whitehead</span></font></i><o:p></o:p></p>

</div>

</blockquote>

</div>

</body>

</html>