Ticket #165 (closed defect: fixed)

Opened 3 years ago

Last modified 16 months ago

Mouse wheel zoom results in multiple redundant image requests

Reported by: chrisclaydon Owned by: zjames
Priority: P2 Milestone:
Component: Widgets Version: SVN
Severity: Major Keywords:
Cc: External ID:
state: Review Browser: All
Operating System: All

Description

When you zoom in with the mouse wheel, it looks like a request is made to the MG server for every incremental click through the mouse wheel detents.

This results in a great number of redundant requests to the server for images that are never even displayed.

The MG AJAX viewer uses setInterval to wait until the user has stopped moving the mouse wheel for 500ms before making a map request.

Fusion/OpenLayers? could benefit significantly in performance and scalability by using a similar approach.

Change History

Changed 3 years ago by madair

  • status changed from new to closed
  • resolution set to fixed

(In [1659]) closes #165: add a timeout to the wheel events

Changed 3 years ago by chrisclaydon

  • status changed from closed to reopened
  • resolution fixed deleted

Submission 1659 doesn't really solve the problem. It zooms by the same factor, regardless of the amount the wheel has moved. A solid solution would also need to adjust the zoom of the current map image on the fly, so that the user has an idea of where they're zooming, but delay the request for an updated map image at the necessary scale and resolution until the zooming is done. It's hard to describe in words, but the MG AJAX viewer does a reasonable job of implementing it.

Changed 3 years ago by chrisclaydon

  • state changed from Analysis Requested to New

Changed 3 years ago by zjames

  • owner changed from madair to zjames
  • status changed from reopened to new
  • state changed from New to Review

(In [1889]) collect new events until timer expires, then set extents

I'm not sure this is quite right yet, but the approach is to keep collecting wheel events until a timer expires. The timer calls the function that actually changes the extents and makes the map request. Maybe a scale factor is needed somewhere in there.

Changed 3 years ago by chrisclaydon

I don't think the approach of just bundling up wheel events is going to feel right to the end user - each time you roll the mouse wheel through a detent, the map view should zoom in or out, but without actually re-rendering the image (just re-scaling or moving it). The idea is to give an idea of where you're zooming to. If you're zooming in, the displayed map will become blurred, and if you're zooming out, it will no longer fill the screen. That doesn't matter since it's just providing context until the full re-draw occurs when you stop moving the wheel.

Changed 3 years ago by zjames

I looked at how the MapGuide ajax viewer handles this and I can't see a way to achieve it within the context of OpenLayers without essentially replacing the OpenLayers view with a map image. OpenLayers does have a scaling mode but I can't see a way to invoke it that does not fire a request for the map itself, creating the unnecessary draws we're trying to avoid. Things only get more complicated with tiled layers in the view. I didn't test, but does the ajax viewer support this scaling with tiles?

Changed 3 years ago by chrisclaydon

The AJAX Viewer doesn't support the on-the-fly scaling with tiles. It could, but I simply didn't have enough time to write the code to figure out the necessary scaling and translation for all the tiled images.

At one point I wrote a preliminary implementation for single tile images by modifying the OpenLayers code directly. I think it worked, except that it flashed up the wrongly scaled image for a moment just before a redraw. I sent the code to Paul and Mike a long time ago - I don't think I have a copy of it any longer.

Changed 2 years ago by madair

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 2.0 to 2.1

I'm only seeing 2 map requests at most and I think using the 'resize' transition effect achieves the desired effect so Im closing this ticket

Changed 16 months ago by madair

  • milestone 2.1 deleted

Milestone 2.1 deleted

Note: See TracTickets for help on using tickets.