Add map user projection getter and setter.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user