Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#17 closed defect (fixed)

AJAX viewer and IE - Images in tooltip

Reported by: Andy Morsell Owned by: chrisclaydon
Priority: high Milestone: 1.2
Component: AJAX Viewer Version:
Severity: critical Keywords:
Cc: External ID: 922152

Description

When images are referenced in the tooltip for a layer, the AJAX viewer with Internet Explorer can yield some very odd results. If it takes too long for the image to be returned, say more than 4 or 5 seconds, it's like it tries to call the image again and then this causes a loop which makes the tooltip to appear to blink. For an example that I just ran into, see http://mapguide.spatialgis.com/mapguide/spokanemaps/ and turn on the DOT Cameras layer. When you float your mouse over one of the camera symbols, a DOT traffic camera image should appear, but often times results in the above behavior. This works just fine in Firefox.

Change History (5)

comment:1 by tomfukushima, 18 years ago

External ID: 922152
Owner: set to chrisclaydon

comment:2 by chrisclaydon, 18 years ago

In Internet Explorer, under some circumstances, an onmousemove event is issued when the tooltip is displayed, even though the mouse has not actually moved. This causes the tooltip to be closed, and a new one is opened shortly afterwards. That causes a new onmousemove event, and the process repeats ad infinitum.

To fix the problem, a check can be added to the beginning of the OnMouseMove() method defined in ajaxmappane.templ to verify that the mouse position really has changed before proceeding. For the bogus onmousemove events generated by IE, the OnMouseMove() method will then return immediately, without closing the current tooltip. This solves the problem.

The change involves changing this piece of code:

function OnMouseMove(e)
{
    var x = e.clientX - mapPosX;
    var y = e.clientY;

    lastposx = x; lastposy = y;

to this:

function OnMouseMove(e)
{
    var x = e.clientX - mapPosX;
    var y = e.clientY;

    if(x == lastposx && y == lastposy)
    {
        return false;
    }
    lastposx = x; lastposy = y;

comment:3 by chrisclaydon, 18 years ago

Fixed by an update to ajaxmappane.templ as described above.

comment:4 by anonymous, 18 years ago

Resolution: fixed
Status: newclosed

comment:5 by tomfukushima, 17 years ago

Milestone: 1.2
Note: See TracTickets for help on using tickets.