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

@@ -109,8 +109,8 @@ ol.control.MousePosition.prototype.handleMapPostrender = function(mapEvent) {
if (goog.isNull(frameState)) {
this.mapProjection_ = null;
} else {
if (this.mapProjection_ != frameState.view2DState.projection) {
this.mapProjection_ = frameState.view2DState.projection;
if (this.mapProjection_ != frameState.viewState.projection) {
this.mapProjection_ = frameState.viewState.projection;
this.transform_ = null;
}
}

View File

@@ -145,7 +145,7 @@ ol.control.Rotate.prototype.handleMapPostrender = function(mapEvent) {
if (goog.isNull(frameState)) {
return;
}
var rotation = frameState.view2DState.rotation;
var rotation = frameState.viewState.rotation;
var transform = 'rotate(' + rotation * 360 / (Math.PI * 2) + 'deg)';
if (this.autoHide_) {
this.element.style.opacity = (rotation === 0) ? 0 : 1;

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;

View File

@@ -158,11 +158,11 @@ ol.control.ZoomSlider.prototype.handleMapPostrender = function(mapEvent) {
return;
}
goog.asserts.assert(
goog.isDefAndNotNull(mapEvent.frameState.view2DState));
goog.isDefAndNotNull(mapEvent.frameState.viewState));
if (!this.sliderInitialized_) {
this.initSlider_();
}
var res = mapEvent.frameState.view2DState.resolution;
var res = mapEvent.frameState.viewState.resolution;
if (res !== this.currentResolution_) {
this.currentResolution_ = res;
this.positionThumbForResolution_(res);