 			return _graphicsAreValid;
 		}
 
-		public function getSelectedKeys():Array
-		{
-			//validate spatial index if necessary
-			if (_spatialIndex.recordCount == 0)
+		private function validateSpatialIndex():void
+		{
+			if (_spatialIndexDirty)
 			{
 				//trace(this,"updating spatial index", CallbackCollection.getStackTrace());
 				_spatialIndex.createIndex(plotter, showMissingRecords);
 				//trace(this,"updated spatial index",spatialIndex.collectiveBounds);
-			}
-
+				_spatialIndexDirty = false;
+			}
+		}
+		public function getSelectedKeys():Array
+		{
+			//validate spatial index if necessary
+			validateSpatialIndex();
+			
 			var keys:Array;
 
 			// if a global filter is referenced and the keyType matches, use the keys from the global filter

		private function spatialCallback():void
		{
			_spatialIndex.clear();
		}

		/**
		 *Sets the visibility of the layer 
		 * 

		{
			var shouldDraw:Boolean = (unscaledWidth * unscaledHeight > 0) && layerIsVisible.value;
			//validate spatial index if necessary
			if (shouldDraw)
				validateSpatialIndex();

			// draw background if this is not an overlay
			if (!isOverlay.value && !PlotterUtils.bitmapDataIsEmpty(backgroundBitmap))
