<br><br>On Thursday, September 20, 2012, Gery .  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">
<font style="font-size:12pt" color="#1F497D" face="Arial" size="3"><br>Hello,<br><br>I'm testing this very nice example: <a href="http://ian01.geog.psu.edu/geoserver/www/search/gazetteer.html" target="_blank">http://ian01.geog.psu.edu/geoserver/www/search/gazetteer.html</a> (congratulations to the author btw) but using in the protocol geojson (without geojson) instead of the default configuration using WFS and XML (loaded in geoserver). It works </font><font style="font-size:12pt" color="#1F497D" face="Arial" size="3">actually </font><font style="font-size:12pt" color="#1F497D" face="Arial" size="3">nicely, the results appear in the map and the grid, but the problem is that once I look for one feature, it just appears the whole geojson in the map, so I understand that the code (formPanel and name_like) doesn't "fetch" actually the feature I searched for. I've read somewhere that this problem is either a filter in the geojson output or the geojson deserialization, but not sure if this is right. This is basically the part I changed in the original code:<br>

<br> // define the data source<br>    var protocol = new OpenLayers.Protocol.HTTP({<br>        url: '<a href="http://localhost/postgis_geojson.php?geotable=boreholes_point_wgs84&geomfield=geom" target="_blank">http://localhost/postgis_geojson.php?geotable=boreholes_point_wgs84&geomfield=geom</a>',<br>

        format: new OpenLayers.Format.GeoJSON({<br>            ignoreExtraDims: true,<br>            'internalProjection': new OpenLayers.Projection("EPSG:900913"),<br>            'externalProjection': new OpenLayers.Projection("EPSG:4326")<br>

        })<br>    });<br><br>BTW, I'm using the cool script postgis_geojson.php to get my postgis table as geojson.<br><br>Any help is appreciated, thanks in advance,</font></div></div><div dir="ltr"></div></blockquote>

<div><br></div><div><br></div><div dir="ltr">For name__like to be taken into account (1) <span>your postgis_geojson.php script needs to support comparison filters in the requests, and (2) </span>Protocol.HTTP object needs to have a filterToParams format. By default, if no filterToParams format is passed to the constructor, an Protocol.HTTP instance is configured with QueryStringFilter format, which, for example, converts a LIKE filter on attribute "name" into name__like=%value% in the query string.<span></span></div>
<div dir="ltr"><br></div><div dir="ltr">Hope it helps<span></span></div>
<div dir="ltr"></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div>
</blockquote>
<br><br>-- <br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br><br>