<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Dear Subha</DIV>
<DIV>&nbsp;</DIV>
<DIV>I would set up two states layers in Mapserver. One is a generic one that responds to GetFeatureInfo requests from OpenLayers. The second one has a FILTER section. On the click handler in OpenLayers, once you click on a state and get it's name via a GetFeatureInfo request, then load&nbsp;the second States layer by passing the name of the state to mapserver with variable substitution.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I do something similar with Roads. My second layer would be defined something like the following:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;LAYER<BR>&nbsp; NAME crs_roads<BR>&nbsp; GROUP "CRS"<BR>&nbsp; TYPE LINE<BR>&nbsp; STATUS ON<BR>&nbsp; DATA ../data/nztm/crs/roads_1207<BR>&nbsp; FILTERITEM 'NAME'<BR>&nbsp; FILTER '%road%'<BR></DIV>
<DIV>In OpenLayers I would send the WMS request like:</DIV>
<DIV>&nbsp;</DIV>
<DIV>selrd = new OpenLayers.Layer.WMS( "Selected Road",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<A href='http://10.65.192.1/cgi-bin/gsswms.exe?road="+rdname'>http://10.65.192.1/cgi-bin/gsswms.exe?road="+rdname</A>+"&amp;",<BR>&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: ['crs_roads'], transparent: 'true', format: "image/png"},<BR>&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; {singleTile: true, isBaseLayer: false, maxResolution: 500000, visibility: true} );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(selrd);</DIV>
<DIV>&nbsp;</DIV>
<DIV>where rdname is variable holding the road name (in your case State name) retrieved from the click event.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Kind regards,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Robert Sanson<BR><BR>&gt;&gt;&gt; Subha Ramakrishnan &lt;subha@gslab.com&gt; 29/09/2008 5:14 p.m. &gt;&gt;&gt;<BR>Hi,<BR><BR>I am using openlayers and mapserver to overlay an image of the states of <BR>india on google map.<BR>Is there a way to color/highlight a state on clicking, using mapserver?<BR>I am not using any mapscript. So are there any settings to be done in <BR>map file which will enable this? And how do i send a request from <BR>openlayers to get the image from mapserver?<BR><BR>Expecting a reply.<BR><BR>Thanks.<BR>Subha<BR>_______________________________________________<BR>mapserver-users mailing list<BR>mapserver-users@lists.osgeo.org<BR><A href="http://lists.osgeo.org/mailman/listinfo/mapserver">http://lists.osgeo.org/mailman/listinfo/mapserver</A>-users<BR><BR></DIV><br><br><table bgcolor=white style="color:black"><tr><td><br>------------------------------------------------------------------<br>
The&nbsp;contents&nbsp;of&nbsp;this&nbsp;email&nbsp;are&nbsp;confidential&nbsp;to&nbsp;AsureQuality.&nbsp;If&nbsp;you&nbsp;have&nbsp;received&nbsp;this&nbsp;communication&nbsp;in&nbsp;error&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;immediately&nbsp;and&nbsp;delete&nbsp;the&nbsp;message&nbsp;and&nbsp;any&nbsp;attachments.&nbsp;The&nbsp;opinions&nbsp;expressed&nbsp;in&nbsp;this&nbsp;email&nbsp;are&nbsp;not&nbsp;necessarily&nbsp;those&nbsp;of&nbsp;AsureQuality.&nbsp;This&nbsp;message&nbsp;has&nbsp;been&nbsp;scanned&nbsp;for&nbsp;known&nbsp;viruses&nbsp;before&nbsp;delivery.&nbsp;AsureQuality&nbsp;supports&nbsp;the&nbsp;Unsolicited&nbsp;Electronic&nbsp;Messages&nbsp;Act&nbsp;2007.&nbsp;If&nbsp;you&nbsp;do&nbsp;not&nbsp;wish&nbsp;to&nbsp;receive&nbsp;similar&nbsp;communications&nbsp;in&nbsp;future,&nbsp;please&nbsp;notify&nbsp;the&nbsp;sender&nbsp;of&nbsp;this&nbsp;message.<br>
------------------------------------------------------------------</td></tr></table><br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This message has been scanned for malware by SurfControl plc.  </FONT><A href="http://www.surfcontrol.com/"><FONT style="BACKGROUND-COLOR: #ffffff" color=#000000>www.surfcontrol.com</FONT></A></P>
</body></HTML>