[OpenLayers-Users] OpenLayers on touch device: drawing by dragging instead of click

Jelmer Baas baas at speerit.nl
Thu Mar 22 09:56:28 EDT 2012


Richard,

Thanks, this is the first step: OL won't pan anymore while drawing. It does NOT move the node I just placed, though. So I'd need to catch another event and move it myself, I think? 

Regards
Jelmer Baas
Speer IT B.V.


-----Original Message-----
From: Richard Greenwood [mailto:richard.greenwood at gmail.com] 
Sent: donderdag 22 maart 2012 14:39
To: Jelmer Baas
Subject: Re: [OpenLayers-Users] OpenLayers on touch device: drawing by dragging instead of click

On Thu, Mar 22, 2012 at 3:28 AM, Jelmer Baas <baas at speerit.nl> wrote:
> Hello,
>
> With the release of OpenLayers 2.11 it's gotten fantastic to deploy to mobile devices (iPhone/iPad/Android tablets). However, our users need to be able to draw accurate lines which is nearly impossible at the moment.
>
> Right now, you start drawing by tapping the screen, removing your finger, moving to where you want the next point without touching the screen, and tap again. If you make a mistake, you'll need to remove the line or node, and try again.
>
> It would be great if the "swipe" on mobile devices could replace the "mousemove", so that it would move the next node instead of panning the map.
>
> Of course this would also change when the drawing ends: instead of putting down the node at "mousedown", it would do so at "mouseup".
>
> Are there any plans of changing this drawing behavior for mobile devices? And, does anyone have a suggestion how I could implement this for my site with OL 2.11?
>
> Thank you,
>
> Regards,
> Jelmer Baas
> Speer IT B.V.

Jelmer,

Have a look at:

        handlerOptions: {
          documentDrag: false,  // prevents 'done' event from being
fired when mouse moves out of map window extents
          stopDown: true,  // these two prevent map dragging/panning
which is not needed with edge panning
          stopUp: true     // stopDown & stopUp don't show up until 2.11
        }


-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the Users mailing list