[OpenLayers-Users] Tinyows work but features not displayed in OL

ar_gaeta riccardog79 at gmail.com
Mon Dec 12 10:38:19 EST 2011


Hi all.
I've read a lot of discussion here and on Tinyows forum. The tinyows service
work fine, it gives me right answer at this questions by browser:
http://localhost/cgi-bin/tinyows?service=WFS&version=1.0.0&request=GetFeature&TypeName=pluvsmartz&maxFeatures=1

and by shell:
/var/www/cgi_bin/./tinyows --check

So tinyows seems to be configured well, it is able to retrieve features from
the postgis layer.
But when I try to call these layers with OpenLayer, I don't have nothing
displayed in my map.
This problem occur in my RedHat 5.6 machine.
On my Windows7 machine all is working fine: the files script are the same,
and both tinyows are pointed to the same PostGIS DB.

I post an extract of my OL script. As you can see I've tried a lot of option
to describe my layers but nothing.

Thanks for any help!!

Riccardo

var options = {
    projection: new OpenLayers.Projection("EPSG:900913"),
    units: "m",
    maxResolution: 156543.0339,
    maxExtent: new OpenLayers.Bounds(600000,4200000,1600000,6100000),
    tileSize: new OpenLayers.Size(256, 256)
};
var map = new OpenLayers.Map('map', options);
var osmLayer = new OpenLayers.Layer.OSM("OpenStreetMap");
map.addLayer(osmLayer);
var sismi_tinyows = new OpenLayers.Layer.Vector("1982-oggi", {
    strategies: [new OpenLayers.Strategy.BBOX()],
    projection: new OpenLayers.Projection("EPSG:900913"),
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.0.0",
        url: "cgi-bin/tinyows?",
        featureType: "comtraps",
        featureNS: "http://www.tinyows.org/",
        srsName: "EPSG:32632",
		readFormat: new OpenLayers.Format.GML({
            'internalProjection': new OpenLayers.Projection("EPSG:900913"),
            'externalProjection': new OpenLayers.Projection("EPSG:23032")
		})		
    })
});
var pluv_tinyows = new OpenLayers.Layer.Vector("1982-oggi", {
    strategies: [new OpenLayers.Strategy.BBOX()],
    projection: new OpenLayers.Projection("EPSG:900913"),
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.0.0",
        url: "../cgi-bin/tinyows?",
        featureType: "pluvsmartz",
        featureNS: "http://127.0.0.1",
        geometryName: "the_geom",
        srsName: "urn:ogc:def:crs:EPSG:32632",
        schema:
"http://127.0.0.1/cgi-bin/tinyows?service=WFS&version=1.0.0&request=DescribeFeatureType&TypeName=pluvsmartz",
        outputFormat: "application/json"
        ,readFormat: new OpenLayers.Format.GeoJSON({
                'internalProjection': new
OpenLayers.Projection("EPSG:900913"),
                'externalProjection': new
OpenLayers.Projection("EPSG:32632")
        })
    })
});
map.addLayer(pluv_tinyows);
map.addLayer(sismi_tinyows);


 

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Tinyows-work-but-features-not-displayed-in-OL-tp7086513p7086513.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list