Instead of storing the geometry on all nodes (increasing memory drain) we only store what the indexer needs. The bounds bottom is only used in the compare method when checking for z and y ordering. r=ahocevar (closes #2198)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9590 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-07-27 16:50:33 +00:00
parent 8b741bc666
commit 7b90863198
2 changed files with 37 additions and 35 deletions
+4 -8
View File
@@ -318,12 +318,9 @@ OpenLayers.ElementsIndexer.IndexingMethods = {
nextNode
);
if (nextNode && returnVal == 0) {
var newLat = newNode._geometry.getBounds().bottom;
var nextLat = nextNode._geometry.getBounds().bottom;
var result = nextLat - newLat;
returnVal = (result ==0) ? 1 : result;
if (nextNode && returnVal === 0) {
var result = nextNode._boundsBottom - newNode._boundsBottom;
returnVal = (result === 0) ? 1 : result;
}
return returnVal;
@@ -560,7 +557,7 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
// Set the data for the node, then draw it.
node._featureId = featureId;
node._geometry = geometry;
node._boundsBottom = geometry.getBounds().bottom;
node._geometryClass = geometry.CLASS_NAME;
node._style = style;
@@ -697,7 +694,6 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
break;
}
node._style = style;
node._options = options;
//set style