aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-02-15 15:17:15 +0000
committerDave Arter <davea@mysociety.org>2018-02-22 11:30:25 +0000
commitf06ffadadd673e0b51c47da776c8f99ec2ed7ac7 (patch)
tree30c8169207ddbd648ab17b70ce9235148b20bcce
parent4d111b6fc89c6f82b29b75c978cf4aafde30fe27 (diff)
Allow invalid MapServer6 GML to be parsed
-rw-r--r--web/cobrands/fixmystreet/assets.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index 600cd6ab8..26a13dc1d 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -523,4 +523,25 @@ OpenLayers.Layer.Vector.prototype.getNearestFeature = function(point, threshold)
return nearest_feature;
};
+
+/*
+ * MapServer 6 (the version available on Debian Wheezy) outputs incorrect
+ * GML for MultiCurve geometries - see https://github.com/mapserver/mapserver/issues/4924
+ * The end result is that features with 'curveMembers' elements in their
+ * geometries will be missing from the map as the default GML parser doesn't
+ * know how to handle these elements.
+ * This subclass works around the problem by parsing 'curveMembers' elements.
+ */
+OpenLayers.Format.GML.v3.MultiCurveFix = OpenLayers.Class(OpenLayers.Format.GML.v3, {
+ readers: $.extend(true, {}, OpenLayers.Format.GML.v3.prototype.readers, {
+ "gml": {
+ "curveMembers": function(node, obj) {
+ this.readChildNodes(node, obj);
+ }
+ }
+ }),
+
+ CLASS_NAME: "OpenLayers.Format.GML.v3.MultiCurveFix"
+});
+
})();