[OpenLayers-Users] Parsing / Rendering MultiGeometry from WFS fails

Marco Scheuble mail at marco-scheuble.de
Fri Jan 11 03:13:24 PST 2013


Hi All,

Here are two solutions to solve the problem. I don't know, if it even is an
OL bug!?

The problem indeed is the "MultiGeometry"-Tag. 
OL Format.GML.v3 doesn't know it.  In the class-definition a tag called:
"GeometryCollection" ( Line 458 ) is expected for this. So here, the mapping
for the tag "MultiGeometry" to the geometryType
"OpenLayers.Geometry.Collection" is missing or maybe wrong.

OL-solution:
just replace the mapping after layer definition.
---------------------------------
layer = new OpenLayers.Layer.Vector( 'Layer', {
 ...
  protocol: new OpenLayers.Protocol.WFS({
    version: "1.1.0",
    ...
  })
});
layer.protocol.format.geometryTypes[ "OpenLayers.Geometry.Collection" ] =
"MultiGeometry";
---------------------------------

Non-OL-solution:
Replace all occurencies of "MultiGeometry" with "GeometryCollection" in the
wfs-response. 
This could be realized through a proxy-script.

Both ways are working.

cheers, Marco






--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Parsing-Rendering-MultiGeometry-from-WFS-fails-tp5026671p5026886.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list