[OpenLayers-Dev] "allow pan while drawing" patch
Alexandre Dube
adube at mapgears.com
Wed Jan 12 08:41:37 EST 2011
Hi Eric,
I really like the idea of being able to pan while drawing features.
I tried yours examples and here's my comments about them.
=== about your patch ===
Drawing a new point on mouseup seemed odd on first impression, but I
could live with it. Then, I noticed some down effects. When trying do
quickly draw a line, it kept missing some points along the way. I'm not
sure if that could be an issue since when you draw (normally), you take
your time. Your new feature seems "mobile compatible" though, and
that's a plus.
=== an other idea ===
The first time I used the draw feature control, I noticed that I
couldn't pan the map with the mouse. The first thing I tried to do is
move the mouse out of the map. I thought the map would follow by
panning itself.
How about that ? We could have a new "pan" feature that uses the map
extents as zones to pan the map. If the mouse is moved to or outside
the zone, the map starts panning. When the mouse comes back in the map,
it stops. Okay, that panning method wouldn't be useful as a standard
method to do so (having a small map in an html page, we wouldn't want
the map to pan when the mouse goes out of it), but if used while
interacting with the map, for example drawing features (and being in the
middle of it), it could be useful.
What do you think ?
Alexandre
On 11-01-12 07:05 AM, Eric Lemoine wrote:
> Hello
>
> Currently the map cannot be panned when a draw feature control is
> active. Google Maps allows it, and I think it would be great that
> OpenLayers allow it as well.
>
> I've started prototyping this in a sandbox. It currently it works for
> "draw point" and "draw line" only (and it breaks the freehand mode).
> See [1] and [2] for examples.
>
> With my patch points are added on mouseup as opposed to mousedown, so
> the drawing user experience is changed a bit. Also, although my patch
> makes this somehow configurable (through stopDown stopUp options), I
> think "allow pan while drawing" should be the default.
>
> What do you think about it? Would such a patch make sense for
> inclusion into the trunk?
>
> Thanks for any feedback,
>
>
> [1]<http://dev.openlayers.org/sandbox/elemoine/draw-feature/examples/draw-feature.html>
> [2]<http://dev.openlayers.org/sandbox/elemoine/draw-feature/examples/measure.html>
>
--
Alexandre Dubé
Mapgears
www.mapgears.com
More information about the Dev
mailing list