OpenLayers. ElementsIndexer

This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.

Summary
OpenLayers. ElementsIndexerThis class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.
Functions
initializeCreate a new indexer with
insertInsert a new node into the indexer.
remove
clear
existsnode- {DOMElement} The node to test for existence.
getZIndexGet the z-index value for the current node from the node data itself.
getNextElementGet the next element in the order stack.
OpenLayers. ElementsIndexer. IndexingMethodsThese are the compare methods for figuring out where a new node should be placed within the indexer.
Functions
Z_ORDER_DRAWING_ORDERThis method orders nodes by their z-index, but does so in a way that, if there are other nodes with the same z-index, the newest drawn will be the front most within that z-index.
Z_ORDER_Y_ORDERThis one should really be called Z_ORDER_Y_ORDER_DRAWING_ORDER, as it best describes which ordering methods have precedence (though, the name would be too long).
OpenLayers. Renderer. ElementsThis is another virtual class in that it should never be instantiated by itself as a Renderer.
Constants
BACKGROUND_ID_SUFFIX{String}
BACKGROUND_ID_SUFFIX{String}
Constructor
OpenLayers. Renderer. Elements
Constants
OpenLayers. Renderer. symbolCoordinate arrays for well known (named) symbols.

Functions

initialize

initialize: function(yOrdering)

Create a new indexer with

Parameters

yOrdering{Boolean} Whether to use y-ordering.

insert

insert: function(newNode)

Insert a new node into the indexer.  In order to find the correct positioning for the node to be inserted, this method uses a binary search.  This makes inserting O(log(n)).

Parameters

newNode{DOMElement} The new node to be inserted.

Returns {DOMElement} the node before which we should insert our newNode, or null if newNode can just be appended.

remove

remove: function(node)

Parameters

node{DOMElement} The node to be removed.

clear

clear: function()

exists

exists: function(node)

Parameters

node- {DOMElement} The node to test for existence.

Returns

{Boolean} Whether or not the node exists in the indexer?

getZIndex

getZIndex: function(node)

Get the z-index value for the current node from the node data itself.

Parameters

node{DOMElement} The node whose z-index to get.

Returns

{Integer} The z-index value for the specified node (from the node data itself).

getNextElement

getNextElement: function(index)

Get the next element in the order stack.

Parameters

index{Integer} The index of the current node in this.order.

Returns

{DOMElement} the node following the index passed in, or null.

OpenLayers. ElementsIndexer. IndexingMethods

These are the compare methods for figuring out where a new node should be placed within the indexer.  These methods are very similar to general sorting methods in that they return -1, 0, and 1 to specify the direction in which new nodes fall in the ordering.

Summary
Functions
Z_ORDER_DRAWING_ORDERThis method orders nodes by their z-index, but does so in a way that, if there are other nodes with the same z-index, the newest drawn will be the front most within that z-index.
Z_ORDER_Y_ORDERThis one should really be called Z_ORDER_Y_ORDER_DRAWING_ORDER, as it best describes which ordering methods have precedence (though, the name would be too long).

Functions

Z_ORDER_DRAWING_ORDER

Z_ORDER_DRAWING_ORDER: function(indexer,
newNode,
nextNode)

This method orders nodes by their z-index, but does so in a way that, if there are other nodes with the same z-index, the newest drawn will be the front most within that z-index.  This is the default indexing method.

Parameters

indexer{OpenLayers.ElementsIndexer}
newNode{DOMElement}
nextNode{DOMElement}

Returns

{Integer}

Z_ORDER_Y_ORDER

Z_ORDER_Y_ORDER: function(indexer,
newNode,
nextNode)

This one should really be called Z_ORDER_Y_ORDER_DRAWING_ORDER, as it best describes which ordering methods have precedence (though, the name would be too long).  This method orders nodes by their z-index, but does so in a way that, if there are other nodes with the same z-index, the nodes with the lower y position will be “closer” than those with a higher y position.  If two nodes have the exact same y position, however, then this method will revert to using drawing order to decide placement.

Parameters

indexer{OpenLayers.ElementsIndexer}
newNode{DOMElement}
nextNode{DOMElement}

Returns

{Integer}

OpenLayers. Renderer. Elements

This is another virtual class in that it should never be instantiated by itself as a Renderer.  It exists because there is tons of shared functionality between different vector libraries which use nodes/elements as a base for rendering vectors.

The highlevel bits of code that are implemented here are the adding and removing of geometries, which is essentially the same for any element-based renderer.  The details of creating each node and drawing the paths are of course different, but the machinery is the same.

Inherits

Constants

BACKGROUND_ID_SUFFIX

{String}

BACKGROUND_ID_SUFFIX

{String}

Constructor

OpenLayers. Renderer. Elements

Parameters

containerID{String}
options{Object} options for this renderer.  Supported options are:
  • yOrdering - {Boolean} Whether to use y-ordering
  • zIndexing - {Boolean} Whether to use z-indexing.  Will be ignored if yOrdering is set to true.

Constants

OpenLayers. Renderer. symbol

Coordinate arrays for well known (named) symbols.

initialize: function(yOrdering)
Create a new indexer with
insert: function(newNode)
Insert a new node into the indexer.
remove: function(node)
clear: function()
exists: function(node)
node- {DOMElement} The node to test for existence.
getZIndex: function(node)
Get the z-index value for the current node from the node data itself.
getNextElement: function(index)
Get the next element in the order stack.
Z_ORDER_DRAWING_ORDER: function(indexer,
newNode,
nextNode)
This method orders nodes by their z-index, but does so in a way that, if there are other nodes with the same z-index, the newest drawn will be the front most within that z-index.
Z_ORDER_Y_ORDER: function(indexer,
newNode,
nextNode)
This one should really be called Z_ORDER_Y_ORDER_DRAWING_ORDER, as it best describes which ordering methods have precedence (though, the name would be too long).
This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.
This is the base class for all renderers.
Close