[OpenLayers-Dev] transition sandbox - request for comment
Paul Spencer
pspencer at dmsolutions.ca
Mon Jan 14 20:11:10 EST 2008
Hi all,
I've been reminded a couple of times recently of the work I have been
doing in the pagameba/transition sandbox. I would like to complete
that work in the next few weeks and present it for integration into
trunk.
In reviewing the current status, I realized that one of the reasons
why I stopped working on it was that I got blocked by some challenges
in implementing the animation effect that required more invasive
changes than I wanted to make at the time. I'll give a brief overview
of what changes have been made first, then ask my question.
The purpose of the changes in the sandbox is to address one issue and
introduce a new feature into OpenLayers. The issue that I wanted to
address was the 'flash' on pan of singleTile layers and on zoom of any
layers. The new feature that I wanted to create was the ability to
create transition effects on zoom. In discussing these issues with
Erik, we came up with a way of introducing this new transition
capability in such a way as the default behaviour fixed my first issue
while providing a framework for implementing the new features.
The basic change that we architected was to create the concept of a
'back buffer tile' that sits behind every tile. The back buffer tile
is a clone of the tile that is updated through separate logic. When
the foreground tile is updated, the back buffer tile is made visible
as a place holder until the tile has loaded its new image. Actually,
it stays visible until the layer has finished loading.
We then scoped out two transition effect, 'resize' and 'animate'. The
'resize' effect simply resizes the back buffer tile image so that its
geographic extent is correct within the new zoom level. This
stretches or compresses the size of the image and you get a visual
place holder that is more or less correct until the new images
arrive. The 'animate' effect does the same thing, except it scales
the back buffer tile gradually between its old size/location and the
new size/location.
The current status of the sandbox is that the base architecture and
the 'resize' effect have been implemented and seem to work well. The
'animate' effect is implemented but it suffers from a couple of issues:
1) if the layer is panned before zooming, the transition starts where
the layer was before panning. This is due to a decision I made to
update the back buffer tile position when the transition completes
rather than just before it starts. I'm sure I had a good reason for
that, but I can't think of it right now. This is fixable and I have
toyed with a couple of ways of fixing it but neither struck me as the
right way so I am still thinking on this one.
2) if not all the tiles in the grid are being used for a given zoom
level, then the back buffer tiles are being left visible and can be
seen during zooms. I had originally intended to hide the back buffer
tile when the main tile was hidden, but doesn't work since the back
buffer tile needs to be visible while the main tile is loading and
potentially after it has loaded if the surrounding tiles haven't
finished loading.
3) there is some potential for problems if the map is zoomed while the
map is still animating, depending on the state of the tile loading.
In order to solve these issues, I feel like I have to make some
intrusive changes that I need some time to consider carefully, and
some review from those more knowledgeable than me about the
implications of some of the changes.
I would like your feedback on whether I should prepare a patch with
the basic back buffer tile support and resize effect (minimizing
changes to the current code base), and do a separate animation effect
in a later patch, or wait and do a single patch with everything in it
(potentially introducing changes with wider impact)?
Cheers,
Paul
___________________________________________
Paul Spencer
Chief Technology Officer
DM Solutions Group Inc
http://www.dmsolutions.ca/
More information about the Dev
mailing list