Class adf.CoordinateTracker
Defined in: CoordinateTracker.js.
Constructor Attributes | Constructor Name and Description |
---|---|
adf.CoordinateTracker(id, args)
A simple widget that listens for
onmousemove on an adf.Map object's
DOM element to display the current lattitude and longitude based on the position of the
mouse pointer. |
Field Attributes | Field Name and Description |
---|---|
The number of decimals places to display for each coordinate
|
|
The top-level DOM element for this "widget".
|
|
This adf.CoordinateTracker's unique id
|
|
The adf.Map object which you want to display map coordinates for.
|
Method Attributes | Method Name and Description |
---|---|
createDom(container)
Constructs the HTML DOM for displaying our map coordinates.
|
|
hide()
Hides the coordinate display widget with a fade out effect
|
|
setContent(content)
Sets the content of the coordinate display
|
|
show()
Shows the coordinate display widget with a fade in effect
|
Class Detail
adf.CoordinateTracker(id, args)
A simple widget that listens for
onmousemove
on an adf.Map object's
DOM element to display the current lattitude and longitude based on the position of the
mouse pointer.
var myTracker = new adf.CoordinateTracker("myTrackerId", { map: myMapReference, decimalPlaces: 2 });
- Parameters:
- {String} id
- unique identifier
- {Object} args
- Object literal containing properties to configure an instance of adf.CoordinateTracker
Field Detail
{Number}
decimalPlaces
The number of decimals places to display for each coordinate
- Default Value:
- 3
{Node}
domNode
The top-level DOM element for this "widget". This node is created and
appended to the the developer chosen containing node in adf.CoordinateTracker#createDom
{String}
id
This adf.CoordinateTracker's unique id
{adf.Map}
map
The adf.Map object which you want to display map coordinates for.
Method Detail
createDom(container)
Constructs the HTML DOM for displaying our map coordinates. Override this
function for a custom look. Be sure to setup this.domNode as a child node of this._containingNode.
The default DOM consists of a single
div
element like so:
To override this function using the Dojo Toolkit provided API... adfdojo.extend(adf.CoordinateTracker, { createDom: function() { // create an element for this.domNode... this.domNode = adfdojo.create("div", { attribute: value }); // create the node where our coordinates will be displayed, then assign this._contentNode to this element this._contentNode = someNewElement; // ... get creative // Either place your newly create DOM to this._containingNode or place it somewhere else in the DOM // if you'd prefer it not to be in the map display. adfdojo.place(this.domNode, this._containingNode); } });
- Parameters:
- {Element} container Optional
- The containing element for this callout's DOM node. Note: Dom node can be place in any other element on the page.
hide()
Hides the coordinate display widget with a fade out effect
setContent(content)
Sets the content of the coordinate display
- Parameters:
- {Node|String} content
- The content to show in the display for this widget
show()
Shows the coordinate display widget with a fade in effect