Ticket #515 (new defect)
Opened 4 months ago
Redline: The mouse is still in drawing mode after digitize first redline object
| Reported by: | yangte | Owned by: | yangte |
|---|---|---|---|
| Priority: | P3 | Milestone: | Future |
| Component: | Widgets | Version: | 2.0 |
| Severity: | Major | Keywords: | |
| Cc: | External ID: | 1435834 | |
| state: | New | Browser: | All |
| Operating System: | All |
Description
Steps to recreate:
open FWL
1. click redline
2. new redline
3. add to map
4. digitize redline point
5. enter label name
6. click ok
7. the object is crated and labeled
8. then click the mouse
Result:
You can also draw weird things on the map, see the snapshot 1.png
Expectation:
After finishing drawing, the cursor is back to normal (can't draw any more)
The cause of this defect:
in MapGuideViewerApi.js,function mgApiCallHandler will call the function mgApiDeactivate use this way:
window.setTimeout(mgApiDeactivate, 100);
However, the mgApiDeactivate doesn't work. so the mgApiControl is still in active mode after the redline digitize finished.
Proposed solution:
add a new api in MapGuideViewerApi.js,
function DeactiveCurrentControl()
{
if (mgApiActiveControl)
{
mgApiActiveControl.deactivate();
mgApiActiveControl = null;
}
}
call it in editmarkup.php:
function PromptAndSetMarkupText()
{
var textInput = document.getElementById("textInput");
textLabel = window.prompt("<?=$promptLabelLocal?>", "");
textInput.value = (textLabel != null) ? textLabel : "";
DeactiveCurrentControl();
ClearDigitization();
}

