On 6/12/07, Richard Duivenvoorde <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using the DrawFeature control to let users define linestrings. I can
> capture the doubleclick event (for ending the line) using
> lineLayer.onFeatureInsert
>
> But I cannot find a way to check something WHILE clicking/adding the
> segments. Actually on the addition of every segment I want to be able to
> count the number of segments, because I want to be sure the will be not
> more then 20 segments in certain lines.

Hi Richard,

Looking at the code I think you can pass a "point callback" to the
DrawFeature constructor.

Try something like that (untested):

var cnt = 0;

function counter(geometries) {
    cnt++;
}

new OpenLayers.Control.DrawFeature(
    layer,
    OpenLayers.Handler.Path,
    { callbacks: { point: counter }}
);

--
Eric
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to