This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods.
OpenLayers. | This class takes care of figuring out which order elements should be placed in the DOM based on given indexing methods. |
Functions | |
initialize | Create a new indexer with |
insert | Insert a new node into the indexer. |
remove | |
clear | |
exists | |
getZIndex | Get the z-index value for the current node from the node data itself. |
getNextElement | Get the next element in the order stack. |
OpenLayers. | These are the compare methods for figuring out where a new node should be placed within the indexer. |
Functions | |
Z_ORDER_DRAWING_ORDER | 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 | 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). |
OpenLayers. | This is another virtual class in that it should never be instantiated by itself as a Renderer. |
Constants | |
BACKGROUND_ID_SUFFIX | {String} |
LABEL_ID_SUFFIX | {String} |
LABEL_OUTLINE_SUFFIX | {String} |
Constructor | |
OpenLayers. |
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)).
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.
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.
Functions | |
Z_ORDER_DRAWING_ORDER | 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 | 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). |
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.
indexer | {OpenLayers.ElementsIndexer} |
newNode | {DOMElement} |
nextNode | {DOMElement} |
{Integer}
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.
indexer | {OpenLayers.ElementsIndexer} |
newNode | {DOMElement} |
nextNode | {DOMElement} |
{Integer}
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.
Create a new indexer with
initialize: function( yOrdering )
Insert a new node into the indexer.
insert: function( newNode )
remove: function( node )
clear: function()
exists: function( node )
Get the z-index value for the current node from the node data itself.
getZIndex: function( node )
Get the next element in the order stack.
getNextElement: function( index )
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_DRAWING_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).
Z_ORDER_Y_ORDER: function( indexer, newNode, nextNode )