Add map user projection getter and setter.

This commit is contained in:
Tom Payne
2012-06-19 12:43:54 +02:00
parent ef83910c3d
commit 7958e02bd0

View File

@@ -4,6 +4,7 @@ goog.require('ol.Loc');
goog.require('ol.Map');
goog.require('ol.Projection');
goog.require('ol.loc');
goog.require('ol.projection');
/**
@@ -58,3 +59,27 @@ ol.Map.prototype.center = function(opt_arg) {
return this.getCenter();
}
};
/**
* @param {ol.ProjectionLike=} opt_arg
* @returns {ol.Map|ol.Loc|undefined}
*/
ol.Map.prototype.projection = function(opt_arg) {
if (arguments.length == 1 && goog.isDef(opt_arg)) {
return this.setProjection(ol.projection(opt_arg));
} else {
return this.getProjection();
}
};
/**
* @param {ol.ProjectionLike=} opt_arg
* @returns {ol.Map|ol.Loc|undefined}
*/
ol.Map.prototype.userProjection = function(opt_arg) {
if (arguments.length == 1 && goog.isDef(opt_arg)) {
return this.setUserProjection(ol.projection(opt_arg));
} else {
return this.getUserProjection();
}
};