OpenLayers.Events.buttonclick - OpenLayers

# OpenLayers.Events.buttonclick

Extension event type for handling buttons on top of a dom element. This event type fires “buttonclick” on its target when a button was clicked. Buttons are detected by the “olButton” class.

This event type makes sure that button clicks do not interfere with other events that are registered on the same element.

#### Event types provided by this extension

- buttonclick Triggered when a button is clicked. Listeners receive an object with a buttonElement property referencing the dom element of the clicked button, and an buttonXY property with the click position relative to the button.

Summary

OpenLayers.Events.buttonclick | Extension event type for handling buttons on top of a dom element.
Properties |
target | {OpenLayers.Events} The events instance that the buttonclick event will be triggered on.
events | {Array} Events to observe and conditionally stop from propagating when an element with the olButton class (or its olAlphaImg child) is clicked.
startRegEx | {RegExp} Regular expression to test Event.type for events that start a buttonclick sequence.
cancelRegEx | {RegExp} Regular expression to test Event.type for events that cancel a buttonclick sequence.
completeRegEx | {RegExp} Regular expression to test Event.type for events that complete a buttonclick sequence.
startEvt | {Event} The event that started the click sequence
Constructor |
OpenLayers.Events.buttonclick | Construct a buttonclick event type.
Functions |
destroy |
getPressedButton | Get the pressed button, if any.
ignore | Check for event target elements that should be ignored by OpenLayers.
buttonClick | Check if a button was clicked, and fire the buttonclick event

### Properties

### target

{OpenLayers.Events} The events instance that the buttonclick event will be triggered on.

### events

{Array} Events to observe and conditionally stop from propagating when an element with the olButton class (or its olAlphaImg child) is clicked.

### startRegEx

{RegExp} Regular expression to test Event.type for events that start a buttonclick sequence.

### cancelRegEx

{RegExp} Regular expression to test Event.type for events that cancel a buttonclick sequence.

### completeRegEx

{RegExp} Regular expression to test Event.type for events that complete a buttonclick sequence.

### startEvt

{Event} The event that started the click sequence

### Constructor

### OpenLayers.Events.buttonclick

Construct a buttonclick event type. Applications are not supposed to create instances of this class - they are created on demand by OpenLayers.Events instances.

#### Parameters

target | {OpenLayers.Events} The events instance that the buttonclick event will be triggered on.

### Functions

### destroy

> destroy: function()

### getPressedButton

> getPressedButton: function( | element | )

Get the pressed button, if any. Returns undefined if no button was pressed.

#### Arguments

element | {DOMElement} The event target.

#### Returns

{DOMElement} The button element, or undefined.

### ignore

> ignore: function( | element | )

Check for event target elements that should be ignored by OpenLayers.

#### Parameters

element | {DOMElement} The event target.

### buttonClick

> buttonClick: function( | evt | )

Check if a button was clicked, and fire the buttonclick event

#### Parameters

evt | {Event}

> destroy: function()

> getPressedButton: function( | element | )

Get the pressed button, if any.

> ignore: function( | element | )

Check for event target elements that should be ignored by OpenLayers.

> buttonClick: function( | evt | )

Check if a button was clicked, and fire the buttonclick event
{OpenLayers.Events} The events instance that the buttonclick event will be triggered on.
{DOMElement} the DOM element receiving browser events
Close