Respect the srsDimension attribute.
This also fixes http://trac.osgeo.org/openlayers/ticket/2762. Note: it seems there is no "dimension" attribute for posList in the spec. This attribute name is only used in some examples of the GML 3.1 specification, but it is not mentioned in any of the XSDs.
This commit is contained in:
@@ -95,6 +95,7 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
|
||||
},
|
||||
"Curve": function(node, container) {
|
||||
var obj = {points: []};
|
||||
this.readers.gml._srsReferenceGroup.apply(this, [node, obj, container]);
|
||||
this.readChildNodes(node, obj);
|
||||
if(!container.components) {
|
||||
container.components = [];
|
||||
@@ -135,7 +136,8 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
|
||||
this.regExes.trimSpace, ""
|
||||
);
|
||||
var coords = str.split(this.regExes.splitSpace);
|
||||
var dim = parseInt(node.getAttribute("dimension")) || 2;
|
||||
var dim = obj.srsDimension ||
|
||||
parseInt(node.getAttribute("dimension") || node.getAttribute("srsDimension"), 10) || 2;
|
||||
var j, x, y, z;
|
||||
var numPoints = coords.length / dim;
|
||||
var points = new Array(numPoints);
|
||||
@@ -172,6 +174,7 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
|
||||
},
|
||||
"MultiCurve": function(node, container) {
|
||||
var obj = {components: []};
|
||||
this.readers.gml._srsReferenceGroup.apply(this, [node, obj, container]);
|
||||
this.readChildNodes(node, obj);
|
||||
if(obj.components.length > 0) {
|
||||
container.components = [
|
||||
@@ -184,6 +187,7 @@ OpenLayers.Format.GML.v3 = OpenLayers.Class(OpenLayers.Format.GML.Base, {
|
||||
},
|
||||
"MultiSurface": function(node, container) {
|
||||
var obj = {components: []};
|
||||
this.readers.gml._srsReferenceGroup.apply(this, [node, obj, container]);
|
||||
this.readChildNodes(node, obj);
|
||||
if(obj.components.length > 0) {
|
||||
container.components = [
|
||||
|
||||
Reference in New Issue
Block a user