[OpenLayers-Users] 'xy' property in OpenLayers.Format.GML class

Tim Schaub tschaub at opengeo.org
Wed Mar 24 16:39:40 EDT 2010


Maribel Bernal wrote:
> Hi again,
> I'm using SOSClient class to show any points in a map. Now, the points 
> appear as lat-long while in the response of GetCapabilities request of 
> my SOS appear as long-lat.
> 
> Someone knows in which function I can set the first number of 
> "gml:lowerCorner"/"gml:upperCorner" as longitude and the second as latitude?
> I see that exists a property called "xy" (true by default) in 
> OpenLayers.Format.GML class, but is not recommended to change it to 
> false. Anyway, I tried to change it but not works...
> 
> Any idea or suggestions?
> 

The default is xy (or longitude, latitude) order.

I'd suggest using the OpenLayers.Format.GML.v3 parser for your version 3 
GML.

It looks to me like the older parser (OpenLayers.Format.GML) should 
properly apply the xy property when reading envelope coordinates as well.

Can you provide a simple test case that fails?

Tim

> That is the part of my response of the SosCapabilities request, where 
> appear a point:
> 
>  <sos:Contents>
>     <sos:ObservationOfferingList>
>       <sos:ObservationOffering gml:id="GAUGE_HEIGHT">
>         <gml:name>The water level in a river</gml:name>
>         <gml:boundedBy>
> 
>           <gml:Envelope srsName="urn:ogc:def:crs:EPSG:4326">
>             <gml:lowerCorner>2.11353 41.1111</gml:lowerCorner>
>             <gml:upperCorner>9.1111 52.9</gml:upperCorner>
>           </gml:Envelope>
>         </gml:boundedBy>
> 
> 
> 
> Thanks at all.
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Users mailing list