<div dir="ltr"><div><div><div><div><div><div><div>Hi all,<br><br></div>I'm sorry if this
question is asked million times, but I'm in trouble and can't find the
answer.<br>
<br></div>I can't get vector layer from GeoServer visible in OpenLayers.
I have tried hundred different combination with the code and can't get
it fixed. <br><br></div>The thing is that I manage to get WFS layer
visible in the basemap/layers box, but I can't see it in the map. This
probably tells that maybe nothing is wrong with GeoServer but the
html/OpenLayers code.<br>
<br></div>One thing is that I have brought proj4js library since I wan't the map to be in EPSG:3067. <br><script src="proj4js/lib/proj4js-compressed.js"></script> and in init() <br>Proj4js.defs["EPSG:3067"] = "+proj=utm +zone=35 +ellps=GRS80 +units=m +no_defs";<br>
<br></div>I cannot believe that this would mix the vector data I bring
from GeoServer, since it is also in this same coordinate system. Is
there some settings I should fix on GeoServer before I serve it to
OpenLayers?<br>
<br></div>Any help is appreciated! Sorry I can't make the question any
clearer. I work with OL 2.13, GeoServer 2.3.2 and Windows Server 2008 R2
Datacenter. Below there is my code dealing with WFS.<br><br><br></div>Laura<br><br><br><br>var layer_name = new OL.Layer.Vector("Layer name", {<br> projection: 'EPSG: 3067',<br> strategies: [new OL.Strategy.BBOX()],<br>
protocol: new OL.Protocol.WFS({<br> version: "1.1.0",<br> featureType: "file_name:vector_doc_name",<br> url: "<a href="http://www.domain_name.com:8080/geoserver/file_name/wfs">http://www.domain_name.com:8080/geoserver/file_name/wfs</a>",<br>
featureNS: "<a href="http://www.domain_name.com:8080">www.domain_name.com:8080</a>",<br> srsName: "EPSG:3067"<br> })<br>});<br></div>