hguser
hguser

Reputation: 36068

click handler in marker using openlayer

I am using openlayers,when I query a list of pois from the server,I want to add the to the map one for each.

So I create marker for each of them,and I want a FrameCloud open when the marker is clicked.

I use this:

marker.events.resgister("click",marker,function(){
  this.pop.show();
});

However,when I drag the marker,the map will moved,and the event is triggered.

While I want nothing happen when use drag the marker,and the cursor should be pointer when mouseover the marker. Just like the google's marker.

How to implement this?

Upvotes: 3

Views: 1399

Answers (1)

winsent
winsent

Reputation: 486

Try this:

marker.events.register('mousedown', marker, function(evt){
 this.pop.show();
 OpenLayers.Event.stop(evt); 
});

Upvotes: 1

Related Questions