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:
@@ -103,10 +103,10 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, {
|
||||
this.zoomBox.className = this.boxDivClassName;
|
||||
this.zoomBox.style.zIndex = this.map.Z_INDEX_BASE["Popup"] - 1;
|
||||
|
||||
this.map.eventsDiv.appendChild(this.zoomBox);
|
||||
this.map.viewPortDiv.appendChild(this.zoomBox);
|
||||
|
||||
OpenLayers.Element.addClass(
|
||||
this.map.eventsDiv, "olDrawBox"
|
||||
this.map.viewPortDiv, "olDrawBox"
|
||||
);
|
||||
},
|
||||
|
||||
@@ -154,11 +154,11 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* Remove the zoombox from the screen and nullify our reference to it.
|
||||
*/
|
||||
removeBox: function() {
|
||||
this.map.eventsDiv.removeChild(this.zoomBox);
|
||||
this.map.viewPortDiv.removeChild(this.zoomBox);
|
||||
this.zoomBox = null;
|
||||
this.boxOffsets = null;
|
||||
OpenLayers.Element.removeClass(
|
||||
this.map.eventsDiv, "olDrawBox"
|
||||
this.map.viewPortDiv, "olDrawBox"
|
||||
);
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user