An event target is considered a marker if it has getLatLng and no or small radius (#5885)

Fixes #5635.
This commit is contained in:
Per Liedman 2017-10-30 18:39:33 +01:00 committed by Vladimir Agafonkin
parent 50b77520b3
commit 0bcccb0190

View File

@ -1365,7 +1365,7 @@ export var Map = Evented.extend({
};
if (e.type !== 'keypress') {
var isMarker = (target.options && 'icon' in target.options);
var isMarker = target.getLatLng && (!target._radius || target._radius <= 10);
data.containerPoint = isMarker ?
this.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);
data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);