|
ka-Map | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--kaTool
kaTool API.
An API for building tools that work with kaMap.
To create a new tool, you need to have included this file first. Next
create a function to instantiate your new tool. All object construction
functions must include a parameter that references the kaMap object on which
they operate.
The object construction function must call the kaTool constructor using the
following syntax:
kaTool.apply( this, [oKaMap] );
where oKaMap is the name of the parameter to the constructor function.
You should then set the tool's name (this.name) and overload any functions
for mouse handling etc.
Defined in kaTool.js
Field Summary | |
Object |
bInfoTool
info tools get all events all the time |
Object |
kaMap
the instance of kaMap on which this tool operates |
Object |
name
the name of this tool |
Object |
wheelMinus
|
Object |
wheelPlus
|
Constructor Summary | |
kaTool
( <Object> oKaMap )
|
Method Summary | |
void
|
activate()
activate this tool. |
Array
|
adjustPixPosition( <Integer> x, <Integer> y )
adjust a page-relative pixel position into a kaMap relative pixel position |
Object
|
cancelEvent(<Event> e)
provide a cross-platform method of cancelling events, including stopping of event bubbling and propagation. |
void
|
deactivate()
deactivate this tool. |
Object
|
isInfoTool()
is this an info tool or a regular tool? |
Object
|
ondblclick(<Event> e)
handle mouse doubleclicks on the viewport of the kaMap. |
Object
|
onkeypress(<Event> e)
handle keypress events. |
Object
|
onmousedown(<Event> e)
handle mouse down events on the viewport of the kaMap. |
Object
|
onmousemove(<Event> e)
handle mouse movement over the viewport of the kaMap. |
Object
|
onmouseout(<Event> e)
handle the mouse leaving the kaMap viewport. |
Object
|
onmouseover(<Event> e)
handle the mouse moving over the kaMap viewport. |
Object
|
onmouseup(<Event> e)
handle mouse up events on the viewport of the kaMap. |
void
|
onmousewheel(<Event> e)
Handle mouse wheel events over the viewport of the kaMap. |
void
|
setMouseWheel(<array> minusSet, <array> plusSet)
Set the object and function to call when the mouse wheel event triggers. |
Field Detail |
Object bInfoTool
Object kaMap
Object name
Object wheelMinus
Object wheelPlus
Constructor Detail |
kaTool( <Object> oKaMap )
oKaMap
- the instance of kaMap on which this tool should operate
Method Detail |
void activate()
Array adjustPixPosition( <Integer> x, <Integer> y )
x
- the x page coordinate to convert
y
- the y page coordinate to convert
Object cancelEvent(<Event> e)
e
- the event to cancel
void deactivate()
Object isInfoTool()
Object ondblclick(<Event> e)
e
- the mouse event object
Object onkeypress(<Event> e)
e
- the keypress event object
Object onmousedown(<Event> e)
e
- the mouse event object
Object onmousemove(<Event> e)
e
- the mouse event object
Object onmouseout(<Event> e)
e
- the mouse event
Object onmouseover(<Event> e)
e
- the mouse event
Object onmouseup(<Event> e)
e
- the mouse event object
void onmousewheel(<Event> e)
e
- the mouse event object
void setMouseWheel(<array> minusSet, <array> plusSet)
minusSet
- - parameters for negative wheel scroll plusSet and minusSet are arrays of structure: [0] - object to apply function for or null [1] - function to apply [2] - function arguments or null for no arguments Set minusSet and/or plusSet to null to disable that scroll direction. eg: --disable mouse wheel for navigator tool: myKaNavigator.setMouseWheel(null, null); --set navigator tool to zoom (same as default action): myKaNavigator.setMouseWheel([myKaMap, myKaMap.zoomIn, null], [myKaMap, myKaMap.zoomOut, null]); (New D Badke)
plusSet
- - parameters for positive wheel scroll
|
ka-Map | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |