Fixed!<br>I put the filter condition directly in the initialization of the layer and i have not the problem with map properties!<br>And it works!!<br><br>Here the code:<br><br>var user_wfs = new OpenLayers.Layer.WFS<br>( "User Points",
<br> "<a href="http://localhost/cgi-bin/mapserv?map=/var/www/thesilence/webroot/mapserver/config/data_points.map&">http://localhost/cgi-bin/mapserv?map=/var/www/thesilence/webroot/mapserver/config/data_points.map&
</a>", <br> {typename: "points", Filter: '<Filter><PropertyIsEqualTo><PropertyName>user_id</PropertyName><Literal>2</Literal></PropertyIsEqualTo></Filter>'},
<br>{ featureClass: OpenLayers.Feature.WFS}<br>);<br><br>Now the filtering of my data is working... thank you very much for your help!<br>Cheers<br><br><br><br><br><br><div><span class="gmail_quote">2007/2/16, Pedrazzi Gelsomini <
<a href="mailto:pedrazzi.gelsomini@gmail.com">pedrazzi.gelsomini@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thank you very much for your help.
<br>I should ask you more information beacause i can't understand what i have to do.<br><br>> var filter = '<Filter><PropertyIsEqualTo><PropertyName>user_id</PropertyName><Literal>3</Literal><
<span class="q"><br>> /PropertyIsEqualTo></Filter>';
<br><br>> mylayer.mergeNewParams({"filter":filter});<br><br></span>Putting these instruction above i have the following error <br><br>"this.map has no properties"<br>(<span>
</span><a>Grid.js - line 171 -</a> <span><span>var viewSize = this.map.getSize(); <br><br>
</span></span>Do i have to insert these instructions after mylayer initialization, that is in the function init() that creates my map?<br>Is it correct put in the <PropertyName> the name of a field that I get from the SELECT query of the OVF file?
<br><br>Is it enough to add this code lines or I have to do something other in order to make working the Filter Encoding?<br>Sorry for the trivial questions but i am quite new in this subject.<br><br>Thanks a lot for your time!
<br><br><br><br><div>
<span class="gmail_quote">2007/2/16, Bart van den Eijnden (OSGIS) <<a href="mailto:bartvde@osgis.nl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">bartvde@osgis.nl</a>>:</span><div><span class="e" id="q_110cbdd9c31e45f0_3">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>you need to use the FILTER parameter from the OGC WFS spec to do this, check<br>this for more info:<br><br><a href="http://mapserver.gis.umn.edu/docs/howto/filterencoding/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://mapserver.gis.umn.edu/docs/howto/filterencoding/
</a><br><br>then you need to call mergeNewParams on your OpenLayers layer:<br><br>var filter = '<Filter><PropertyIsEqualTo><PropertyName>USER</PropertyName><br><Literal>Peter</Literal></PropertyIsEqualTo></Filter>';
<br><br>mylayer.mergeNewParams({"filter":filter});<br><br>Best regards,<br>Bart<br><br>--<br>Bart van den Eijnden<br>OSGIS, Open Source GIS<br><a href="http://www.osgis.nl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.osgis.nl</a><br><br><br>--------- Oorspronkelijk bericht --------
<br>Van: Pedrazzi Gelsomini <<a href="mailto:pedrazzi.gelsomini@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">pedrazzi.gelsomini@gmail.com</a>><br>Naar: <a href="mailto:users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
users@openlayers.org</a> <<a href="mailto:users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
users@openlayers.org</a>><br>Onderwerp: [OpenLayers-Users] Changing map file FILTER parameter via URL -<br>WFS layer with OVF connection<br>Datum: 16/02/07 13:02<br><br>> Hi everyone,I m using openlayers for my application and I have a WFS layer
<br>filled by my mysql database using mapserver.My layer inizialitazion is:<br>> var user_wfs = new OpenLayers.Layer.WFS( &quot;User Points&quot;,<br>><br>><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp;<br>&quot;http://localhost/cgi-bin/mapserv?map=/var/www/thesilence/webroot/mapserver/config/data_points.map&amp;<br>> &quot;,<br>><br>> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {typename:
<br>&quot;points&quot;}, { featureClass: OpenLayers.Feature.WFS});<br>><br>> In my file.map i have the following layer:LAYER&nbsp;&nbsp;&nbsp;<br>CONNECTION &quot;my_points.ovf&quot;&nbsp;&nbsp;&nbsp; CONNECTIONTYPE
<br>OGR&nbsp;&nbsp;&nbsp; DATA &quot;points&quot;&nbsp;&nbsp;&nbsp; METADATA<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;wms_srs&quot;&nbsp;&nbsp;&nbsp;
<br>&quot;EPSG:4326&quot;<br>> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>&quot;wms_title&quot;&nbsp;&nbsp;&nbsp; &quot;points&quot;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp; &quot;wfs_srs&quot;&nbsp;&nbsp;&nbsp;<br>&quot;EPSG:4326&quot;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>&quot;wfs_title&quot;&nbsp;&nbsp;&nbsp; &quot;points&quot;&nbsp;&nbsp;&nbsp;
<br>&nbsp;&nbsp;&nbsp; &quot;gml_featureid&quot;&nbsp;&nbsp;&nbsp;<br>&quot;fid&quot;<br>> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &quot;gml_include_items&quot;&nbsp;
<br>&quot;all&quot;&nbsp;&nbsp;&nbsp; END&nbsp;&nbsp;&nbsp; NAME<br>&quot;points&quot;&nbsp;&nbsp;&nbsp; SIZEUNITS PIXELS&nbsp;&nbsp;&nbsp;<br>STATUS ON&nbsp;&nbsp;&nbsp; DUMP TRUE&nbsp;&nbsp;&nbsp;
<br>PROJECTION&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br>&quot;init=epsg:4326&quot;&nbsp;&nbsp;&nbsp; END<br>> &nbsp;&nbsp;&nbsp; TOLERANCE 20&nbsp;&nbsp;&nbsp; TOLERANCEUNITS
<br>PIXELS&nbsp;&nbsp;&nbsp; TYPE POINT&nbsp;&nbsp;&nbsp; UNITS<br>METERS&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FILTERITEM<br>&quot;user_id&quot;&nbsp;&nbsp;&nbsp; #FILTER &quot;&quot;where
<br>my_points.ovf is:&lt;OGRVRTDataSource&gt;<br>> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;OGRVRTLayer<br>name=&quot;points&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>&lt;SrcDataSource&gt;ODBC:myuser/mypsw@mydns&lt;/SrcDataSource&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&lt;SrcSQL&gt;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SELECT data_points.id AS
<br>fid, latitude, longitude, des_walks.com_user_id AS user_id<br>> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FROM data_points JOIN<br>des_walks&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; WHERE des_walks.id =
<br>data_points.des_walk_id&nbsp;&nbsp;&nbsp; &lt;/SrcSQL&gt;&nbsp;&nbsp;&nbsp;<br>&lt;GeometryType&gt;wkbPoint&lt;/GeometryType&gt;&nbsp;&nbsp;&nbsp;<br>&lt;LayerSRS&gt;WGS84&lt;/LayerSRS&gt;
<br>> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;GeometryField<br>encoding=&quot;PointFromColumns&quot; x=&quot;longitude&quot;<br>y=&quot;latitude&quot;/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>&lt;/OGRVRTLayer&gt;&lt;/OGRVRTDataSource&gt;but I need to change the value<br>of the FILTER parameter in the map file via URL.<br>><br>> The connection with database works and allows me to put my points on my
<br>map.I would like to filter these data by &quot;user_id&quot; and show only<br>the data linked to a specific user, but i have to pass this parameter via<br>url because it is not always the same.<br>><br>> Now i m passing just the typename in the openlayers function, but i dont
<br>know how to change the FILTER parameter in my map file.&nbsp;&nbsp;&nbsp;<br>FILTERITEM &quot;user_id&quot;<br>> &nbsp;&nbsp;&nbsp; #FILTER &quot;&quot;Any suggestion?Thank you very much!
<br>><br>><br>><br>><br>><br>> _______________________________________________<br>> Users mailing list<br>> <a href="mailto:Users@openlayers.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Users@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://openlayers.org/mailman/listinfo/users</a><br>><br><br><br><br></blockquote></span></div></div><span class="sg"><br><br clear="all"><br>-- <br>Ilaria Gelsomini<br>Francesca Pedrazzi
</span></blockquote></div><br><br clear="all"><br>-- <br>Ilaria Gelsomini<br>Francesca Pedrazzi