Hi Luis,

>From your attached source i see, that you try to get your WFS for the
projection "EPSG:82176", but that will only work, if you use proj4js with
the matching projection file. Without proj4js OpenLayers can only transform
between the projection "EPSG:4326" and "EPSG:900913".

You should configure your WFS server (GeoServer) to deliver the data in the
projection "EPSG:4326". Then you should get a result.

Instead of the parameter 'srs', you have to use 'projection'

var wfs = new OpenLayers.Layer.WFS(
        "Cities",
        serverWFS,
        {
                typename: 'topp:tasmania_cities',
                projection: 'EPSG:82176'
        }
);

But it seems, that the WFS layer you request, have no attributes to display
at all:

<gml:featureMember>
<topp:tasmania_cities fid="tasmania_cities.1893">
<gml:boundedBy>
<gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
<gml:coordinates xmlns:gml="http://www.opengis.net/gml"; decimal="." cs=","
ts=" ">149.64878906,-44.20277344 149.64878906,-44.20277344</gml:coordinates>
</gml:Box>
</gml:boundedBy>
<topp:the_geom>
<gml:MultiPoint srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
<gml:pointMember>
<gml:Point>
<gml:coordinates xmlns:gml="http://www.opengis.net/gml"; decimal="." cs=","
ts=" ">149.64878906,-44.20277344</gml:coordinates>
</gml:Point>
</gml:pointMember>
</gml:MultiPoint>
</topp:the_geom>
<topp:CITY_NAME> </topp:CITY_NAME>
<topp:ADMIN_NAME> </topp:ADMIN_NAME>
<topp:CNTRY_NAME> </topp:CNTRY_NAME>
<topp:STATUS> </topp:STATUS>
<topp:POP_CLASS> </topp:POP_CLASS>
</topp:tasmania_cities>
</gml:featureMember>

Source : http://sigma.openplans.org:80/geoserver/wfs

Arnd



-----Ursprüngliche Nachricht-----
Von: Luís de Sousa [mailto:[email protected]] 
Gesendet: Mittwoch, 10. März 2010 21:26
An: Arnd Wippermann
Cc: [email protected]
Betreff: Re: [OpenLayers-Users] Labels on WFS layers

Dear Arnd,

Tank you for your input but that isn't working either. Please take a look at
the attached code; I'm using Geoserver's demo Tasmania layers, hope you have
that at hand. With this code the cities' colouring is set nicely but no city
names to see.

Thank you,

Luís

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to