[OpenLayers-Users] Create feature from sketch by imitating a bouble-click event

Amit Andersen amit.bracha.andersen at atkinsglobal.com
Wed Aug 26 03:44:34 EDT 2009


Hi All

I wonder if there is a good reason why my post is being ignored.
Is it to hard or is the problem posted not clear enough?

Mails with different problems have been streaming to my mailbox, and got an
answer quite fast. Kan someone write back if my post is not answerable in
some way.. :-)

Thanks
Amit


Amit Andersen wrote:
> 
> Hi
> 
> This should be a simple question.
> I'm working on limiting a path to one single line. What I did was to fire
> a function on "Point" event. A global var is counting the points created.
> In this function when the global var is 2, I have an alert which pops up
> fine.
> 
> What I want to do instead of the alert, is create the feature from the
> line sketch on second single-click. Basically imitate a double-click event
> on the second single-click.
> 
> This is my DrawFeature control:
> 
> ...
> line: new OpenLayers.Control.DrawFeature(vectors, OpenLayers.Handler.Path,
> {callbacks: { "point": this.TwoClickPath.bind(this) }}),
> ...
> 
> And this is the function that is being fired:
> 
> TwoClickPath: function(e) {
>     this.TwoClickPathCount++;
>     if (this.TwoClickPathCount == 2) {
>         /*
>             Here I want to create the a feature out of the sketch (which
> is a single line)
>         */  
>         // alert("");  fires ok
>         controls.line.deactivate();
>         this.TwoClickPathCount = 0;
>     }
> },
> 
> Thanks in advance for any reply.
> Amit
> 

-- 
View this message in context: http://n2.nabble.com/Create-feature-from-sketch-by-imitating-a-bouble-click-event-tp3503203p3514375.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list