Merge pull request #7141 from Sol1du2/issue/6990/WFSReadSrsDimension

Issue/6990/Wfs Read srsDimension
This commit is contained in:
Bart van den Eijnden
2017-08-29 09:38:13 +02:00
committed by GitHub
4 changed files with 111 additions and 3 deletions
+6 -3
View File
@@ -352,7 +352,7 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
var context = objectStack[0];
var containerSrs = context['srsName'];
var containerDimension = node.parentNode.getAttribute('srsDimension');
var contextDimension = context['srsDimension'];
var axisOrientation = 'enu';
if (containerSrs) {
var proj = ol.proj.get(containerSrs);
@@ -367,8 +367,11 @@ ol.format.GML3.prototype.readFlatPosList_ = function(node, objectStack) {
} else if (node.getAttribute('dimension')) {
dim = ol.format.XSD.readNonNegativeIntegerString(
node.getAttribute('dimension'));
} else if (containerDimension) {
dim = ol.format.XSD.readNonNegativeIntegerString(containerDimension);
} else if (node.parentNode.getAttribute('srsDimension')) {
dim = ol.format.XSD.readNonNegativeIntegerString(
node.parentNode.getAttribute('srsDimension'));
} else if (contextDimension) {
dim = ol.format.XSD.readNonNegativeIntegerString(contextDimension);
}
var x, y, z;
var flatCoordinates = [];
+1
View File
@@ -198,6 +198,7 @@ ol.format.GMLBase.prototype.readFeaturesInternal = function(node, objectStack) {
ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) {
var context = /** @type {Object} */ (objectStack[0]);
context['srsName'] = node.firstElementChild.getAttribute('srsName');
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
/** @type {ol.geom.Geometry} */
var geometry = ol.xml.pushParseAndPop(null,
this.GEOMETRY_PARSERS_, node, objectStack, this);