Ovi Maps API Reference

Contents

Interface ovi.mapsapi.dom.MouseEventTarget

Interface Summary

This class is a virtual interface that does only exist for documentational purpose. Each class implementing this interface will delcare that it is able to be the target of certain events. Each event in this interface (and therefore as well within the class implementing that interface) describes an event of a specific type.

The following example will show event handling at the example of an event of the type click:

// Note that "obj" can be either a DOM node or any other JavaScript object.
var obj = ovi.mapsapi.dom.EventTarget( {} );
obj.addListener("click", function(evt) {
	console.log("This is the '"+evt.type+"' event!");
});
obj.dispatch( new ovi.mapsapi.dom.Event({
	type: "click"
});
As you can see the event click doesn't mean that there is a method click that is called, but rather that an event of the type click is fired and dispatched to all listeners registered with the object that is the target of the event.

For more information about event dispatching please read the documentation of the ovi.mapsapi.dom.EventTarget class!

Events
click(evt)
Fired after a mousedown/mouseup sequence at the same target happend.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
dblclick(evt)
Fired after two click events have been fired within a certain time period.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
longpress(evt)
Fired after a mouse button has been pressed for a certain amount of time without that a drag was started.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mousedown(evt)
Fired if a mouse button has been pressed.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mouseenter(evt)
Fired if the mouse cursor enters the visible area of a node, fired at the node that is entered.

The difference of the mouseenter and mouseleave events compared to the mouseover and mouseout events is, that there can be multiple mouseenter events without even one mouseleave event. This happens e.g. if you have a DIV tag of a size of 100x100 pixel which contains an centered image with a size of 50x50 pixel. When the mousecursor enters the outer DIV tag it receive a mouseover and a mouseenter event (note that the order is not guaranteed). However, if the mouse cursor is moved forward into the image now the outer DIV tag will receive a mouseout event, because the visual area of the outer DIV is left and the image will receive a mouseover event, because the visial area of the image is entered. Additionally the image will receive a mouseenter event, but the outer DIV will not receive an mouseleave event, because the physical area of the outer DIV tag is not left.

Therefore mouseenter and mouseleave events are e.g. very helpfull to build tooltips which are going to apear right below the mouse cursor or to show overlay information as long as the mouse cursor is above a specific area that contains child nodes.

Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mouseleave(evt)
Fired if the mouse cursor leave the physical area of a node, fired at the node that is left.

The difference of the mouseenter and mouseleave events compared to the mouseover and mouseout events is, that there can be multiple mouseenter events without even one mouseleave event. This happens e.g. if you have a DIV tag of a size of 100x100 pixel which contains an centered image with a size of 50x50 pixel. When the mousecursor enters the outer DIV tag it receive a mouseover and a mouseenter event (note that the order is not guaranteed). However, if the mouse cursor is moved forward into the image now the outer DIV tag will receive a mouseout event, because the visual area of the outer DIV is left and the image will receive a mouseover event, because the visial area of the image is entered. Additionally the image will receive a mouseenter event, but the outer DIV will not receive an mouseleave event, because the physical area of the outer DIV tag is not left.

Therefore mouseenter and mouseleave events are e.g. very helpfull to build tooltips which are going to apear right below the mouse cursor or to show overlay information as long as the mouse cursor is above a specific area that contains child nodes.

Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mousemove(evt)
Fired if the mouse is moved.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mouseout(evt)
Fired if the mouse cursor leaves the visible area of a node, fired at the node that is left.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mouseover(evt)
Fired if the mouse cursor enters the visible area of a node, fired at the node that is entered.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mouseup(evt)
Fired if a mouse button has been released.
Parameters:
{ovi.mapsapi.dom.MouseEvent} evt The event object of this event.
mousewheel(evt)
Fired if the mousewheel is moved.
Parameters:
{ovi.mapsapi.dom.WheelEvent} evt The event object of this event.
Documentation generated on Fri Aug 19 2011 13:36:02 GMT+0200 (CEST).