Make map handle background color changes
This commit is contained in:
@@ -287,6 +287,9 @@ ol.Map = function(mapOptions) {
|
|||||||
this.handleViewChanged_, false, this);
|
this.handleViewChanged_, false, this);
|
||||||
goog.events.listen(this, ol.Object.getChangedEventType(ol.MapProperty.SIZE),
|
goog.events.listen(this, ol.Object.getChangedEventType(ol.MapProperty.SIZE),
|
||||||
this.handleSizeChanged_, false, this);
|
this.handleSizeChanged_, false, this);
|
||||||
|
goog.events.listen(
|
||||||
|
this, ol.Object.getChangedEventType(ol.MapProperty.BACKGROUND_COLOR),
|
||||||
|
this.handleBackgroundColorChanged_, false, this),
|
||||||
this.setValues(mapOptionsInternal.values);
|
this.setValues(mapOptionsInternal.values);
|
||||||
|
|
||||||
// this gives the map an initial size
|
// this gives the map an initial size
|
||||||
@@ -561,6 +564,14 @@ ol.Map.prototype.handlePostRender = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
ol.Map.prototype.handleBackgroundColorChanged_ = function() {
|
||||||
|
this.render();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -76,14 +76,6 @@ ol.renderer.canvas.Map.prototype.getCanvas = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
ol.renderer.canvas.Map.prototype.handleBackgroundColorChanged = function() {
|
|
||||||
this.getMap().render();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {goog.events.Event} event Event.
|
* @param {goog.events.Event} event Event.
|
||||||
* @protected
|
* @protected
|
||||||
|
|||||||
@@ -52,10 +52,6 @@ ol.renderer.Map = function(container, map) {
|
|||||||
* @type {Array.<number>}
|
* @type {Array.<number>}
|
||||||
*/
|
*/
|
||||||
this.mapListenerKeys_ = [
|
this.mapListenerKeys_ = [
|
||||||
goog.events.listen(
|
|
||||||
map, ol.Object.getChangedEventType(ol.MapProperty.BACKGROUND_COLOR),
|
|
||||||
this.handleBackgroundColorChanged, false, this),
|
|
||||||
|
|
||||||
goog.events.listen(
|
goog.events.listen(
|
||||||
map, ol.Object.getChangedEventType(ol.MapProperty.LAYERS),
|
map, ol.Object.getChangedEventType(ol.MapProperty.LAYERS),
|
||||||
this.handleLayersChanged, false, this)
|
this.handleLayersChanged, false, this)
|
||||||
@@ -157,12 +153,6 @@ ol.renderer.Map.prototype.getMap = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle background color changed.
|
|
||||||
*/
|
|
||||||
ol.renderer.Map.prototype.handleBackgroundColorChanged = goog.nullFunction;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.CollectionEvent} collectionEvent Collection event.
|
* @param {ol.CollectionEvent} collectionEvent Collection event.
|
||||||
* @protected
|
* @protected
|
||||||
|
|||||||
@@ -409,14 +409,6 @@ ol.renderer.webgl.Map.prototype.getShader = function(shaderObject) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
ol.renderer.webgl.Map.prototype.handleBackgroundColorChanged = function() {
|
|
||||||
this.getMap().render();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {goog.events.Event} event Event.
|
* @param {goog.events.Event} event Event.
|
||||||
* @protected
|
* @protected
|
||||||
|
|||||||
Reference in New Issue
Block a user