[OpenLayers-Dev] Using xy: false with Protocol.WFS

Steven Ottens steven at minst.net
Fri Jul 2 05:17:26 EDT 2010


Hi all,

I've been doing some thinking about this and I believe there's an omission in OpenLayers. Currently there is no way to set the xy to false when using the WFS protocol, even though OpenLayers supports it in the WFST and GML formats.
A very simple solution is to add an xy attribute to Protocol/WFS/v1.js and pass it on along with the other options to WFST.

Does this make sense? Should I file a ticket with patch and test?

Steven 


On Jun 30, 2010, at 5:30 PM, Steven Ottens wrote:

> Hi All,
> 
> I'm trying to swap the x and y of coordinates for one specific WFS layer. The layer is defined as:
> skGN : new OpenLayers.Layer.Vector("Norway GN",
> 		{
> 		strategies: [new OpenLayers.Strategy.BBOX({resFactor: 1})],
> 			visibility: true,
> 			styleMap: GeoViewer.Styles.pointStyles,			
> 			projection: new OpenLayers.Projection("EPSG:4258"),
> 			protocol: new OpenLayers.Protocol.WFS({
> 				version: "1.1.0",
> 				outputFormat: "text/xml; subtype=gml/3.2.1",
> 				srsName: "EPSG:4258",
> 				extractAttributes:true, 
> 				url: GeoViewer.Catalog.urls.SK_WFS,
> 				featurePrefix: "gn",
> 				featureType: "NamedPlace",
> 				featureNS: "urn:x-inspire:specification:gmlas:GeographicalNames:3.0",
> 				geometryName: "geometry",
> 				maxFeatures: "50",
> 				schema: "http://esdin.geodan.nl/fgi/SK/deegree2-wfs/services?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=GN:NamedPlace&namespace=xmlns=(GN=urn:x-inspire:specification:gmlas:GeographicalNames:3.0)"
> 			})
> 		}
> 	)
> 
> I noticed that xy is a parameter of Format.WFST.v1and changing xy: true to xy: false in code does what I want. However, it does that for all layers and that's not what I want. Is it possible to configure one layer to swap xy, using the approach above?
> I tried to add xy: false after visibility: true and in the protocol definition (which obviously doesn't work). 
> Is there a way to send attributes to the correct Format class?
> 
> Regards,
> Steven
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev





More information about the Dev mailing list