Introducing ol.overlay.Overlay and an overlayContainer

ol.overlay.Overlay can be used to bind DOM elements to a
coordinate on the map. It has positioning options to support
e.g. popups or image markers that have an anchor at the bottom
and an unknown size.

The overlayContainer stops propagation on mousedown and
touchstart events, so clicks and gestures on overlays don't
trigger any MapBrowserEvent. To make this work reliably, we now
only fire dblclick in mapbrowserevent.js when there was a
previous mousedown or touchstart. The default container for
controls is now the overlayContainer.
This commit is contained in:
ahocevar
2012-09-28 13:01:56 +02:00
parent a46e251eb2
commit 3d62b67172
9 changed files with 225 additions and 22 deletions

View File

@@ -151,7 +151,8 @@ ol.renderer.webgl.Map = function(container, map) {
this.canvas_ = goog.dom.createElement(goog.dom.TagName.CANVAS);
this.canvas_.height = container.clientHeight;
this.canvas_.width = container.clientWidth;
goog.dom.appendChild(container, this.canvas_);
this.canvas_.className = 'ol-unselectable';
goog.dom.insertChildAt(container, this.canvas_, 0);
/**
* @private