From 0c9b3d1d58c5e0bde4243d123c90a2d6cf97bd1e Mon Sep 17 00:00:00 2001 From: ahocevar Date: Sun, 24 Jun 2012 11:39:42 +0200 Subject: [PATCH] Making map_ protected instead of private. --- src/ol/control/Control.js | 2 +- src/ol/control/Navigation.js | 8 ++++---- src/ol/control/Zoom.js | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ol/control/Control.js b/src/ol/control/Control.js index b2b3502848..f19b437060 100644 --- a/src/ol/control/Control.js +++ b/src/ol/control/Control.js @@ -23,7 +23,7 @@ ol.control.Control = function(opt_autoActivate) { /** * @type {ol.Map} map - * @private + * @protected */ this.map_ = null; diff --git a/src/ol/control/Navigation.js b/src/ol/control/Navigation.js index b17b9f0e21..bbf89642fc 100644 --- a/src/ol/control/Navigation.js +++ b/src/ol/control/Navigation.js @@ -27,7 +27,7 @@ goog.inherits(ol.control.Navigation, ol.control.Control); ol.control.Navigation.prototype.activate = function() { var active = goog.base(this, 'activate'); if (active) { - var events = this.getMap().getEvents(); + var events = this.map_.getEvents(); events.register("drag", this.moveMap, this); events.register("scroll", this.zoomMap, this); } @@ -38,7 +38,7 @@ ol.control.Navigation.prototype.activate = function() { ol.control.Navigation.prototype.deactivate = function() { var inactive = goog.base(this, 'deactivate'); if (inactive) { - var events = this.getMap().getEvents(); + var events = this.map_.getEvents(); events.unregister("drag", this.moveMap, this); events.unregister("scroll", this.zoomMap, this); } @@ -49,7 +49,7 @@ ol.control.Navigation.prototype.deactivate = function() { * @param {Object} evt */ ol.control.Navigation.prototype.moveMap = function(evt) { - this.getMap().moveByPx(evt.deltaX, evt.deltaY); + this.map_.moveByPx(evt.deltaX, evt.deltaY); return false; }; @@ -57,7 +57,7 @@ ol.control.Navigation.prototype.moveMap = function(evt) { * @param {Event} evt */ ol.control.Navigation.prototype.zoomMap = function(evt) { - var map = this.getMap(), + var map = this.map_, delta = ((evt.deltaY / 3) | 0); if (Math.abs(delta) === 0) { return; diff --git a/src/ol/control/Zoom.js b/src/ol/control/Zoom.js index 214a255721..84f38bc38e 100644 --- a/src/ol/control/Zoom.js +++ b/src/ol/control/Zoom.js @@ -58,7 +58,7 @@ ol.control.Zoom.prototype.setMap = function(map) { ol.control.Zoom.prototype.activate = function() { var active = goog.base(this, 'activate'); if (active) { - this.getMap().getEvents().register("click", this.handle, this); + this.map_.getEvents().register("click", this.handle, this); } return active; }; @@ -67,7 +67,7 @@ ol.control.Zoom.prototype.activate = function() { ol.control.Zoom.prototype.deactivate = function() { var inactive = goog.base(this, 'deactivate'); if (inactive) { - this.getMap().getEvents().unregister("click", this.handle, this); + this.map_.getEvents().unregister("click", this.handle, this); } return inactive; }; @@ -79,11 +79,11 @@ ol.control.Zoom.prototype.handle = function(evt) { var target = /** @type {Node} */ (evt.target), handled = false; if (goog.dom.getAncestorByClass(target, ol.control.Zoom.RES.IN_CLS)) { - this.getMap().zoomIn(); + this.map_.zoomIn(); handled = true; } else if (goog.dom.getAncestorByClass(target, ol.control.Zoom.RES.OUT_CLS)) { - this.getMap().zoomOut(); + this.map_.zoomOut(); handled = true; } if (handled) {