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
+6 -7
View File
@@ -23,17 +23,16 @@ ol.MapBrowserEvent = function(type, map, browserEvent) {
*/ */
this.browserEvent = browserEvent; this.browserEvent = browserEvent;
/**
* @private
* @type {ol.Coordinate|undefined}
*/
this.coordinate_ = undefined;
}; };
goog.inherits(ol.MapBrowserEvent, ol.MapEvent); goog.inherits(ol.MapBrowserEvent, ol.MapEvent);
/**
* @private
* @type {ol.Coordinate|undefined}
*/
ol.MapBrowserEvent.prototype.coordinate_;
/** /**
* @return {ol.Coordinate|undefined} Coordinate. * @return {ol.Coordinate|undefined} Coordinate.
*/ */
+6 -7
View File
@@ -49,6 +49,12 @@ ol.control.MousePosition =
*/ */
this.undefinedHTML_ = opt_undefinedHTML || ''; this.undefinedHTML_ = opt_undefinedHTML || '';
/**
* @private
* @type {ol.TransformFunction}
*/
this.transform_ = ol.Projection.identityTransform;
goog.events.listen(map, goog.events.listen(map,
ol.Object.getChangedEventType(ol.MapProperty.PROJECTION), ol.Object.getChangedEventType(ol.MapProperty.PROJECTION),
this.handleMapProjectionChanged, false, this); this.handleMapProjectionChanged, false, this);
@@ -65,13 +71,6 @@ ol.control.MousePosition =
goog.inherits(ol.control.MousePosition, ol.Control); goog.inherits(ol.control.MousePosition, ol.Control);
/**
* @private
* @type {ol.TransformFunction}
*/
ol.control.MousePosition.prototype.transform_;
/** /**
* @inheritDoc * @inheritDoc
*/ */
+8 -7
View File
@@ -11,18 +11,19 @@ goog.require('ol.interaction.Drag');
* @param {ol.interaction.Constraints} constraints Constraints. * @param {ol.interaction.Constraints} constraints Constraints.
*/ */
ol.interaction.AltDragRotate = function(constraints) { ol.interaction.AltDragRotate = function(constraints) {
goog.base(this, constraints); goog.base(this, constraints);
/**
* @private
* @type {number}
*/
this.startRotation_ = 0;
}; };
goog.inherits(ol.interaction.AltDragRotate, ol.interaction.Drag); goog.inherits(ol.interaction.AltDragRotate, ol.interaction.Drag);
/**
* @private
* @type {number}
*/
ol.interaction.AltDragRotate.prototype.startRotation_;
/** /**
* @inheritDoc * @inheritDoc
*/ */
+14 -14
View File
@@ -13,25 +13,25 @@ goog.require('ol.interaction.Drag');
* @param {ol.interaction.Constraints} constraints Constraints. * @param {ol.interaction.Constraints} constraints Constraints.
*/ */
ol.interaction.ShiftDragRotateAndZoom = function(constraints) { ol.interaction.ShiftDragRotateAndZoom = function(constraints) {
goog.base(this, 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); 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 * @inheritDoc
*/ */