[OpenLayers-Trac] Re: [OpenLayers] #3315: Problem with geometry handlers - doesn't stop showing a point under the cursor

OpenLayers trac-20090302 at openlayers.org
Tue May 24 12:17:55 EDT 2011


#3315: Problem with geometry handlers - doesn't stop showing a point under the
cursor
---------------------------+------------------------------------------------
 Reporter:  mgleahy        |       Owner:  tschaub     
     Type:  feature        |      Status:  new         
 Priority:  minor          |   Milestone:  2.11 Release
Component:  Handler.Point  |     Version:  2.11 RC1    
 Keywords:                 |       State:              
---------------------------+------------------------------------------------
Changes (by jorix):

 * cc: xavier.mamano@… (added)


Comment:

 Replying to [ticket:3315 mgleahy]:
 > If you measure a distance in both of these examples, you'll see that
 after double-clicking to complete the line being drawn, the 2.10 will stop
 after the action is complete, but the trunk/2.11-rc1 example will continue
 drawing a point that follows the cursor around on the map.
 >
 Yes, this behavior is new. Now when the tool is activated a point follows
 the cursor

 > You can also compare the "OpenLayers Draw Feature Example" for 2.10 and
 trunk/2.11-rc1.  If you simply select the option to draw a line, in 2.10
 nothing happens until you click the map...in trunk/2.11-rc1, you will
 immediately see a point that follows the cursor.
 >
 Yes...
 > A side effect of this issue is that the Measure tool also continuously
 fires the 'measurepartial' event (even though there is no current geometry
 being drawn).  While this is not observable in the measure tool example,
 this causes problems if you were to have an event that updates a status
 based on the measurepartial callback in the Measure tool.  After drawing a
 line/area, as soon as the user moves the mouse again, it will start
 reporting zero measurements even though there may be a 'persistent' shape
 from the last drawn measurement.  In this case, I'm not sure how to
 distinguish between a 'meaurepartial' event that is called while the user
 is currently drawing and one that is called when no active drawing is
 being done.  This also affects other vector drawing tools
 >
 I could not reproduce this problem. With what browser? What is the sample
 code?

 '''NOTE''': In 2.11 {{{modify}}} callback has a third parameter that
 indicates whether the movement is produced while drawing.

 @erilen: The line
 [http://trac.osgeo.org/openlayers/browser/trunk/openlayers/lib/OpenLayers/Handler/Path.js?rev=11962#L344
 344 of Path.js] should be {{{this.modifyFeature(evt.xy,
 }}}'''true'''{{{);}}}?

 > I think the underlying problem is that the handler.drawing property no
 longer exists or is being set to 'true' when there is an active drawing
 for paths/polygons.  This was being set in the Handler.Path mousedown
 event for 2.10.  In 2.11-rc1, 'this.drawing' is set to false in the
 Handler.Point.finalize method...but it is otherwise not being set (as far
 as I can tell).

 Yes, it's an oversight (In #3310 I suggest use it for internal use when
 working freehand)

 NOTE: I am not !OpenLayers Team.

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


More information about the Trac mailing list