Merge pull request #5508 from tsauerwein/compiler-properties
Fix problems with ol.format.WFS in compiled mode
This commit is contained in:
@@ -55,7 +55,7 @@ ol.format.GML2.schemaLocation_ = ol.format.GMLBase.GMLNS +
|
|||||||
*/
|
*/
|
||||||
ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
|
ol.format.GML2.prototype.readFlatCoordinates_ = function(node, objectStack) {
|
||||||
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
var s = ol.xml.getAllTextContent(node, false).replace(/^\s*|\s*$/g, '');
|
||||||
var context = objectStack[0];
|
var context = /** @type {ol.XmlNodeStackItem} */ (objectStack[0]);
|
||||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||||
var containerSrs = context['srsName'];
|
var containerSrs = context['srsName'];
|
||||||
var containerDimension = node.parentNode.getAttribute('srsDimension');
|
var containerDimension = node.parentNode.getAttribute('srsDimension');
|
||||||
|
|||||||
@@ -105,10 +105,10 @@ ol.format.WFS.prototype.readFeatures;
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
|
ol.format.WFS.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||||
var context = {
|
var context = /** @type {ol.XmlNodeStackItem} */ ({
|
||||||
'featureType': this.featureType_,
|
'featureType': this.featureType_,
|
||||||
'featureNS': this.featureNS_
|
'featureNS': this.featureNS_
|
||||||
};
|
});
|
||||||
ol.object.assign(context, this.getReadOptions(node,
|
ol.object.assign(context, this.getReadOptions(node,
|
||||||
opt_options ? opt_options : {}));
|
opt_options ? opt_options : {}));
|
||||||
var objectStack = [context];
|
var objectStack = [context];
|
||||||
@@ -442,11 +442,11 @@ ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) {
|
|||||||
values.push({name: keys[i], value: value});
|
values.push({name: keys[i], value: value});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ol.xml.pushSerializeAndPop({node: node, srsName:
|
ol.xml.pushSerializeAndPop(/** @type {ol.XmlNodeStackItem} */ (
|
||||||
context['srsName']},
|
{node: node, 'srsName': context['srsName']}),
|
||||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||||
ol.xml.makeSimpleNodeFactory('Property'), values,
|
ol.xml.makeSimpleNodeFactory('Property'), values,
|
||||||
objectStack);
|
objectStack);
|
||||||
ol.format.WFS.writeOgcFidFilter_(node, fid, objectStack);
|
ol.format.WFS.writeOgcFidFilter_(node, fid, objectStack);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -532,7 +532,7 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
|
|||||||
ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix,
|
ol.xml.setAttributeNS(node, ol.format.WFS.XMLNS, 'xmlns:' + featurePrefix,
|
||||||
featureNS);
|
featureNS);
|
||||||
}
|
}
|
||||||
var item = ol.object.assign({}, context);
|
var item = /** @type {ol.XmlNodeStackItem} */ (ol.object.assign({}, context));
|
||||||
item.node = node;
|
item.node = node;
|
||||||
ol.xml.pushSerializeAndPop(item,
|
ol.xml.pushSerializeAndPop(item,
|
||||||
ol.format.WFS.QUERY_SERIALIZERS_,
|
ol.format.WFS.QUERY_SERIALIZERS_,
|
||||||
@@ -554,6 +554,7 @@ ol.format.WFS.writeQuery_ = function(node, featureType, objectStack) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.format.WFS.writeFilterCondition_ = function(node, filter, objectStack) {
|
ol.format.WFS.writeFilterCondition_ = function(node, filter, objectStack) {
|
||||||
|
/** @type {ol.XmlNodeStackItem} */
|
||||||
var item = {node: node};
|
var item = {node: node};
|
||||||
ol.xml.pushSerializeAndPop(item,
|
ol.xml.pushSerializeAndPop(item,
|
||||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||||
@@ -574,7 +575,7 @@ ol.format.WFS.writeBboxFilter_ = function(node, filter, objectStack) {
|
|||||||
|
|
||||||
var context = objectStack[objectStack.length - 1];
|
var context = objectStack[objectStack.length - 1];
|
||||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||||
context.srsName = filter.srsName;
|
context['srsName'] = filter.srsName;
|
||||||
|
|
||||||
ol.format.WFS.writeOgcPropertyName_(node, filter.geometryName);
|
ol.format.WFS.writeOgcPropertyName_(node, filter.geometryName);
|
||||||
ol.format.GML3.prototype.writeGeometryElement(node, filter.extent, objectStack);
|
ol.format.GML3.prototype.writeGeometryElement(node, filter.extent, objectStack);
|
||||||
@@ -590,6 +591,7 @@ ol.format.WFS.writeBboxFilter_ = function(node, filter, objectStack) {
|
|||||||
ol.format.WFS.writeLogicalFilter_ = function(node, filter, objectStack) {
|
ol.format.WFS.writeLogicalFilter_ = function(node, filter, objectStack) {
|
||||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.LogicalBinary,
|
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.LogicalBinary,
|
||||||
'must be logical filter');
|
'must be logical filter');
|
||||||
|
/** @type {ol.XmlNodeStackItem} */
|
||||||
var item = {node: node};
|
var item = {node: node};
|
||||||
var conditionA = filter.conditionA;
|
var conditionA = filter.conditionA;
|
||||||
ol.xml.pushSerializeAndPop(item,
|
ol.xml.pushSerializeAndPop(item,
|
||||||
@@ -613,6 +615,7 @@ ol.format.WFS.writeLogicalFilter_ = function(node, filter, objectStack) {
|
|||||||
ol.format.WFS.writeNotFilter_ = function(node, filter, objectStack) {
|
ol.format.WFS.writeNotFilter_ = function(node, filter, objectStack) {
|
||||||
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.Not,
|
goog.asserts.assertInstanceof(filter, ol.format.ogc.filter.Not,
|
||||||
'must be Not filter');
|
'must be Not filter');
|
||||||
|
/** @type {ol.XmlNodeStackItem} */
|
||||||
var item = {node: node};
|
var item = {node: node};
|
||||||
var condition = filter.condition;
|
var condition = filter.condition;
|
||||||
ol.xml.pushSerializeAndPop(item,
|
ol.xml.pushSerializeAndPop(item,
|
||||||
@@ -755,7 +758,7 @@ ol.format.WFS.GETFEATURE_SERIALIZERS_ = {
|
|||||||
ol.format.WFS.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
ol.format.WFS.writeGetFeature_ = function(node, featureTypes, objectStack) {
|
||||||
var context = objectStack[objectStack.length - 1];
|
var context = objectStack[objectStack.length - 1];
|
||||||
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
goog.asserts.assert(goog.isObject(context), 'context should be an Object');
|
||||||
var item = ol.object.assign({}, context);
|
var item = /** @type {ol.XmlNodeStackItem} */ (ol.object.assign({}, context));
|
||||||
item.node = node;
|
item.node = node;
|
||||||
ol.xml.pushSerializeAndPop(item,
|
ol.xml.pushSerializeAndPop(item,
|
||||||
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
ol.format.WFS.GETFEATURE_SERIALIZERS_,
|
||||||
@@ -812,14 +815,15 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
|
|||||||
}
|
}
|
||||||
ol.xml.setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
|
ol.xml.setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||||
'xsi:schemaLocation', this.schemaLocation_);
|
'xsi:schemaLocation', this.schemaLocation_);
|
||||||
|
/** @type {ol.XmlNodeStackItem} */
|
||||||
var context = {
|
var context = {
|
||||||
node: node,
|
node: node,
|
||||||
srsName: options.srsName,
|
'srsName': options.srsName,
|
||||||
featureNS: options.featureNS ? options.featureNS : this.featureNS_,
|
'featureNS': options.featureNS ? options.featureNS : this.featureNS_,
|
||||||
featurePrefix: options.featurePrefix,
|
'featurePrefix': options.featurePrefix,
|
||||||
geometryName: options.geometryName,
|
'geometryName': options.geometryName,
|
||||||
filter: filter,
|
'filter': filter,
|
||||||
propertyNames: options.propertyNames ? options.propertyNames : []
|
'propertyNames': options.propertyNames ? options.propertyNames : []
|
||||||
};
|
};
|
||||||
goog.asserts.assert(Array.isArray(options.featureTypes),
|
goog.asserts.assert(Array.isArray(options.featureTypes),
|
||||||
'options.featureTypes should be an array');
|
'options.featureTypes should be an array');
|
||||||
@@ -845,7 +849,9 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
|||||||
'Transaction');
|
'Transaction');
|
||||||
node.setAttribute('service', 'WFS');
|
node.setAttribute('service', 'WFS');
|
||||||
node.setAttribute('version', '1.1.0');
|
node.setAttribute('version', '1.1.0');
|
||||||
var baseObj, obj;
|
var baseObj;
|
||||||
|
/** @type {ol.XmlNodeStackItem} */
|
||||||
|
var obj;
|
||||||
if (options) {
|
if (options) {
|
||||||
baseObj = options.gmlOptions ? options.gmlOptions : {};
|
baseObj = options.gmlOptions ? options.gmlOptions : {};
|
||||||
if (options.handle) {
|
if (options.handle) {
|
||||||
@@ -855,9 +861,9 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
|||||||
ol.xml.setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
|
ol.xml.setAttributeNS(node, 'http://www.w3.org/2001/XMLSchema-instance',
|
||||||
'xsi:schemaLocation', this.schemaLocation_);
|
'xsi:schemaLocation', this.schemaLocation_);
|
||||||
if (inserts) {
|
if (inserts) {
|
||||||
obj = {node: node, featureNS: options.featureNS,
|
obj = {node: node, 'featureNS': options.featureNS,
|
||||||
featureType: options.featureType, featurePrefix: options.featurePrefix,
|
'featureType': options.featureType, 'featurePrefix': options.featurePrefix,
|
||||||
srsName: options.srsName};
|
'srsName': options.srsName};
|
||||||
ol.object.assign(obj, baseObj);
|
ol.object.assign(obj, baseObj);
|
||||||
ol.xml.pushSerializeAndPop(obj,
|
ol.xml.pushSerializeAndPop(obj,
|
||||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||||
@@ -865,9 +871,9 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
|||||||
objectStack);
|
objectStack);
|
||||||
}
|
}
|
||||||
if (updates) {
|
if (updates) {
|
||||||
obj = {node: node, featureNS: options.featureNS,
|
obj = {node: node, 'featureNS': options.featureNS,
|
||||||
featureType: options.featureType, featurePrefix: options.featurePrefix,
|
'featureType': options.featureType, 'featurePrefix': options.featurePrefix,
|
||||||
srsName: options.srsName};
|
'srsName': options.srsName};
|
||||||
ol.object.assign(obj, baseObj);
|
ol.object.assign(obj, baseObj);
|
||||||
ol.xml.pushSerializeAndPop(obj,
|
ol.xml.pushSerializeAndPop(obj,
|
||||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||||
@@ -875,17 +881,17 @@ ol.format.WFS.prototype.writeTransaction = function(inserts, updates, deletes,
|
|||||||
objectStack);
|
objectStack);
|
||||||
}
|
}
|
||||||
if (deletes) {
|
if (deletes) {
|
||||||
ol.xml.pushSerializeAndPop({node: node, featureNS: options.featureNS,
|
ol.xml.pushSerializeAndPop({node: node, 'featureNS': options.featureNS,
|
||||||
featureType: options.featureType, featurePrefix: options.featurePrefix,
|
'featureType': options.featureType, 'featurePrefix': options.featurePrefix,
|
||||||
srsName: options.srsName},
|
'srsName': options.srsName},
|
||||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||||
ol.xml.makeSimpleNodeFactory('Delete'), deletes,
|
ol.xml.makeSimpleNodeFactory('Delete'), deletes,
|
||||||
objectStack);
|
objectStack);
|
||||||
}
|
}
|
||||||
if (options.nativeElements) {
|
if (options.nativeElements) {
|
||||||
ol.xml.pushSerializeAndPop({node: node, featureNS: options.featureNS,
|
ol.xml.pushSerializeAndPop({node: node, 'featureNS': options.featureNS,
|
||||||
featureType: options.featureType, featurePrefix: options.featurePrefix,
|
'featureType': options.featureType, 'featurePrefix': options.featurePrefix,
|
||||||
srsName: options.srsName},
|
'srsName': options.srsName},
|
||||||
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
ol.format.WFS.TRANSACTION_SERIALIZERS_,
|
||||||
ol.xml.makeSimpleNodeFactory('Native'), options.nativeElements,
|
ol.xml.makeSimpleNodeFactory('Native'), options.nativeElements,
|
||||||
objectStack);
|
objectStack);
|
||||||
|
|||||||
Reference in New Issue
Block a user