chellymehdi / vopenlayers

Automatically exported from code.google.com/p/vopenlayers
0 stars 0 forks source link

Event Click On marker #80

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hey could you please add for the clickListener of the marker the event ,because 
the event passed is null :

    if (variables.containsKey("click")) {
            fireEvent(new ClickEvent(this, null));
    }

So we cant detect if the event was a right click or double click , I think you 
should do this :

    if (variables.containsKey("click")) {
        MouseEventDetails evt = MouseEventDetails 
                    .deSerialize((String) variables.get("click"));
        fireEvent(new ClickEvent(this, evt));
    }

cheers,
Amine

Original issue reported on code.google.com by tifak.am...@gmail.com on 10 Jul 2012 at 2:43

GoogleCodeExporter commented 9 years ago
So that we can use the event to define wich type is :

marker.addClickListener(new ClickListener() {
            public void click(ClickEvent event) {

               if(event.isDoubleClick()){
                    //do action
               }else if (event.getButton() == ClickEvent.BUTTON_RIGHT){
                                        //do action
                           }else {
                                        //do action
                                 }
               }
}

Original comment by tifak.am...@gmail.com on 10 Jul 2012 at 3:31