[fusion-trac] #515: Redline: The mouse is still in drawing mode after digitize first redline object

Fusion trac_fusion at osgeo.org
Wed Jan 18 05:00:38 EST 2012


#515: Redline: The mouse is still in drawing mode after digitize first redline
object
-----------------------+----------------------------------------------------
   Reporter:  yangte   |       Owner:  yangte
       Type:  defect   |      Status:  new   
   Priority:  P3       |   Milestone:  Future
  Component:  Widgets  |     Version:  2.0   
   Severity:  Major    |    Keywords:        
External_id:  1435834  |       State:  New   
    Browser:  All      |          Os:  All   
-----------------------+----------------------------------------------------
 Steps to recreate:[[BR]]
 open FWL[[BR]]
 1. click redline[[BR]]
 2. new redline[[BR]]
 3. add to map[[BR]]
 4. digitize redline point[[BR]]
 5. enter label name[[BR]]
 6. click ok[[BR]]
 7. the object is crated and labeled[[BR]]
 8. then click the mouse[[BR]]
 [[BR]]
 Result:[[BR]]
 You can also draw weird things on the map, see the snapshot  1.png[[BR]]

 Expectation:[[BR]]
 After finishing drawing, the cursor is back to normal (can't draw any
 more)[[BR]]

 The cause of this defect:[[BR]]
 in !MapGuideViewerApi.js,function mgApiCallHandler will call the function
 mgApiDeactivate use this way:[[BR]]
 window.setTimeout(mgApiDeactivate, 100);
 However, the mgApiDeactivate doesn't work. so the mgApiControl is still in
 active mode after the redline digitize finished.[[BR]]


 Proposed solution:[[BR]]
 add a new api in !MapGuideViewerApi.js,[[BR]]
 {{{
         function DeactiveCurrentControl()
         {
                 if (mgApiActiveControl)
                 {
                         mgApiActiveControl.deactivate();
                         mgApiActiveControl = null;
                 }
         }
 }}}

 call it in editmarkup.php:[[BR]]
 {{{
         function PromptAndSetMarkupText()
         {
                 var textInput = document.getElementById("textInput");

                 textLabel = window.prompt("<?=$promptLabelLocal?>", "");
                 textInput.value = (textLabel != null) ? textLabel : "";
                 DeactiveCurrentControl();
                 ClearDigitization();
         }
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/515>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list