Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1589 closed defect (fixed)

Ajax Quick Plot: Capture box cannot move or rotate when base layers exist

Reported by: wuma Owned by: Mars Wu
Priority: high Milestone: 2.3
Component: AJAX Viewer Version:
Severity: major Keywords:
Cc: External ID: 1377366

Description

If there are base layers existing in a MapDefinition, then the quick plot capture box cannot move or rotate in Ajax viewer.

The reason is like below: When quick plot capture box is active, to determine if the capture box should be dragged with the mouse move, there is code detecting if the mouse pointer is in the capture box area, it is a "if a point is in a rectangle" check. To do this check, the mouse pointer position will be converted to map units.

To convert mouse's position to map units, we need to consider the "offsetTop" of the "map". The code used map container div whose is with id "img1" to calculate the offsetTop recursively. While <div id="img1"> is a "relative positioned" element, its offsetTop will be affected by its previous sibling: <div id="tilePlanes">. When there are base layers, then <div id="tilePlanes"> will contain tiles which fulfill the screen. It makes the <div id="img1"> 's offsetTop is always the windown's height which is wrong.

The correct way is: instead of getting the offsetTop from <div id="img1"> recursively, I should get it from <img id="mapImage1"> which is the map image and always fulfill the viewer.

Attachments (1)

quickplot_baselayers.patch (421 bytes ) - added by wuma 13 years ago.

Download all attachments as: .zip

Change History (3)

by wuma, 13 years ago

Attachment: quickplot_baselayers.patch added

comment:1 by wuma, 13 years ago

Resolution: fixed
Status: newclosed

comment:2 by wuma, 13 years ago

change is: r5509

Note: See TracTickets for help on using tickets.