Overrides schemaLocation in subclasses

This commit is contained in:
Florent gravin
2014-10-03 08:57:52 +02:00
parent 678c66f50c
commit 0646056751
3 changed files with 20 additions and 7 deletions

View File

@@ -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);
};

View File

@@ -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';

View File

@@ -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);