Don't clone center or extent
This commit is contained in:
+2
-5
@@ -124,9 +124,7 @@ ol.Map.prototype.forEachLayerRenderer = function(f, opt_obj) {
|
|||||||
* @return {goog.math.Coordinate|undefined} Center.
|
* @return {goog.math.Coordinate|undefined} Center.
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getCenter = function() {
|
ol.Map.prototype.getCenter = function() {
|
||||||
var center = /** @type {goog.math.Coordinate} */ (
|
return /** @type {goog.math.Coordinate} */ (this.get(ol.MapProperty.CENTER));
|
||||||
this.get(ol.MapProperty.CENTER));
|
|
||||||
return goog.isDef(center) ? center.clone() : undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -134,8 +132,7 @@ ol.Map.prototype.getCenter = function() {
|
|||||||
* @return {ol.Extent|undefined} Extent.
|
* @return {ol.Extent|undefined} Extent.
|
||||||
*/
|
*/
|
||||||
ol.Map.prototype.getExtent = function() {
|
ol.Map.prototype.getExtent = function() {
|
||||||
var extent = /** @type {ol.Extent} */ (this.get(ol.MapProperty.EXTENT));
|
return /** @type {ol.Extent} */ (this.get(ol.MapProperty.EXTENT));
|
||||||
return goog.isDef(extent) ? extent.clone() : undefined;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user