Telogis.GeoBase.AbstractDOMEntity |
An abstract base class for constructs that are based on a DOM element, such as map layers and widgets. Primarily, this combines the features of MapLayers.AbstractLayer and Widgets.AbstractWidget to allow code re-use. Note that because of the varying treatments of top-level DOM nodes between these, creation of a base element is left to the derived class.
Name | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AbstractDOMEntity(config, initMode, elemInitFunc) | Arguments
|
Name | Description |
---|---|
addEvent (String eventType, Function action) | Adds an event handler to the DOM entity, such that when a named event type is triggered, the function pointed to by AbstractDOMEntity.addEvent.action is called. Arguments
|
attach (Element parent) | Appends the entity's DOM to a given parent node, preserving visibility information. Arguments
|
destroy () | Deallocates properties of the DOM entity and deletes references where appropriate, breaking circular references for leak prevention. This should only be called when the entity will never be used again. |
destroyInstances () | Calls AbstractDOMEntity.destroy on every recorded AbstractDOMEntity instance. This is called automatically by Telogis.GeoBase.destroy when the page unloads. |
detach () | Removes the entity's DOM from its currently acknowledged parent node, preserving visibility information. |
getVisibility () | Gets a number indicating the visibility of the AbstractDOMEntity. ReturnsNumber - The visibility value of the DOM entity. If this is zero or negative, the entity is hidden; if it is positive, the entity is visible. |
hide (Number visibility) | Hides the entity on the page. This is accomplished by detaching its DOM tree from its parent node, but differs from AbstractDOMEntity.detach in that it continues to acknowledge the entity's prior parent node. Arguments
|
hideCumulative () | Stops the entity from displaying on the page. This may be stacked with other calls to AbstractDOMEntity.hideCumulative and AbstractDOMEntity.showCumulative, such that the entity is only hidden once AbstractDOMEntity.hideCumulative has been called for every AbstractDOMEntity.showCumulative, and vice versa. |
isVisible () | Determines whether the entity is currently visible. ReturnsBoolean - True if the entity is showing; false if it is hidden. |
log (String text) | A simple wrapper to Console.writeLine that performs output only if the AbstractDOMEntity has not been configured as silent. Arguments
|
popFromTop () | Restores the z-index of the entity after a call to AbstractDOMEntity.pushToTop. |
pushToTop (Number top) | Temporarily adjusts the z-index of the entity so that it is displayed above all other elements until AbstractDOMEntity.popFromTop is called. Arguments
|
removeEvent (String eventType, Function action) | Removes an event handler registered by AbstractDOMEntity.addEvent from the entity. Arguments
|
setVisibility (Boolean value) | Sets whether the entity is currently visible. Arguments
|
show (Number visibility, Function beforeUpdate) | Shows the entity on the page. This is accomplished by attaching its DOM tree to the acknowledged parent, but differs from AbstractDOMEntity.attach in that it guarantees immediate attachment. Arguments
|
showCumulative (Boolean stealthy) | Shows the entity on the page. This may be nested with other calls to MapLayers.AbstractLayer.showCumulative and MapLayers.AbstractLayer.hideCumulative, such that the entity is only shown once MapLayers.AbstractLayer.showCumulative has been called for every MapLayers.AbstractLayer.hideCumulative, and vice versa. Arguments
|
toggleVisibility () | Shows the entity if it is hidden and hides it if it is showing. |
toString () | Finds a string representation of the AbstractDOMEntity, which will be its AbstractDOMEntity.id. ReturnsString - a string representing the DOM entity. |
whenDOMReady (Function callback) | Executes a function immediately if the DOM entity's element has been set up. If it has not, the function is queued to be called once this occurs. Arguments
|
whenVisible (Function callback) | Executes a function immediately if the DOM entity is visible. If it is not, the function is queued to be called when the entity's AbstractDOMEntity.Show event handler is triggered. Arguments
|
Name | Type | Description |
---|---|---|
Click | EventHandler | An event to be triggered when the entity is clicked, i.e. when the left mouse button is released on it. |
DoubleClick | EventHandler | An event to be triggered when the entity is double-clicked with the left mouse button. |
elem | Element | The underlying DOM element that the AbstractDOMEntity is displayed in. |
EVENT_ALL | Number | A flag to enable full event handling. |
EVENT_CLICK | Number | A flag to enable click event handling. |
EVENT_DOUBLE_CLICK | Number | A flag to enable dblclick event handling. |
EVENT_HIDE | Number | A flag to enable handling of the event triggered when the entity is hidden. |
EVENT_MOUSE_DOWN | Number | A flag to enable mousedown event handling. |
EVENT_MOUSE_IN | Number | A flag to enable mouseover event handling. |
EVENT_MOUSE_MOVE | Number | A flag to enable mousemove event handling. |
EVENT_MOUSE_OUT | Number | A flag to enable mouseout event handling. |
EVENT_MOUSE_UP | Number | A flag to enable mouseup event handling. |
EVENT_NONE | Number | A flag to completely disable event handling. |
EVENT_RIGHT_CLICK | Number | A flag to enable contextmenu event handling. |
EVENT_SHOW | Number | A flag to enable handling of the event triggered when the entity is shown. |
Hide | EventHandler | An event triggered when the entity is hidden. This is not triggered if the hide call was to AbstractDOMEntity.hideCumulative and did not result in an actual hide. |
id | String | The name used to identify this AbstractDOMEntity within the Telogis.GeoBase API. This may also refer to its underlying DOM element. |
INIT_DATA | Number | An initialization flag for the entity's data. |
INIT_DOM | Number | An initialization flag for the entity's DOM. |
INIT_FULL | Number | An initialization flag for all the entity's components. |
MouseDown | EventHandler | An event to be triggered when the mouse button is pressed over the entity. |
MouseIn | EventHandler | An event to be triggered when the mouse cursor enters the entity. |
MouseMove | EventHandler | An event to be triggered when the mouse is moved over the entity. |
MouseOut | EventHandler | An event to be triggered when the mouse cursor leaves the entity. |
MouseUp | EventHandler | An event to be triggered when the mouse button is released over the entity. |
RightClick | EventHandler | An event to be triggered when the right mouse button is released on the entity. |
Show | EventHandler | An event triggered when the entity is shown. This is not triggered if the show call was to AbstractDOMEntity.showCumulative and did not result in an actual show. |
TouchEnd | EventHandler | An event to be triggered on a touch screen device when the screen is depressed over the entity. |
TouchMove | EventHandler | An event to be triggered on a touch screen device while the screen is pressed and the touch point moved. |
TouchStart | EventHandler | An event to be triggered on a touch screen device when the screen is pressed over the entity. |
TouchTap | EventHandler | An event to be triggered on a touch screen device when the screen is pressed and then depressed at the same point within 500ms. |