[OpenLayers-Trac] [OpenLayers] #3315: Problem with geometry
handlers - doesn't stop showing a point under the cursor
OpenLayers
trac-20090302 at openlayers.org
Tue May 24 04:25:31 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:
---------------------------+------------------------------------------------
I'm not sure exactly which library object this should be associated with,
but I suspect it's either the Handler.Point and/or the Handler.Path
object. The problem is observable when testing the measure tool in the
latest trunk examples (or 2.11-rc1 examples), and comparing that to the
measure tool example for 2.10.
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.
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.
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 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).
--
Ticket URL: <http://trac.openlayers.org/ticket/3315>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list