<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Arial">Hi there, <br>
<br>
</font><font face="Arial"><font face="Arial">I am working with
Openlayers 3.6 and </font>I am trying to display a gml layer
from a WFS service. And not only that, I am also trying to
reproject this layer from epsg:4326 to epsg:3857. This part of the
code looks like:<br>
<br>
vectorSource.addFeatures(gmlFormat.readFeatures(data,
{dataProjection:'EPSG:4326', featureProjection:'EPSG:3857'}));<br>
<br>
The entire example is here<br>
<br>
<a class="moz-txt-link-freetext" href="http://sigserver4.udg.edu/apps/ol3/wfs_usa_states.html">http://sigserver4.udg.edu/apps/ol3/wfs_usa_states.html</a><br>
<br>
After loading the page, no error is thrown but the gml layer is
not displayed.<br>
<br>
After executing this (in the javascript console)<br>
<br>
vectorSource.getFeatures()[5].getGeometry().getCoordinates()<br>
<br>
I get something like <br>
<br>
[[[[4641827.511692658, NaN, 0], [4626910.811245848, NaN, 0],
[4607302.996137521, NaN, 0], more...<br>
<br>
So, Is there a problem reprojecting "minus" coordinates formated
like "-xxx.xxxx"?<br>
<br>
The same example works fine if I add the outputformat=JSON to the
WFS call, but I would like to use GML if possible for didactic
purposes (I am developing a course about OpenLayers). Also, the
example works fine if I do not reproject features, and change the
srsnam param to srsname=EPSG:3857.<br>
<br>
Any ideas?<br>
Thank you all.<br>
</font><br>
<div class="moz-signature">-- <br>
<span style="font-size:8.5pt">
<b>Toni Hernández Vallès</b>
<br>
Servei de Sistemes d'Informació Geogràfica i Teledetecció<br>
-<br>
Universitat de Girona<br>
<b>SIGTE</b><br>
-<br>
Pl. Ferrater Mora 1<br>
17071 Girona<br>
Tel +34 972 418 039 (7026 intern)<br>
<a href="mailto:toni@sigte.udg.edu">toni@sigte.udg.edu</a>
<br>
<br>
<a href="http://www.sigte.udg.edu">http://www.sigte.udg.edu</a><br>
Twitter <a href="http://twitter.com/SIGTE_UDG">http://twitter.com/SIGTE_UDG</a><br>
<br>
</span></div>
</body>
</html>