[OpenLayers-Dev] Fwd: [Patch] Smoother dragging of the map on older computers

Håkon haakeyar-mailinglists at bluezone.no
Wed Nov 7 09:02:55 EST 2007


> I just got an idea, maybe it could have been done "higher up",
> somewhere in the actual event handling instead of down in the
> panMap-method. This way, it will affect other drag-events too. I'll
> have to have a look at that.
Oh, that would of course not work. The drawing stuff and things like
that would of course need all the drag-events

(Sorry, Cameron, I forgot to choose reply to all, so you'll get two
identical emails.)

On Nov 7, 2007 8:34 AM, Håkon <haakeyar-mailinglists at bluezone.no> wrote:
> > * Some events which get resent, like mouse moves when panning are ok to drop
> > * Other one-off events, like click to query should not be dropped.
> >
> > Are you able to distinguish between the two?
> Yes I am, only the drag-event is dropped. Actually, the event is not
> completely dropped. I need to update an integer containing the number
> of pixels that the mouse has moved, but the actual map is not updated.
> It could probably be possible to avoid this too, but I don't think it
> creates a great overhead.
>
> I just got an idea, maybe it could have been done "higher up",
> somewhere in the actual event handling instead of down in the
> panMap-method. This way, it will affect other drag-events too. I'll
> have to have a look at that.
>
> I forgot to add a link to the ticket, so here it is:
> http://trac.openlayers.org/ticket/1125
>
>
> On Nov 7, 2007 4:58 AM, Cameron Shorter <cameron.shorter at gmail.com> wrote:
> > Hakon,
> > Great idea. I haven't looked at the code, but am interested to know:
> > * Some events which get resent, like mouse moves when panning are ok to drop
> > * Other one-off events, like click to query should not be dropped.
> >
> > Are you able to distinguish between the two?
> >
> >
> > Håkon wrote:
> > > Hi,
> > >
> > > The wiki said that I should mail the list after posting a patch to
> > > trac, so here I am. Description from trac:
> > > "When the openlayers 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."
> > >
> > > It was pointed out that maybe the ticket was created under the wrong
> > > component. I have no idea, so I'll have to ask some of you whether it
> > > is in the right position, and if not, where it should be.
> > >
> > > The wiki also said that I should state clearly that I wanted the patch
> > > reviewed, so, ehm... I want the patch reviewed.
> > > _______________________________________________
> > > Dev mailing list
> > > Dev at openlayers.org
> > > http://openlayers.org/mailman/listinfo/dev
> > >
> > >
> >
> >
> > --
> > Cameron Shorter
> > Geospatial Systems Architect
> > Tel: +61 (0)2 8570 5050
> > Mob: +61 (0)419 142 254
> >
> > Think Globally, Fix Locally
> > Commercial Support for Geospatial Open Source Software
> > http://www.lisasoft.com/LISAsoft/SupportedProducts.html
> >
> >
>


More information about the Dev mailing list