Do not extend the instance with options

This commit is contained in:
ahocevar
2013-05-16 14:37:40 +02:00
parent c245794e56
commit 1929403cda
+9 -15
View File
@@ -45,22 +45,16 @@ goog.require('ol.style.PolygonLiteral');
* @extends {ol.parser.XML} * @extends {ol.parser.XML}
*/ */
ol.parser.KML = function(opt_options) { ol.parser.KML = function(opt_options) {
if (goog.isDef(opt_options)) { var options = /** @type {ol.parser.KMLOptions} */
goog.object.extend(this, opt_options); (goog.isDef(opt_options) ? opt_options : {});
} this.extractAttributes = goog.isDef(options.extractAttributes) ?
if (!goog.isDef(this.extractAttributes)) { options.extractAttributes : true;
this.extractAttributes = true; this.extractStyles = goog.isDef(options.extractStyles) ?
} options.extractStyles : false;
if (!goog.isDef(this.extractStyles)) {
this.extractStyles = false;
}
// TODO re-evaluate once shared structures support 3D // TODO re-evaluate once shared structures support 3D
if (!goog.isDef(this.dimension)) { this.dimension = goog.isDef(options.dimension) ? options.dimension : 3;
this.dimension = 3; this.maxDepth = goog.isDef(options.maxDepth) ? options.maxDepth : 0;
}
if (!goog.isDef(this.maxDepth)) {
this.maxDepth = 0;
}
this.defaultNamespaceURI = 'http://www.opengis.net/kml/2.2'; this.defaultNamespaceURI = 'http://www.opengis.net/kml/2.2';
this.readers = { this.readers = {
'http://www.opengis.net/kml/2.2': { 'http://www.opengis.net/kml/2.2': {