<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><span style="font-size: 10pt;" dir="ltr">Hi All,<br>
<br>
<div>I am working with openlayers, mapserver and post gis. I am facing problem with spatial filter DWITHIN and not able to discover if it is problem with mapserver or not.<br>
<br>
Details::::<br>
<br>
Now, <br>
I have google map as a base map and overlayed few point layers. Now, i want to do filtering with respect to the path that's drew on the map. For this path , i am using&nbsp; draw feature with OpenLayers.Handler.Path. Upto here it is working fine. I can draw a line.
 Now using the line geometry ,&nbsp; i am giving a spatial filter DWITHIN with a distance of&nbsp; 2000 and also mentioned distanceUnits as&nbsp; 'm'. After i draw a line , the spatial filter for DWITHIN gets activated and the layer to be filtered is completely disappearing.
 Now what i found is, it is throwing a WFS <font color="red">exception </font>as below -<br>
<br>
<font color="red">msWFSGetFeature(): WFS server error. Invalid or Unsupported FILTER in GetFeature :</font><br>
<font color="red">(&amp;lt;ogc:Filter xmlns:ogc=&amp;quot;http://www.opengis.net/ogc&amp;quot;&amp;gt;&amp;lt;ogc:And&amp;gt;&amp;lt;ogc:DWithin&amp;gt;&amp;lt;ogc:PropertyName&amp;gt;the_geom&amp;lt;/ogc:PropertyName&amp;gt;&amp;lt;gml:MultiLineString xmlns:gml=&amp;quot;http://www.opengis.net/gml&amp;quot; srsName=&amp;quot;EPSG:900913&amp;quot;&amp;gt;&amp;lt;gml:lineStringMember&amp;gt;&amp;lt;gml:LineString&amp;gt;&amp;lt;gml:coordinates
 decimal=&amp;quot;.&amp;quot; cs=&amp;quot;,&amp;quot; ts=&amp;quot; &amp;quot;&amp;gt;-79.205932617188,32.309033345029 -79.458618164063,32.267239420261 -79.851379394531,32.144067753448 -78.255615234375,33.130344611623&amp;lt;/gml:coordinates&amp;gt;&amp;lt;/gml:LineString&amp;gt;&amp;lt;/gml:lineStringMember&amp;gt;&amp;lt;/gml:MultiLineString&amp;gt;&amp;lt;ogc:Distance
 units=&amp;quot;m&amp;quot;&amp;gt;200000&amp;lt;/ogc:Distance&amp;gt;&amp;lt;/ogc:DWithin&amp;gt;&amp;lt;ogc:BBOX&amp;gt;&amp;lt;ogc:PropertyName&amp;gt;the_geom&amp;lt;/ogc:PropertyName&amp;gt;&amp;lt;gml:Box xmlns:gml=&amp;quot;http://www.opengis.net/gml&amp;quot; srsName=&amp;quot;EPSG:4326&amp;quot;&amp;gt;&amp;lt;gml:coordinates
 decimal=&amp;quot;.&amp;quot; cs=&amp;quot;,&amp;quot; ts=&amp;quot; &amp;quot;&amp;gt;-84.100341796875,29.910254</font><br>
<font color="red">&nbsp;</font><br>
<font color="red">&nbsp;244941 -73.114013671875,34.556260876457&amp;lt;/gml:coordinates&amp;gt;&amp;lt;/gml:Box&amp;gt;&amp;lt;/ogc:BBOX&amp;gt;&amp;lt;/ogc:And&amp;gt;&amp;lt;/ogc:Filter&amp;gt;</font><br>
<br>
And then I checked with get Capabilities , It is spatial filter DWITHIN capable. After that I checked by copying my
<font color="blue">WFS layer url</font> along with filter properties as below -<br>
<br>
<font color="blue">http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/openlayers-2.10/examples/us1gc09m-addline.map&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=us1gc09m&amp;Filter=%3CFilter%3E%3CDWithin%3E%3CPropertyName%3Ethe_geom%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E-80.22217%2031.07991%3C/gml:coordinates%3E%3C/gml:Point%3E%3CDistance%20units=%27m%27%3E100%3C/Distance%3E%3C/DWithin%3E%3C/Filter%3E</font><br>
&nbsp;<br>
into a browser. With this, It works well. No exception is thrown and the query is done properly. So, now, i do not understand where is the problem lies.
<br>
<br>
Can any one tell me how to solve this. How to do Spatial filter DWITHIN.&nbsp; And is my approach right?<br>
Below is my<font color="maroon"> JS code</font> ---<br>
<br>
<font color="maroon">var map;</font><font color="maroon"><br>
var spatialfilter;</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; function init() {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;map = new OpenLayers.Map(&quot;map&quot;);</font><font color="maroon"><br>
</font><font color="maroon"><br>
//GOOGLE MAP</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var base = new OpenLayers.Layer.Google(&quot;Google Hybrid&quot;, {'type': G_HYBRID_MAP});&nbsp;&nbsp;&nbsp;
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; map.addLayer(base);&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
//CREATE WMS LAYER</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var wms = new OpenLayers.Layer.WMS(&quot;wms&quot;, &quot;http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/openlayers-2.10/examples/xyz.map&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {layers: 'xyz'}, {isBaseLayer: false, visibility: false, opacity: 0.5, singleTile: true});&nbsp;
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; map.addLayer(wms);</font><font color="maroon"><br>
</font><font color="maroon"><br>
//VECTOR LAYER FOR PANEL</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var vlayer = new OpenLayers.Layer.Vector(&quot;vlayer&quot;);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.addLayer(vlayer);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
</font><font color="maroon"><br>
// CREATE WFSLAYERS</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
//style map for points</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var styleMap = new OpenLayers.StyleMap(OpenLayers.Util.applyDefaults({fillColor: &quot;CYAN&quot;, fillOpacity: 1, strokeColor: &quot;black&quot;},</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenLayers.Feature.Vector.style[&quot;default&quot;]));</font><font color="maroon"><br>
</font><font color="maroon"><br>
// mock up a protocol for synchronous and successful commits</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var wfs_protocol = new OpenLayers.Protocol.WFS({url:&quot;http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/apps/openlayers-2.10/examples/xyz.map&amp;SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=GetFeature&amp;TYPENAME=xyz&quot;,
</font><font color="maroon"><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;&nbsp; featureType: &quot;xyz&quot;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="maroon"><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;&nbsp; srsName: &quot;EPSG:900913&quot;});&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var wfslayer = new OpenLayers.Layer.Vector(&quot;WFS&quot;, {styleMap: styleMap,</font><font color="maroon"><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;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strategies: [new OpenLayers.Strategy.BBOX()],</font><font color="maroon"><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;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protocol: wfs_protocol</font><font color="maroon"><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;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.addLayer(wfslayer);</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.addControl(new OpenLayers.Control.MousePosition());</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.addControl(new OpenLayers.Control.LayerSwitcher()); </font><font color="maroon"><br>
&nbsp;//MAP CONTROLS</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var defStyle = {strokeColor: &quot;red&quot;, strokeOpacity: &quot;0.7&quot;, strokeWidth: 1, fillColor: &quot;red&quot;, pointRadius: 3, cursor: &quot;pointer&quot;};</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var sty = OpenLayers.Util.applyDefaults(defStyle, OpenLayers.Feature.Vector.style[&quot;default&quot;]);</font><font color="maroon"><br>
</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var DeleteFeature = OpenLayers.Class(OpenLayers.Control, {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; initialize: function(layer, options) {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenLayers.Control.prototype.initialize.apply(this, [options]);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.layer = layer;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.handler = new OpenLayers.Handler.Feature(</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this, layer, {click: this.clickFeature}</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; },</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; clickFeature: function(feature) {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if feature doesn't have a fid, destroy it</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(feature.fid == undefined) {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.layer.destroyFeatures([feature]);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; feature.state = OpenLayers.State.DELETE;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.layer.events.triggerEvent(&quot;afterfeaturemodified&quot;, {feature: feature});</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; feature.renderIntent = &quot;select&quot;;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.layer.drawFeature(feature);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; },</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; setMap: function(map) {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.handler.setMap(map);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenLayers.Control.prototype.setMap.apply(this, arguments);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; },</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; CLASS_NAME: &quot;OpenLayers.Control.DeleteFeature&quot;</font><font color="maroon"><br>
});</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; var panel = new OpenLayers.Control.Panel(</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {'displayClass': 'customEditingToolbar'}</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; );</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var navigate = new OpenLayers.Control.Navigation({</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title: &quot;Pan Map&quot;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var drawpath = new OpenLayers.Control.DrawFeature(</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vlayer, OpenLayers.Handler.Path,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title: &quot;Draw Path&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; displayClass: &quot;olControlDrawFeaturePath&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; multi: true</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var drawpoint = new OpenLayers.Control.DrawFeature(</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vlayer, OpenLayers.Handler.Point,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title: &quot;Add Point&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; displayClass: &quot;olControlDrawFeaturePoint&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; multi: true</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var box = new OpenLayers.Control.DrawFeature(vlayer,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenLayers.Handler.RegularPolygon, {</font><font color="maroon"><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;&nbsp;&nbsp; handlerOptions: {</font><font color="maroon"><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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sides: 4,</font><font color="maroon"><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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; irregular: true</font><font color="maroon"><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;&nbsp;&nbsp; } , </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; title: &quot;Box Feature Select&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; displayClass: &quot;olControlDrawFeatureBox&quot;});</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var edit = new OpenLayers.Control.ModifyFeature(vlayer, {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title: &quot;Modify Feature&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; displayClass: &quot;olControlModifyFeature&quot;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; });</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var del = new DeleteFeature(vlayer, {title: &quot;Delete Feature&quot;});</font><font color="maroon"><br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; panel.addControls([navigate,del, edit, box, drawpoint, drawpath]);&nbsp;&nbsp;&nbsp; </font>
<font color="maroon"><br>
&nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; panel.defaultControl = navigate;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.addControl(panel);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; panel.activate();</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.zoomToMaxExtent();</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; map.setCenter(new OpenLayers.LonLat(-82, 28),5);</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; vlayer.events.on({</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; beforefeatureadded: function(event) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //here also tried with featureadded</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var geometry = event.feature.geometry;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert(geometry);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wfslayer.filter = new OpenLayers.Filter.Spatial({</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type: OpenLayers.Filter.Spatial.DWITHIN,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; property: &quot;the_geom&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value: event.feature.geometry, </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; distance: 200000,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; distanceUnits: 'm'</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; wfslayer.refresh({force: true});</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var style_green =</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp; {</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strokeColor: &quot;#00FF00&quot;,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strokeOpacity: 0.7,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strokeWidth: 4,</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;graphicName: 'square',</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fillColor: '#FF0000',</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;pointRadius: 5</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp; };</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vlayer.drawFeature(event.feature, style_green);</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; alert(wfslayer.filter.evaluate(event.feature));</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; }</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; });</font><font color="maroon"><br>
</font><font color="maroon"><br>
&nbsp;&nbsp;&nbsp; }</font><br>
<br>
<br>
MAPFILE ----<br>
<br>
<div style="margin-left: 80px;">MAP<br>
&nbsp; NAME &quot;QGIS-MAP&quot;<br>
&nbsp; # Map image size<br>
&nbsp; SIZE 600 600<br>
&nbsp; UNITS meters<br>
<br>
&nbsp; EXTENT -101.455432 18.242354 -73.740758 33.963395<br>
&nbsp; FONTSET './etc/fonts.txt'<br>
&nbsp; SYMBOLSET './etc/symbols.txt'<br>
&nbsp; PROJECTION<br>
&nbsp;&nbsp;&nbsp; 'proj=longlat'<br>
&nbsp;&nbsp;&nbsp; 'ellps=WGS84'<br>
&nbsp;&nbsp;&nbsp; 'towgs84=0,0,0,0,0,0,0'<br>
&nbsp;&nbsp;&nbsp; 'no_defs'<br>
&nbsp; END<br>
<br>
&nbsp; # Background color for the map canvas -- change as desired<br>
&nbsp; IMAGECOLOR 255 255 255<br>
&nbsp; IMAGEQUALITY 95<br>
&nbsp; IMAGETYPE agg<br>
<br>
&nbsp; OUTPUTFORMAT<br>
&nbsp;&nbsp;&nbsp; NAME agg<br>
&nbsp;&nbsp;&nbsp; DRIVER AGG/PNG<br>
&nbsp;&nbsp;&nbsp; IMAGEMODE RGB<br>
&nbsp; END<br>
&nbsp; # Legend<br>
&nbsp; LEGEND<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IMAGECOLOR 255 255 255<br>
&nbsp;&nbsp;&nbsp; STATUS ON<br>
&nbsp;&nbsp;&nbsp; KEYSIZE 18 12<br>
&nbsp;&nbsp;&nbsp; LABEL<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE BITMAP<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE MEDIUM<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 0 0 89<br>
&nbsp;&nbsp;&nbsp; END<br>
&nbsp; END<br>
<br>
&nbsp; # Web interface definition. Only the template parameter<br>
&nbsp; # is required to display a map. See MapServer documentation<br>
&nbsp; WEB<br>
&nbsp;&nbsp;&nbsp; # Set IMAGEPATH to the path where MapServer should<br>
&nbsp;&nbsp;&nbsp; # write its output.<br>
&nbsp;&nbsp;&nbsp; IMAGEPATH '/ms4w/tmp/ms_tmp/'<br>
<br>
&nbsp;&nbsp;&nbsp; # Set IMAGEURL to the url that points to IMAGEPATH<br>
&nbsp;&nbsp;&nbsp; # as defined in your web server configuration<br>
&nbsp;&nbsp;&nbsp; IMAGEURL '/ms_tmp/'<br>
<br>
&nbsp;&nbsp;&nbsp; # WMS server settings<br>
&nbsp;&nbsp;&nbsp; METADATA<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ows_title'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'QGIS-MAP'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ows_onlineresource'&nbsp; 'http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/Apache/htdocs/qgismapserv_org/xyz.map&amp;'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ows_srs'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'EPSG:4326 EPSG:900913'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ows_enable_request'&nbsp; 'GetMap GetFeature GetFeatureInfo *'&nbsp;&nbsp; ##necessary&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp; END<br>
<br>
&nbsp;&nbsp;&nbsp; #Scale range at which web interface will operate<br>
&nbsp;&nbsp;&nbsp; # Template and header/footer settings<br>
&nbsp;&nbsp;&nbsp; # Only the template parameter is required to display a map. See MapServer documentation<br>
&nbsp;&nbsp;&nbsp; #TEMPLATE 'fooOnlyForWMSGetFeatureInfo'<br>
&nbsp; END<br>
<br>
&nbsp; LAYER<br>
&nbsp;&nbsp;&nbsp; NAME 'xyz'<br>
&nbsp;&nbsp;&nbsp; TYPE POINT<br>
&nbsp;&nbsp;&nbsp; DUMP true<br>
&nbsp;&nbsp;&nbsp; #TEMPLATE fooOnlyForWMSGetFeatureInfo<br>
&nbsp;&nbsp;&nbsp; EXTENT -101.455432 18.242354 -73.740758 33.963395<br>
&nbsp;&nbsp;&nbsp; CONNECTIONTYPE postgis<br>
&nbsp;&nbsp;&nbsp; CONNECTION &quot;dbname='postgis' host=localhost port=5432 user='postgres' password='xxx' sslmode=disable&quot;<br>
&nbsp;&nbsp;&nbsp; DATA 'the_geom FROM us1gc09m USING UNIQUE fids' <br>
&nbsp;&nbsp;&nbsp; METADATA<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'ows_title' 'xyz'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wfs_typename' 'xyz'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wfs_version' '1.0.0'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wfs_connectiontimeout' '60'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wfs_maxfeatures' '150'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wfs_filter' 'GET'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'wfs_featureid' 'the_geom'<br>
&nbsp;&nbsp;&nbsp; END<br>
&nbsp;&nbsp;&nbsp; STATUS OFF<br>
&nbsp;&nbsp;&nbsp; TRANSPARENCY 100<br>
&nbsp;&nbsp;&nbsp; PROJECTION<br>
&nbsp;&nbsp;&nbsp; 'proj=longlat'<br>
&nbsp;&nbsp;&nbsp; 'ellps=WGS84'<br>
&nbsp;&nbsp;&nbsp; 'towgs84=0,0,0,0,0,0,0'<br>
&nbsp;&nbsp;&nbsp; 'no_defs'<br>
&nbsp;&nbsp;&nbsp; END<br>
&nbsp;&nbsp;&nbsp; CLASS<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME 'xyz' <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STYLE<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYMBOL &quot;circle&quot; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SIZE 7.0 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OUTLINECOLOR 0 0 0<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR 123 143 78<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END<br>
&nbsp;&nbsp;&nbsp; END<br>
&nbsp; END<br>
<br>
END<br>
<br>
</div>
Awaiting for a solution.</div>
</span>
<div><br>
<div style="font-family: Tahoma; font-size: 13px;">With Regards,<br>
Neelima Emmani<br>
</div>
</div>
</div>
</body>
</html>