tikz spy with beamer overprint

In my presentation, I want to successively highlight different parts of my image using the TikZ spy library. Due to size constraints, the actual highlight is outside of the included image. Therefore, I use beamers overprint environment with onslide. This works fine for \node, but I cannot get it to work for \spy.

Below is a minimal, not working, example. I described the problems in the comments.

\documentclass[12pt]{beamer}
\usepackage{tikz}
\usetikzlibrary{spy}
\begin{document}
\begin{frame}
\begin{overprint}
\begin{tikzpicture}[spy using outlines={circle, blue, magnification=6, connect spies}]
% bluemarble from http://en.wikipedia.org/wiki/File:Apollo17WorldReversed.jpg
\node<1-> (image) at (0,0) {\includegraphics[width=6cm]{bluemarble}};
% this one compiles, but image jumps around
% \only<2->{\spy [size=3cm] on (1,1) in node at (4, 4);}
% this one fails to compile with: ! Extra }, or forgotten \endgroup.
% \onslide<2->\spy [size=3cm] on (1,1) in node at (4, 4);
% this one fails to compile with:
% Runaway argument?
% ]<2-> [size=3cm] on (1,1) in node at (4, 4); \end {tikzpicture} \end \ETC.
% ! Paragraph ended before \tikz@lib@spy@parse@opta was complete.
\spy<2-> [size=3cm] on (1,1) in node at (4, 4);
% these compile, but 'spy' is on every slide
% \onslide<2->{\spy [size=3cm] on (1,1) in node at (4, 4);}
% \uncover<2->{\spy [size=3cm] on (1,1) in node at (4, 4);}
\end{tikzpicture}
\end{overprint}
\end{frame}
\end{document}



How can I use \spy without my image "jumping around", e.g. with a (preferably automatically calculated) bounding box remaining constant for the different slides?

-
I did find a workaround by adding an invisible node in an earlier slide, just to force the tikzpicture to have the same bounding box. But I'd like a more robust solution. –  gerrit Dec 1 '11 at 16:24

You could try making the node an overlay: \only<2->{\spy [size=3cm] on (1,1) in node[overlay] at (4, 4);} Then you don't need the overprint environment at all. An overlay node means it is not added to the bounding box.