[OpenLayers-Users] Can´t get WFS vector layer visible in OpenLayers

Laura Kauria lacation at gmail.com
Tue Aug 20 03:07:17 PDT 2013


Hi all,

I'm sorry if this question is asked million times, but I'm in trouble and
can't find the answer.

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.

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.

One thing is that I have brought proj4js library since I wan't the map to
be in EPSG:3067.
<script src="proj4js/lib/proj4js-compressed.js"></script> and in init()
Proj4js.defs["EPSG:3067"] = "+proj=utm +zone=35 +ellps=GRS80 +units=m
+no_defs";

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?

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.


Laura



var layer_name = new OL.Layer.Vector("Layer name", {
            projection: 'EPSG: 3067',
            strategies: [new OL.Strategy.BBOX()],
            protocol: new OL.Protocol.WFS({
                version: "1.1.0",
                featureType: "file_name:vector_doc_name",
                url: "
http://www.domain_name.com:8080/geoserver/file_name/wfs",
                featureNS: "www.domain_name.com:8080",
                srsName: "EPSG:3067"
            })
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130820/5ddc724c/attachment.html>


More information about the Users mailing list