[mapserver-users] Highlighting a polygon
Robert Sanson
SansonR at asurequality.com
Sun Sep 28 21:20:40 PDT 2008
Dear Subha
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 the second States layer by passing the name of the state to mapserver with variable substitution.
I do something similar with Roads. My second layer would be defined something like the following:
LAYER
NAME crs_roads
GROUP "CRS"
TYPE LINE
STATUS ON
DATA ../data/nztm/crs/roads_1207
FILTERITEM 'NAME'
FILTER '%road%'
In OpenLayers I would send the WMS request like:
selrd = new OpenLayers.Layer.WMS( "Selected Road",
"http://10.65.192.1/cgi-bin/gsswms.exe?road="+rdname ( 'http://10.65.192.1/cgi-bin/gsswms.exe?road="+rdname' )+"&",
{layers: ['crs_roads'], transparent: 'true', format: "image/png"},
{singleTile: true, isBaseLayer: false, maxResolution: 500000, visibility: true} );
map.addLayer(selrd);
where rdname is variable holding the road name (in your case State name) retrieved from the click event.
Kind regards,
Robert Sanson
>>> Subha Ramakrishnan <subha at gslab.com> 29/09/2008 5:14 p.m. >>>
Hi,
I am using openlayers and mapserver to overlay an image of the states of
india on google map.
Is there a way to color/highlight a state on clicking, using mapserver?
I am not using any mapscript. So are there any settings to be done in
map file which will enable this? And how do i send a request from
openlayers to get the image from mapserver?
Expecting a reply.
Thanks.
Subha
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------
This message has been scanned for malware by SurfControl plc. www.surfcontrol.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080929/2509c9eb/attachment.htm>
More information about the MapServer-users
mailing list