Add 'undefined' return type for all get* functions

This commit is contained in:
Frederic Junod
2013-02-06 11:00:55 +01:00
parent a679bb7bef
commit 753b37ad47
+11 -8
View File
@@ -65,11 +65,14 @@ ol.Geolocation.prototype.disposeInternal = function() {
* @private * @private
*/ */
ol.Geolocation.prototype.handleProjectionChanged_ = function() { ol.Geolocation.prototype.handleProjectionChanged_ = function() {
this.transformCoords_ = ol.Projection.getTransform( var projection = this.getProjection();
ol.Projection.getFromCode('EPSG:4326'), this.getProjection()); if (goog.isDefAndNotNull(projection)) {
if (!goog.isNull(this.position_)) { this.transformCoords_ = ol.Projection.getTransform(
this.set(ol.GeolocationProperty.POSITION, ol.Projection.getFromCode('EPSG:4326'), projection);
this.transformCoords_(this.position_)); if (!goog.isNull(this.position_)) {
this.set(ol.GeolocationProperty.POSITION,
this.transformCoords_(this.position_));
}
} }
}; };
@@ -97,7 +100,7 @@ ol.Geolocation.prototype.positionError_ = function(error) {
/** /**
* The position of the device. * The position of the device.
* @return {ol.Coordinate} position. * @return {ol.Coordinate|undefined} position.
*/ */
ol.Geolocation.prototype.getPosition = function() { ol.Geolocation.prototype.getPosition = function() {
return /** @type {ol.Coordinate} */ ( return /** @type {ol.Coordinate} */ (
@@ -111,7 +114,7 @@ goog.exportProperty(
/** /**
* The accuracy of the position in meters. * The accuracy of the position in meters.
* @return {number} accuracy. * @return {number|undefined} accuracy.
*/ */
ol.Geolocation.prototype.getAccuracy = function() { ol.Geolocation.prototype.getAccuracy = function() {
return /** @type {number} */ ( return /** @type {number} */ (
@@ -124,7 +127,7 @@ goog.exportProperty(
/** /**
* @return {ol.Projection} projection. * @return {ol.Projection|undefined} projection.
*/ */
ol.Geolocation.prototype.getProjection = function() { ol.Geolocation.prototype.getProjection = function() {
return /** @type {ol.Projection} */ ( return /** @type {ol.Projection} */ (