[OpenLayers-Trac] Re: [OpenLayers] #2935: measure control should be able to calculate immediately while mouse is moving

OpenLayers trac-20090302 at openlayers.org
Fri Nov 19 04:40:52 EST 2010


#2935: measure control should be able to calculate immediately while mouse is
moving
-----------------------------+----------------------------------------------
 Reporter:  patzi            |       Owner:  tschaub     
     Type:  feature          |      Status:  new         
 Priority:  minor            |   Milestone:  2.11 Release
Component:  Control.Measure  |     Version:  2.10        
 Keywords:                   |       State:              
-----------------------------+----------------------------------------------

Comment(by ahocevar):

 A few things:
  * Cloning the geometry is relatively expensive, and not needed here. It
 was added for measurepartial to make sure you get the correct measurement
 even if you move the mouse very fast and the geometry has changed after
 "measurepartial" but before you use the measurement result.
  * You should register the modify callback only if the control was
 configured with {{{immediate}}} set to {{{true}}}, because even calling a
 callback that does nothing causes an overhead while moving the mouse.
  * To avoid two "measurepartial" events being fired in freehand mode, It
 would be cheaper to check for {{{immediate}}} in measurePartial than to
 check for freehand mode in measureImmediate.
  * I think this patch would break what was fixed with r10799. So you have
 to make sure that measureImmediate only causes a "measurepartial" event to
 be fired when {{{delayedTrigger}}} is null.

 Other than that, your patch looks good to me. If you add unit tests and
 set the ticket state to "Review", we can proceed. BTW, did you send a CLA
 already? It is not listed at wiki:CLA.

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


More information about the Trac mailing list