[OpenLayers-Trac] [OpenLayers] #1125: Smoother dragging of the map on older computers
OpenLayers
trac at openlayers.org
Mon Nov 5 15:33:29 EST 2007
#1125: Smoother dragging of the map on older computers
---------------------------------+------------------------------------------
Reporter: haakeyar | Owner: tschaub
Type: bug | Status: new
Priority: minor | Milestone:
Component: Control.DragFeature | Version: SVN
Keywords: review |
---------------------------------+------------------------------------------
Not sure whether this should be added as a bug or a new feature.
When the map is dragged around, a lot of events are sent, and the map is
updated on every one of them, which takes quite some time. Because of
this, the map feels slow, especially on old computers. This can be solved
by creating a short timeout when the event is received, which will update
the map a little later. Any events inbetween are ignored.
I created a patch with a possible way to implement this. It passes the
unit tests and it appears to work well in most browsers (tested in Firefox
2, Opera 9.5 Beta and IE 6 (IEs for Linux)). If you run the two versions
side by side, you can really feel a difference.
The updateMap-method in my patch would probably be more logical as an
anonymous function in the timeout-call, but then a the function would have
been created every time the timeout is created instead of only once when
OSM is loaded.
I don't know the code structure in OpenLayers very well, so there might be
better ways to implement it.
--
Ticket URL: <http://trac.openlayers.org/ticket/1125>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list