<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mukesh<br>
<br>
As Bob pointed out you can "over-ride" the color in mapserver's
map configuration file with a CGI variable. You can also have the
STYLE object in the map configuration file reference a color value
stored as an attribute value in the DBF. See
<a class="moz-txt-link-freetext" href="http://mapserver.org/mapfile/style.html:">http://mapserver.org/mapfile/style.html:</a><br>
<br>
<p>COLOR [r] [g] [b] | [attribute]</p>
<blockquote>
<ul>
<li>
<p class="first">Color to use for drawing features.</p>
</li>
<li>
<p class="first">[<em>Attribute</em>] was introduced in
version 5.0, to specify the item name in the attribute table
to use for color values. The hard brackets [] are required.
For example, if your <a class="reference internal"><em>shapefile</em></a>‘s
DBF has a field named “MYCOLOR” that holds color values for
each record, your STYLE object for might contain:</p>
<div class="highlight-mapfile">
<div class="highlight">
<pre><span class="k">STYLE</span>
<span class="k">COLOR</span> <span class="p">[</span><span class="err">MY</span><span class="k">COLOR</span><span class="p">]</span>
<span class="k">OUTLINECOLOR</span> <span class="mi">150</span> <span class="mi">150</span> <span class="mi">150</span>
<span class="k">END</span>
</pre>
</div>
</div>
</li>
</ul>
</blockquote>
Or better yet store the geometry and attributes in a PostGIS
database to avoid any file/record locking problems if you want the
user to be able to persistently change the value.<br>
<br>
Best Regards,<br>
Brent Fraser<br>
<br>
On 11/4/2010 3:21 PM, Mukesh Subedee wrote:
<blockquote cite="mid:467891.39115.qm@web37403.mail.mud.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div style="font-family: times new roman,new york,times,serif;
font-size: 12pt;">
<p>Hi,</p>
<p> </p>
<p>I am new to map server. I have been playing with it and
finding it interesting. I have a shape file with database
containing different area (polygon) codes. Let's say I have
x.dbf file for a x.shp file and it contains a row with polygon
code (I don't worry about layers). </p>
<p> </p>
<p>I want to color one or more area as desired by the user. e.g.
If a user desires to color area number 12 that corresponds to
a region (polygon) in the map, the desired area should be
colored with specific color. </p>
<p> </p>
<p>Is it possible to do such thing with MapServer? Is it
possible to dynamically assign specific color to the polygon
area with it?</p>
<p> </p>
<p>Thanks a lot!</p>
<p>Mukesh</p>
</div>
<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
mapserver-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
</pre>
</blockquote>
</body>
</html>