[fusion-trac] #393: Exception in FDO component when using feature information (Digitize Polygon)

Fusion trac_fusion at osgeo.org
Thu Apr 22 14:11:41 EDT 2010


#393: Exception in FDO component when using feature information (Digitize
Polygon)
---------------------+------------------------------------------------------
 Reporter:  liuar    |         Owner:  madair 
     Type:  defect   |        Status:  new    
 Priority:  P2       |     Milestone:  Future 
Component:  Widgets  |       Version:  1.1.1  
 Severity:  Major    |    Resolution:         
 Keywords:           |   External_id:  1313209
    State:  New      |       Browser:  All    
       Os:  All      |  
---------------------+------------------------------------------------------
Comment (by chrisclaydon):

 Could you do it like this instead, so that we don't duplicate points
 unnecessarily if the handler is ever fixed to return a closed polygon?:

 {{{
 function OnPolyonDigitized(polygon) {
             var points = [];
             for (var i = 0; i < polygon.Count; i++) {
                 points.push(polygon.Point(i).X+' '+polygon.Point(i).Y);
             }

             // Close the polygon if it isn't already closed
             if(polygon.Point(0).X != polygon.Point(polygon.Count - 1).X ||
                polygon.Point(0).Y != polygon.Point(polygon.Count - 1).Y) {
                 points.push(polygon.Point(0).X+' '+polygon.Point(0).Y);
             }

             var geomText = 'POLYGON(('+points.join(',')+'))';

             SetSpatialFilter(geomText);
         }

 }}}

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/393#comment:4>
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