Don't let button controls interfer with handlers.
This change involves removal of the map's eventsDiv and introduces an OpenLayers.Events.buttonclick component that adds a buttonclick event which makes sure that only events that are not related to clicking a button propagate. This allows button controls to be on the map's viewPortDiv again.
This commit is contained in:
@@ -513,17 +513,8 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
this.viewPortDiv.className = "olMapViewport";
|
||||
this.div.appendChild(this.viewPortDiv);
|
||||
|
||||
// the eventsDiv is where we listen for all map events
|
||||
var eventsDiv = document.createElement("div");
|
||||
eventsDiv.id = this.id + "_events";
|
||||
eventsDiv.style.position = "absolute";
|
||||
eventsDiv.style.width = "100%";
|
||||
eventsDiv.style.height = "100%";
|
||||
eventsDiv.style.zIndex = this.Z_INDEX_BASE.Control - 1;
|
||||
this.viewPortDiv.appendChild(eventsDiv);
|
||||
this.eventsDiv = eventsDiv;
|
||||
this.events = new OpenLayers.Events(
|
||||
this, this.eventsDiv, null, this.fallThrough,
|
||||
this, this.viewPortDiv, null, this.fallThrough,
|
||||
{includeXY: true}
|
||||
);
|
||||
|
||||
@@ -534,7 +525,7 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
this.layerContainerDiv.style.height = '100px';
|
||||
this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;
|
||||
|
||||
this.eventsDiv.appendChild(this.layerContainerDiv);
|
||||
this.viewPortDiv.appendChild(this.layerContainerDiv);
|
||||
|
||||
this.updateSize();
|
||||
if(this.eventListeners instanceof Object) {
|
||||
|
||||
Reference in New Issue
Block a user