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
+1 -2
View File
@@ -62,8 +62,7 @@ ol.format.GMLBase = function(opt_options) {
* @protected * @protected
* @type {string} * @type {string}
*/ */
this.schemaLocation = goog.isDef(options.schemaLocation) ? this.schemaLocation = '';
options.schemaLocation : this.constructor.schemaLocation_;
goog.base(this); goog.base(this);
}; };
+12 -4
View File
@@ -18,22 +18,30 @@ goog.require('ol.xml');
* version 2.1.2. * version 2.1.2.
* *
* @constructor * @constructor
* @param {olx.format.GMLOptions=} opt_options * @param {olx.format.GMLOptions=} opt_options Optional configuration object.
* Optional configuration object.
* @extends {ol.format.GMLBase} * @extends {ol.format.GMLBase}
* @api * @api
*/ */
ol.format.GML2 = function(opt_options) { 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); goog.inherits(ol.format.GML2, ol.format.GMLBase);
/** /**
* @const * @const
* @private
* @type {string} * @type {string}
* @private
*/ */
ol.format.GML2.schemaLocation_ = 'http://www.opengis.net/gml ' + ol.format.GML2.schemaLocation_ = 'http://www.opengis.net/gml ' +
'http://schemas.opengis.net/gml/2.1.2/feature.xsd'; 'http://schemas.opengis.net/gml/2.1.2/feature.xsd';
+7 -1
View File
@@ -39,6 +39,8 @@ ol.format.GML3 = function(opt_options) {
var options = /** @type {olx.format.GMLOptions} */ var options = /** @type {olx.format.GMLOptions} */
(goog.isDef(opt_options) ? opt_options : {}); (goog.isDef(opt_options) ? opt_options : {});
goog.base(this, options);
/** /**
* @private * @private
* @type {boolean} * @type {boolean}
@@ -67,8 +69,12 @@ ol.format.GML3 = function(opt_options) {
this.multiSurface_ = goog.isDef(options.multiSurface) ? this.multiSurface_ = goog.isDef(options.multiSurface) ?
options.multiSurface : true; 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); goog.inherits(ol.format.GML3, ol.format.GMLBase);