Use ol.object.assign to update config properties in ol.source.CartoDB

This commit is contained in:
Frederic Junod
2016-04-04 12:42:08 +02:00
parent 02d262e387
commit a42d76d69d

View File

@@ -1,5 +1,6 @@
goog.provide('ol.source.CartoDB');
goog.require('ol.object');
goog.require('ol.source.State');
goog.require('ol.source.XYZ');
@@ -28,7 +29,7 @@ ol.source.CartoDB = function(options) {
this.mapId_ = options.map || '';
/**
* @type {Object}
* @type {!Object}
* @private
*/
this.config_ = options.config || {};
@@ -57,7 +58,7 @@ goog.inherits(ol.source.CartoDB, ol.source.XYZ);
/**
* Returns the current config.
* @return {Object} The current configuration.
* @return {!Object} The current configuration.
* @api
*/
ol.source.CartoDB.prototype.getConfig = function() {
@@ -72,9 +73,7 @@ ol.source.CartoDB.prototype.getConfig = function() {
* @api
*/
ol.source.CartoDB.prototype.updateConfig = function(config) {
for (var key in config) {
this.config_[key] = config[key];
}
ol.object.assign(this.config_, config);
this.initializeMap_();
};