[OpenLayers-Trac] [OpenLayers] #3576: Incorrect geometry passed to measurePartial

OpenLayers trac-20090302 at openlayers.org
Tue Nov 15 08:41:16 EST 2011


#3576: Incorrect geometry passed to measurePartial
-------------------------------------+--------------------------------------
 Reporter:  lopez                    |       Owner:  tschaub     
     Type:  bug                      |      Status:  new         
 Priority:  minor                    |   Milestone:  2.12 Release
Component:  Control.Measure          |     Version:  2.11        
 Keywords:  measurepartial geometry  |       State:  Review      
-------------------------------------+--------------------------------------
 This bug is evident when using '''immediate''' option for
 OpenLayers.Control.Measure.[[BR]]
 See
 http://dev.openlayers.org/releases/OpenLayers-2.11/examples/measure.html
 [[BR]]
 Use "measure distance" and enable "use immediate measures".

 If you move the mouse fast enough after adding a point to the measure, the
 measurePartial callback gets a cached clone of how the measure geometry
 looked like when the point was added. You can see this as the value for
 the measurement is not updated correctly in the demo.

 When a point is added the last component of the line and point following
 the cursor will be on the same position. Since the callback is triggered
 with a timeout, moving the mouse before the callback is invoked will
 update the measure geometry but not the cached clone. The cached clone is
 the geometry sent to the callback, which at invocation time is outdated.
 This will give incorrect measurements.

 Attached is a simple patch that fixes this.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3576>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list