<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
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","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#4F81BD'>Dear Sir<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#4F81BD'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#4F81BD'> Can you please tell me how remove
specific layer or at least clear the layer form map. I can able to clear the
layer based on index.but if I click clear layer button again it is
clearing whatever the 0 position next layer.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#4F81BD'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#4F81BD'> For example my map contains
the layers called Continents and countries and states that is like <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#4F81BD'>0 ,1, 2 position. If I want to remove continents (0) that is in
0 position , if I use </span><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'>MapFunction.Map.removeLayer(0); , it is working fine. If I Click
the same button again countries will be the second position then the country
layer is removing .but I want to remove single layer.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:#4F81BD'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-indent:.5in;text-autospace:none'><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'> protected</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:blue'>void</span>
btnClearPointLayer_Click(<span style='color:blue'>object</span> sender, <span
style='color:teal'>EventArgs</span> e)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> {<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
<span style='color:blue'>if</span>(Page.IsPostBack)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
{<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
MapFunction.Map.removeLayer(0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>
}<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
}</span><span style='font-family:"Courier New"'><br>
<br>
</span><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>Is it Possible every time same layer removable(dynamically
the same layer will be adding).<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>I am waiting for your great response.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>Advanced Thanks<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>Regards<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>Venkat.<o:p></o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Tamas Szekeres
[mailto:szekerest@gmail.com] <br>
<b>Sent:</b> Tuesday, December 16, 2008 10:03 PM<br>
<b>To:</b> Venkat Rao Tammineni<br>
<b>Cc:</b> mapserver-users@lists.osgeo.org<br>
<b>Subject:</b> Re: [mapserver-users] Remove Layer based on layer Name C#<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Hi,<br>
<br>
How about doing this?<br>
<br>
<span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'>layer =
MapFunction.Map.getLayerByName("PointLayer");</span><br>
<br>
<span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'>MapFunction.Map.removeLayer(layer.index);</span><br>
<br>
<br>
Best regards,<br>
<br>
Tamas<br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>2008/12/16 Venkat Rao Tammineni <<a
href="mailto:vtammineni@roulacglobal.com">vtammineni@roulacglobal.com</a>><o:p></o:p></p>
<div>
<div>
<p><span style='color:#4F81BD'> Dear All,</span><o:p></o:p></p>
<p><span style='color:#4F81BD'> </span><o:p></o:p></p>
<p><span style='color:#4F81BD'>
I want remove layer based on Layer Name.Now I Can able to remove layer
based on index.Is it possible to do.</span><o:p></o:p></p>
<p><span style='color:#4F81BD'> </span><o:p></o:p></p>
<p style='margin-left:.5in;text-indent:.5in'><span style='font-size:10.0pt;
font-family:"Courier New";color:#4F81BD'>layer =
MapFunction.Map.getLayerByName("PointLayer");</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'> </span><o:p></o:p></p>
<p><span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'>
MapFunction.Map.removeLayer(0);</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'> </span><o:p></o:p></p>
<p><span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'>Thanks</span><o:p></o:p></p>
<p><span style='font-size:10.0pt;font-family:"Courier New";color:#4F81BD'>Venkat.</span><o:p></o:p></p>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users"
target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><o:p></o:p></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>