On Tue, May 13, 2008 at 10:46 PM, Zer <[EMAIL PROTECTED]> wrote:
>
>
>
> Eric Lemoine-3 wrote:
> >
> >
> > How about that:
> >
> > mt = new OpenLayers.Control.DrawFeature(vLayer, OpenLayers.Handler.Path, {
> > featureAdded: ShowDistance,
> > handlerOptions: {'freehand': true},
> > displayClass: 'MeasureTool'
> > });
> > mt.events.on({
> > 'deactivate': function() {
> > clearDistance();
> > }
> > });
> >
> > Cheers,
> > --
> > Eric
>
> > _______________________________________________
> > Users mailing list
> > [email protected]
> > http://openlayers.org/mailman/listinfo/users
> >
> >
>
> Thanks Eric! Works perfectly!
>
> Is there a way to capture the events when a new line is drawn? Are there any
> events when the users moves the mouse to draw the line? What I am looking
> for is a way to clear the text that shows the distance when the users starts
> to measure a new distance. I would also like to constantly update the
> distance text, while the user moves the mouse in order to draw the line.
There's no way to achieve this using the draw feature control. What
you can do is implement your own control. In addition to configuring a
'done' callback in the path handler your control would also configure
a 'point' callback. Start from Control/DrawFeature.js and build upon
it.
Cheers,
--
Eric
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users