[OpenLayers-Users] simple gazetteer test with geojson

Gery . gamejihou at hotmail.com
Thu Sep 20 14:27:18 PDT 2012



Hello,

I'm testing this very nice example: http://ian01.geog.psu.edu/geoserver/www/search/gazetteer.html (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 actually 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:

 // define the data source
    var protocol = new OpenLayers.Protocol.HTTP({
        url: 'http://localhost/postgis_geojson.php?geotable=boreholes_point_wgs84&geomfield=geom',
        format: new OpenLayers.Format.GeoJSON({
            ignoreExtraDims: true,
            'internalProjection': new OpenLayers.Projection("EPSG:900913"),
            'externalProjection': new OpenLayers.Projection("EPSG:4326")
        })
    });

BTW, I'm using the cool script postgis_geojson.php to get my postgis table as geojson.

Any help is appreciated, thanks in advance,

Best regards,

Gery




__________________________________________________________________________________________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie NICHT, wenn es NICHT notwendig ist.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120920/97ba6499/attachment.html>


More information about the Users mailing list