Browse Source

fix: do not set mouseout event delay when user is not dragging label (#135)

main
Bobbie Goede 4 years ago committed by GitHub
parent
commit
0aa8820a90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/marker.ts

7
src/marker.ts

@ -159,6 +159,8 @@ export class MarkerWithLabel extends MarkerSafe { @@ -159,6 +159,8 @@ export class MarkerWithLabel extends MarkerSafe {
if (this.mouseOutTimeout) {
clearTimeout(this.mouseOutTimeout);
}
if (this.isMouseDownOnLabel) {
this.mouseOutTimeout = setTimeout(() => {
if (this.isMouseDownOnLabel) {
this.isMouseDownOnLabel = false;
@ -179,6 +181,11 @@ export class MarkerWithLabel extends MarkerSafe { @@ -179,6 +181,11 @@ export class MarkerWithLabel extends MarkerSafe {
latLng: this.getPosition(),
});
}, 200);
} else {
google.maps.event.trigger(this, MOUSEOUT, {
latLng: this.getPosition(),
});
}
abortEvent(e);
}

Loading…
Cancel
Save