Fix non-view-related typecasts in ol.control.Attribution
This commit is contained in:
@@ -169,7 +169,7 @@ ol.control.Attribution.prototype.getLayerAttributionVisiblities_ =
|
|||||||
|
|
||||||
var mapZ;
|
var mapZ;
|
||||||
if (source instanceof ol.source.TileSource) {
|
if (source instanceof ol.source.TileSource) {
|
||||||
var tileSource = /** @type {ol.source.TileSource} */ source;
|
var tileSource = /** @type {ol.source.TileSource} */ (source);
|
||||||
var tileGrid = tileSource.getTileGrid();
|
var tileGrid = tileSource.getTileGrid();
|
||||||
mapZ = tileGrid.getZForResolution(mapResolution);
|
mapZ = tileGrid.getZForResolution(mapResolution);
|
||||||
}
|
}
|
||||||
@@ -230,7 +230,7 @@ ol.control.Attribution.prototype.getLayerAttributionVisiblities_ =
|
|||||||
* @param {goog.events.Event} event Event.
|
* @param {goog.events.Event} event Event.
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.handleLayerLoad = function(event) {
|
ol.control.Attribution.prototype.handleLayerLoad = function(event) {
|
||||||
var layer = /** @type {ol.layer.Layer} */ event.target;
|
var layer = /** @type {ol.layer.Layer} */ (event.target);
|
||||||
this.createAttributionElementsForLayer_(layer);
|
this.createAttributionElementsForLayer_(layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ ol.control.Attribution.prototype.handleLayerVisibleChanged = function(event) {
|
|||||||
var mapProjection = /** @type {ol.Projection} */ map.getProjection();
|
var mapProjection = /** @type {ol.Projection} */ map.getProjection();
|
||||||
var mapResolution = /** @type {number} */ map.getResolution();
|
var mapResolution = /** @type {number} */ map.getResolution();
|
||||||
|
|
||||||
var layer = /** @type {ol.layer.Layer} */ event.target;
|
var layer = /** @type {ol.layer.Layer} */ (event.target);
|
||||||
|
|
||||||
this.updateLayerAttributionsVisibility_(
|
this.updateLayerAttributionsVisibility_(
|
||||||
layer, mapIsDef, mapExtent, mapResolution, mapProjection);
|
layer, mapIsDef, mapExtent, mapResolution, mapProjection);
|
||||||
@@ -260,7 +260,7 @@ ol.control.Attribution.prototype.handleLayerVisibleChanged = function(event) {
|
|||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.handleLayersAdd = function(collectionEvent) {
|
ol.control.Attribution.prototype.handleLayersAdd = function(collectionEvent) {
|
||||||
var layer = /** @type {ol.layer.Layer} */ collectionEvent.elem;
|
var layer = /** @type {ol.layer.Layer} */ (collectionEvent.elem);
|
||||||
this.addLayer(layer);
|
this.addLayer(layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ ol.control.Attribution.prototype.handleLayersAdd = function(collectionEvent) {
|
|||||||
*/
|
*/
|
||||||
ol.control.Attribution.prototype.handleLayersRemove =
|
ol.control.Attribution.prototype.handleLayersRemove =
|
||||||
function(collectionEvent) {
|
function(collectionEvent) {
|
||||||
var layer = /** @type {ol.layer.Layer} */ collectionEvent.elem;
|
var layer = /** @type {ol.layer.Layer} */ (collectionEvent.elem);
|
||||||
this.removeLayer(layer);
|
this.removeLayer(layer);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user