Hi Yatendra,<br> To change the colour of a layer, you can create a temporary layer, assign the attributes (like color,outline color etc) and then add the shape to your existing layer and redraw the map image..<br>
The following code might help,<br><br> //*************Code for creating a temporary layer to be added onto the existing map******<br><br> layerObj oTempLayer = new layerObj(map);<br> oTempLayer.type = MS_LAYER_TYPE.MS_LAYER_POLYGON;<br>
oTempLayer.status = 1;<br> classObj oTempClass = new classObj(oTempLayer);<br> labelObj oLabel = oTempClass.label;<br> oLabel.color.setRGB(0,0,0);<br>
styleObj oStyle = new styleObj(oTempClass);<br> oStyle.outlinecolor.setRGB(100, 12, 12);<br> oStyle.color.setRGB(221, 160, 221);<br> oTempLayer.addFeature(shape);<br>
layer.close();<br> oImg = map.draw();<br> int i= oTempLayer.draw(map, oImg);<br> //*********************************************************************************<br>
<br>Regards,<br>Sucharita<br><br><br><div class="gmail_quote">On Fri, May 2, 2008 at 12:18 PM, yatendra <<a href="mailto:yatendra.jaiswal@gmail.com">yatendra.jaiswal@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi<br>
Thanks for reply<br>
i tried this code but there is null reference in<br>
<div class="Ih2E3d">"$style->color->setRGB( 255, 0, 0 );<br>
$style->outlinecolor->setRGB( 255, 0, 0 );"<br>
</div>this step....<br>
Please giude me...<br>
color of a layer is not schanging<br>
<br>
Thanks Regards<br>
<div class="Ih2E3d"><br>
<br>
yatendra wrote:<br>
><br>
> Hi friends,<br>
> I am using <a href="http://asp.net" target="_blank">asp.net</a> to develop application on mapserver.<br>
> I want to change layer color available in my mapfile.<br>
> Is it possible to change layer color without editing layer in mapfile?<br>
> What function do i need to use to do this?<br>
> Can i give unique value to each feature?<br>
> Is it also possible?<br>
> Please reply if any one know regarding this.<br>
> any idea will also be helpful to me...<br>
> Thanks regards<br>
><br>
<br>
--<br>
</div>View this message in context: <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>
<div><div></div><div class="Wj3C7c">Sent from the Mapserver - User mailing list archive at Nabble.com.<br>
<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><br>
</div></div></blockquote></div><br>