Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#326 closed defect (fixed)

Query: One error happened once completing the Polygon drawn in previous Query condition.

Reported by: jennyhe Owned by: madair
Priority: P2 Milestone: Future
Component: Widgets Version: 1.1.1
Severity: Major Keywords:
Cc: christine.bao@… Browser: All
External ID: 1277664 Operating System: All
state: Committed

Description

Report from Autodesk QA Steps:

  1. Open one flexible web layout.
  2. Query->Check Spatial Filter -> Polygon, click 2 points in map
  3. Uncheck Spatial Filter -> Check again -> Rectangle -> Draw rectangle
  4. Complete the Polygon drawn in Step2.

Results: One error happened in IE. Please refer to the attached png file.

Expected results: No error happened.

Attachments (2)

Polygon_Error.PNG (8.2 KB ) - added by jennyhe 13 years ago.
Fix326.patch (653 bytes ) - added by christinebao 13 years ago.

Download all attachments as: .zip

Change History (7)

by jennyhe, 13 years ago

Attachment: Polygon_Error.PNG added

comment:1 by christinebao, 13 years ago

Resolution: fixed
Status: newclosed

After fixing ticket http://trac.osgeo.org/fusion/ticket/322, this defect is not reproducible.

comment:2 by christinebao, 13 years ago

The key point of this defect is:

  1. Start draw polygon, but not double click to finish it.
  2. Draw a rectangle.
  3. Continue step 1 to finish the polygon.

It will call MapGuideViewerApi.js:

function mgApiDeactivate() {
  mgApiActiveControl.deactivate();
  mgApiActiveControl = null;
  if (mgApiActiveWidget) {
    var Fusion = window.top.Fusion;
    var mapWidget = Fusion.getWidgetById(mgApiMapWidgetId);
    mapWidget.activateWidget(mgApiActiveWidget);
    mgApiActiveWidget = null;
  }
}


And in this case mgApiActiveControl is null, thus cause the defect.

comment:3 by christinebao, 13 years ago

To prevent IE from null object error, add a check for whether mgApiActiveControl is null. Please see the attached patch.

This user scenario is weird, and it's not the expected behavior. Query should only have one geometry for spatial filter, either polygon or rectangle. When start drawing polygon, it records the points to form the polygon, and finally use these points as spatial filter; When start drawing rectangle, it records the points of the rectangle for spatial filter. It's impossible to both query polygon and rectangle.

However in this defect, there will be two geometries left. As the last point is ended by polygon, Query will use the points of polygon for spatial filter, while ignoring rectangle. After discussing with QA, this behavior is treated as acceptable, as 1) it's not a common user behavior. 2) it's ok as long as no error happens.

by christinebao, 13 years ago

Attachment: Fix326.patch added

comment:4 by liuar, 13 years ago

Reviewed. Please submit the code. Thanks.

comment:5 by christinebao, 13 years ago

state: NewCommitted

Submit the patch for fixing this defect.

Note: See TracTickets for help on using tickets.