Less magic.

Each control is responsible for its handlers. And all controls are rendered into an overlay, not any more depending on assumptions about link click handling.
This commit is contained in:
ahocevar
2012-06-29 09:44:52 +02:00
parent f28fe4912f
commit 578f74eb86
3 changed files with 26 additions and 14 deletions

View File

@@ -50,9 +50,9 @@ ol.control.Zoom.prototype.setMap = function(map) {
);
goog.dom.append(container, inButton, outButton);
var viewport = /** @type {Node} */ map.getViewport();
if (goog.isDefAndNotNull(viewport)) {
goog.dom.append(viewport, container);
var overlay = map.getStaticOverlay();
if (goog.isDefAndNotNull(overlay)) {
goog.dom.append(overlay, container);
}
};
@@ -106,7 +106,7 @@ ol.control.Zoom.prototype.handle = function(evt) {
ol.control.Zoom.prototype.destroy = function() {
goog.dom.removeNode(goog.dom.getElementByClass(
ol.control.Zoom.RES.CLS,
/** @type {Element} */ (this.map_.getViewport())
/** @type {Element} */ (this.map_.getStaticOverlay())
));
goog.base(this, 'destroy');
};