[OpenLayers-Users] Labels on WFS layers
Arnd Wippermann
arnd.wippermann at web.de
Wed Mar 10 16:50:25 EST 2010
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:luis.a.de.sousa at gmail.com]
Gesendet: Mittwoch, 10. März 2010 21:26
An: Arnd Wippermann
Cc: users at openlayers.org
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
More information about the Users
mailing list