Initialize all member variables in constructor

This commit is contained in:
Tom Payne
2012-08-14 18:21:45 +02:00
parent a43cd15b27
commit 4f2b6a0c22
4 changed files with 34 additions and 35 deletions

View File

@@ -23,17 +23,16 @@ ol.MapBrowserEvent = function(type, map, browserEvent) {
*/
this.browserEvent = browserEvent;
/**
* @private
* @type {ol.Coordinate|undefined}
*/
this.coordinate_ = undefined;
};
goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
/**
* @private
* @type {ol.Coordinate|undefined}
*/
ol.MapBrowserEvent.prototype.coordinate_;
/**
* @return {ol.Coordinate|undefined} Coordinate.
*/

View File

@@ -49,6 +49,12 @@ ol.control.MousePosition =
*/
this.undefinedHTML_ = opt_undefinedHTML || '';
/**
* @private
* @type {ol.TransformFunction}
*/
this.transform_ = ol.Projection.identityTransform;
goog.events.listen(map,
ol.Object.getChangedEventType(ol.MapProperty.PROJECTION),
this.handleMapProjectionChanged, false, this);
@@ -65,13 +71,6 @@ ol.control.MousePosition =
goog.inherits(ol.control.MousePosition, ol.Control);
/**
* @private
* @type {ol.TransformFunction}
*/
ol.control.MousePosition.prototype.transform_;
/**
* @inheritDoc
*/

View File

@@ -11,18 +11,19 @@ goog.require('ol.interaction.Drag');
* @param {ol.interaction.Constraints} constraints Constraints.
*/
ol.interaction.AltDragRotate = function(constraints) {
goog.base(this, constraints);
/**
* @private
* @type {number}
*/
this.startRotation_ = 0;
};
goog.inherits(ol.interaction.AltDragRotate, ol.interaction.Drag);
/**
* @private
* @type {number}
*/
ol.interaction.AltDragRotate.prototype.startRotation_;
/**
* @inheritDoc
*/

View File

@@ -13,25 +13,25 @@ goog.require('ol.interaction.Drag');
* @param {ol.interaction.Constraints} constraints Constraints.
*/
ol.interaction.ShiftDragRotateAndZoom = function(constraints) {
goog.base(this, constraints);
/**
* @private
* @type {number}
*/
this.startRatio_ = 0;
/**
* @private
* @type {number}
*/
this.startRotation_ = 0;
};
goog.inherits(ol.interaction.ShiftDragRotateAndZoom, ol.interaction.Drag);
/**
* @private
* @type {number}
*/
ol.interaction.ShiftDragRotateAndZoom.prototype.startRatio_;
/**
* @private
* @type {number}
*/
ol.interaction.ShiftDragRotateAndZoom.prototype.startRotation_;
/**
* @inheritDoc
*/