&nbsp;Hi Yatendra,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>layer.close(); , here layer is the base layer. The code that I have provided is used to colour features in the layer (You can change the entire layer color also). The layer has many features, which can be retrieved using<br>
shapeObj shape = layer.getFeature(shapeInd, -1);<br>&quot;shapeInd&quot; is the index of the shape.<br><br>This is the shape that i use to add into the temporary layer created<br>oTempLayer.addFeature(shape);<br>So, once I add the shape that I want to color to the temporary layer, I close the base layer using layer.close();<br>
<br>I hope this helps.<br><br>Regards,<br>Sucharita<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"></blockquote><br><br><br><div class="gmail_quote">
On Thu, May 8, 2008 at 11:09 AM,  &lt;<a href="mailto:yatendra.jaiswal@gmail.com">yatendra.jaiswal@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear Sucharita,<br>
I have one more question. U have used<br>
&quot;oTempLayer.addFeature(shape);&quot;<br>
<br>
How to get shape?<br>
<br>
Which layers shape are you talking about? Please clarify my doubt.<br>
I am newbie to <a href="http://asp.net" target="_blank">asp.net</a> mapserver.<br>
<div><div></div><div class="Wj3C7c">Thanks Regards<br>
Yatendra Jaiswal<br>
<br>
Sucharita Samuel wrote:<br>
&gt;<br>
&gt; &nbsp;Hi Yatendra,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; To change the colour of a layer, you can create a<br>
&gt; temporary layer, assign the attributes (like color,outline color etc) and<br>
&gt; then add the shape to your existing layer and redraw the map image..<br>
&gt; The following code might help,<br>
&gt;<br>
&gt; &nbsp;//*************Code for creating a temporary layer to be added onto the<br>
&gt; existing map******<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layerObj oTempLayer = new layerObj(map);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oTempLayer.type = MS_LAYER_TYPE.MS_LAYER_POLYGON;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oTempLayer.status = 1;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classObj oTempClass = new classObj(oTempLayer);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; labelObj oLabel = oTempClass.label;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oLabel.color.setRGB(0,0,0);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; styleObj oStyle = new styleObj(oTempClass);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oStyle.outlinecolor.setRGB(100, 12, 12);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oStyle.color.setRGB(221, 160, 221);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oTempLayer.addFeature(shape);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; layer.close();<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oImg = map.draw();<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int i= oTempLayer.draw(map, oImg);<br>
&gt;<br>
&gt; //*********************************************************************************<br>
&gt;<br>
&gt; Regards,<br>
&gt; Sucharita<br>
&gt;<br>
&gt;<br>
&gt; On Fri, May 2, 2008 at 12:18 PM, yatendra &lt;<a href="mailto:yatendra.jaiswal@gmail.com">yatendra.jaiswal@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi<br>
&gt;&gt; Thanks for reply<br>
&gt;&gt; i tried this code but there is null reference in<br>
&gt;&gt; &quot;$style-&gt;color-&gt;setRGB( 255, 0, 0 );<br>
&gt;&gt; $style-&gt;outlinecolor-&gt;setRGB( 255, 0, 0 );&quot;<br>
&gt;&gt; this step....<br>
&gt;&gt; Please giude me...<br>
&gt;&gt; color of &nbsp;a layer is not schanging<br>
&gt;&gt;<br>
&gt;&gt; Thanks Regards<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; yatendra wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi friends,<br>
&gt;&gt; &gt; I am using <a href="http://asp.net" target="_blank">asp.net</a> to develop application on mapserver.<br>
&gt;&gt; &gt; I want to change layer color available in my mapfile.<br>
&gt;&gt; &gt; Is it possible to change layer color without editing layer in mapfile?<br>
&gt;&gt; &gt; What function do i need to use to do this?<br>
&gt;&gt; &gt; Can i give unique value to each feature?<br>
&gt;&gt; &gt; Is it also possible?<br>
&gt;&gt; &gt; Please reply if any one know regarding this.<br>
&gt;&gt; &gt; any idea will also be helpful to me...<br>
&gt;&gt; &gt; Thanks regards<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://www.nabble.com/How-TO-change-color-of-a-layer-using-mapscript%28without-editing-mapfile%29-tp16983974p16997022.html" target="_blank">http://www.nabble.com/How-TO-change-color-of-a-layer-using-mapscript%28without-editing-mapfile%29-tp16983974p16997022.html</a><br>

&gt;&gt; Sent from the Mapserver - User mailing list archive at Nabble.com.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; mapserver-users mailing list<br>
&gt;&gt; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; mapserver-users mailing list<br>
&gt; <a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
&gt; <a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
&gt;<br>
&gt;<br>
Quoted from:<br>
<a href="http://www.nabble.com/How-TO-change-color-of-a-layer-using-mapscript%28without-editing-mapfile%29-tp16983974p17100215.html" target="_blank">http://www.nabble.com/How-TO-change-color-of-a-layer-using-mapscript%28without-editing-mapfile%29-tp16983974p17100215.html</a><br>

<br>
</div></div></blockquote></div><br>