Bug 686 - Mozilla - no zoom-box after measure
: Mozilla - no zoom-box after measure
Status: RESOLVED FIXED
: Chameleon
Widget
: 1.99
: PC All
: P1 normal
: 1.99 beta 4
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-10-04 23:29 by
Modified: 2004-12-02 21:28 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-10-04 23:29:35
I just realised a little problem in Mozilla browsers (incl. Firefox). 
After I used the measure tool, I am not able to draw a zoom-box for 
zooming in. This persists until the document is submitted. I spent quit 
a bit of time trying to find out where it goes wrong, but haven't been 
able to. This problem exists in cwc 1.0.4 and chameleon 1.99. It doesn't 
happen in explorer, only mozilla.
------- Comment #1 From 2004-10-05 00:58:21 -------
Verified in Firefox 1.0PR and Mozilla 1.5.  Also verified that this does not
occur in IE6.  No javascript errors are reported by the browser.

Version: Chameleon 1.99 Beta2
OS: XP SP2
Browsers Affected: FF1.0PR, Moz1.5

Steps to Reproduce:
1) Select the [Ruler] tool and measure a distance.
2) Press Escape to release the Ruler tool.
3) Selext the [Zoom In] button.
4) Attempt to draw a zoom box.

The page will submit immediately - you are not able to draw the Bounding Rectangle.
------- Comment #2 From 2004-10-21 14:34:28 -------
Changed target to 1.99 RC 1 (since it has to do with the ZoomIn widget). 
------- Comment #3 From 2004-11-04 10:18:51 -------
good catch.  I've duplicated this too.  Definitely needs to be resolved for
RC1.
------- Comment #4 From 2004-11-16 21:41:19 -------
this is a nasty one.  After using the ruler tool then activating the zoom in
tool, the function MapWmapTool gets called twice in succession (with only one
call to CWC2OnMouseMoveFunction).  I don't have a functional javascript debugger
right now so its impossible to trace, I'll try to work on this on another
machine that has a debugger.

The current workaround is to implement a quick check to ensure the function only
gets called once per CWC2OnMouseMoveFunction call ... this is not committed but
it works in my limited testing.  I'd like to try a debugger before settling on
this solution though.

To implement the workaround, add a variable at the top of MapDHTML.js:

var gMapWmapToolcalled = false;

in MapDHTML.js in function MapWmapTool add

if (gMapWmapToolcalled)
    return;
gMapWmapToolcalled = true;


in MapDHTML.widget.php in GetJavascriptOnMouseMoveFunctions() change to 

$szFunction = gMapWmapToolcalled = false;\n";
$szFunction .= "$szJsFunctionName(e);\n";

that's what I'll commit if I can't find a better solution.
------- Comment #5 From 2004-11-17 10:12:03 -------
after running in a debugger, I was not able to determine the cause for this. 
The event appears to be passed to MapWmapTool twice but there is no callstack so
it is coming from the mozilla event handler somehow.  Conveniently, the exact
same event object is passed in twice so I've localized my change to just
MapWmapTool with the following:

    if ( CWCIsNav6)
    {
        if (e.id == null)
            e.id = 'trap';
        else
            return;
        if (e.target == "[object HTMLHtmlElement]")
        {
            return;
        }
    }

I've added the first four lines in this if, the other 3 were already there.

Committed to cvs.