Dragging a marker should not make a map click event.

This commit is contained in:
danzel 2012-11-05 10:27:40 +13:00
parent df7c350c75
commit c03ff65bc4

View File

@ -203,10 +203,11 @@ L.Marker = L.Class.extend({
}, },
_onMouseClick: function (e) { _onMouseClick: function (e) {
if (this.hasEventListeners(e.type)) { var wasDragged = this.dragging && this.dragging.moved();
if (this.hasEventListeners(e.type) || wasDragged) {
L.DomEvent.stopPropagation(e); L.DomEvent.stopPropagation(e);
} }
if (this.dragging && this.dragging.moved()) { return; } if (wasDragged) { return; }
if (this._map.dragging && this._map.dragging.moved()) { return; } if (this._map.dragging && this._map.dragging.moved()) { return; }
this.fire(e.type, { this.fire(e.type, {
originalEvent: e originalEvent: e