[OpenLayers-Trac] Re: [OpenLayers] #3199: Handler.RegularPolygon: Strange behavior

OpenLayers trac-20090302 at openlayers.org
Wed Mar 30 09:52:55 EDT 2011


#3199: Handler.RegularPolygon: Strange behavior
-------------------------------------+--------------------------------------
  Reporter:  jorix                   |       Owner:  fredj       
      Type:  bug                     |      Status:  new         
  Priority:  minor                   |   Milestone:  2.11 Release
 Component:  Handler.RegularPolygon  |     Version:  SVN         
Resolution:                          |    Keywords:              
     State:  Review                  |  
-------------------------------------+--------------------------------------
Changes (by fredj):

  * state:  Needs More Work => Review


Comment:

 proposed patch:
 {{{
 Index: lib/OpenLayers/Handler/RegularPolygon.js
 ===================================================================
 --- lib/OpenLayers/Handler/RegularPolygon.js    (revision 11785)
 +++ lib/OpenLayers/Handler/RegularPolygon.js    (working copy)
 @@ -407,8 +407,11 @@
      callback: function (name, args) {
          // override the callback method to always send the polygon
 geometry
          if (this.callbacks[name]) {
 -            this.callbacks[name].apply(this.control,
 -                                       [this.feature.geometry.clone()]);
 +            var geom = null;
 +            if (this.feature && this.feature.geometry) {
 +                geom = this.feature.geometry.clone();
 +            }
 +            this.callbacks[name].apply(this.control, [geom]);
          }
          // since sketch features are added to the temporary layer
          // they must be cleared here if done or cancel
 }}}

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3199#comment:7>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list