From 0646056751f450bb06b5118e2dd9579aebe987a3 Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Fri, 3 Oct 2014 08:57:52 +0200 Subject: [PATCH] Overrides schemaLocation in subclasses --- src/ol/format/gml/base.js | 3 +-- src/ol/format/gml/v2.js | 16 ++++++++++++---- src/ol/format/gml/v3.js | 8 +++++++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/ol/format/gml/base.js b/src/ol/format/gml/base.js index 594cd9c424..13f80f8818 100644 --- a/src/ol/format/gml/base.js +++ b/src/ol/format/gml/base.js @@ -62,8 +62,7 @@ ol.format.GMLBase = function(opt_options) { * @protected * @type {string} */ - this.schemaLocation = goog.isDef(options.schemaLocation) ? - options.schemaLocation : this.constructor.schemaLocation_; + this.schemaLocation = ''; goog.base(this); }; diff --git a/src/ol/format/gml/v2.js b/src/ol/format/gml/v2.js index 4d676977aa..e2c05d5f33 100644 --- a/src/ol/format/gml/v2.js +++ b/src/ol/format/gml/v2.js @@ -18,22 +18,30 @@ goog.require('ol.xml'); * version 2.1.2. * * @constructor - * @param {olx.format.GMLOptions=} opt_options - * Optional configuration object. + * @param {olx.format.GMLOptions=} opt_options Optional configuration object. * @extends {ol.format.GMLBase} * @api */ ol.format.GML2 = function(opt_options) { + var options = /** @type {olx.format.GMLOptions} */ + (goog.isDef(opt_options) ? opt_options : {}); + + goog.base(this, options); + + /** + * @inheritDoc + */ + this.schemaLocation = goog.isDef(options.schemaLocation) ? + options.schemaLocation : ol.format.GML2.schemaLocation_; - goog.base(this, opt_options); }; goog.inherits(ol.format.GML2, ol.format.GMLBase); /** * @const - * @private * @type {string} + * @private */ ol.format.GML2.schemaLocation_ = 'http://www.opengis.net/gml ' + 'http://schemas.opengis.net/gml/2.1.2/feature.xsd'; diff --git a/src/ol/format/gml/v3.js b/src/ol/format/gml/v3.js index 79534e49cb..b6bd645bd2 100644 --- a/src/ol/format/gml/v3.js +++ b/src/ol/format/gml/v3.js @@ -39,6 +39,8 @@ ol.format.GML3 = function(opt_options) { var options = /** @type {olx.format.GMLOptions} */ (goog.isDef(opt_options) ? opt_options : {}); + goog.base(this, options); + /** * @private * @type {boolean} @@ -67,8 +69,12 @@ ol.format.GML3 = function(opt_options) { this.multiSurface_ = goog.isDef(options.multiSurface) ? options.multiSurface : true; + /** + * @inheritDoc + */ + this.schemaLocation = goog.isDef(options.schemaLocation) ? + options.schemaLocation : ol.format.GML3.schemaLocation_; - goog.base(this, opt_options); }; goog.inherits(ol.format.GML3, ol.format.GMLBase);