Rename olx.View2DState to olx.ViewState and use viewState property

This commit is contained in:
Tim Schaub
2014-06-26 16:38:11 -04:00
parent 2e88f911dd
commit b9f444a008
27 changed files with 146 additions and 146 deletions

View File

@@ -77,9 +77,9 @@ ol.control.ScaleLine = function(opt_options) {
/**
* @private
* @type {?olx.View2DState}
* @type {?olx.ViewState}
*/
this.view2DState_ = null;
this.viewState_ = null;
/**
* @private
@@ -156,9 +156,9 @@ goog.exportProperty(
ol.control.ScaleLine.prototype.handleMapPostrender = function(mapEvent) {
var frameState = mapEvent.frameState;
if (goog.isNull(frameState)) {
this.view2DState_ = null;
this.viewState_ = null;
} else {
this.view2DState_ = frameState.view2DState;
this.viewState_ = frameState.viewState;
}
this.updateElement_();
};
@@ -190,9 +190,9 @@ goog.exportProperty(
* @private
*/
ol.control.ScaleLine.prototype.updateElement_ = function() {
var view2DState = this.view2DState_;
var viewState = this.viewState_;
if (goog.isNull(view2DState)) {
if (goog.isNull(viewState)) {
if (this.renderedVisible_) {
goog.style.setElementShown(this.element_, false);
this.renderedVisible_ = false;
@@ -200,10 +200,10 @@ ol.control.ScaleLine.prototype.updateElement_ = function() {
return;
}
var center = view2DState.center;
var projection = view2DState.projection;
var center = viewState.center;
var projection = viewState.projection;
var pointResolution =
projection.getPointResolution(view2DState.resolution, center);
projection.getPointResolution(viewState.resolution, center);
var projectionUnits = projection.getUnits();
var cosLatitude;