Justin Poehnelt 4 years ago committed by GitHub
parent
commit
134ca3ed56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14143
      package-lock.json
  2. 2
      package.json
  3. 18
      src/marker.ts
  4. 1
      tsconfig.json

14143
package-lock.json generated

File diff suppressed because it is too large Load Diff

2
package.json

@ -36,7 +36,7 @@
"@babel/preset-env": "^7.12.13", "@babel/preset-env": "^7.12.13",
"@babel/runtime-corejs3": "^7.13.8", "@babel/runtime-corejs3": "^7.13.8",
"@googlemaps/jest-mocks": "^0.1.0", "@googlemaps/jest-mocks": "^0.1.0",
"@types/googlemaps": "^3.43.3", "@types/google.maps": "^3.44.0",
"@types/jest": "^26.0.20", "@types/jest": "^26.0.20",
"@types/selenium-webdriver": "^4.0.11", "@types/selenium-webdriver": "^4.0.11",
"@typescript-eslint/eslint-plugin": ">=4.15.0", "@typescript-eslint/eslint-plugin": ">=4.15.0",

18
src/marker.ts

@ -46,7 +46,7 @@ export class MarkerWithLabel extends MarkerSafe {
private isMouseDownOnLabel = false; private isMouseDownOnLabel = false;
private shouldIgnoreClick = false; private shouldIgnoreClick = false;
private eventOffset: google.maps.Point | null; private eventOffset: google.maps.Point | null;
private mouseOutTimeout: number; private mouseOutTimeout: ReturnType<typeof setTimeout>;
constructor(options: MarkerWithLabelOptions) { constructor(options: MarkerWithLabelOptions) {
super({ ...options }); super({ ...options });
@ -212,7 +212,10 @@ export class MarkerWithLabel extends MarkerSafe {
}); });
abortEvent(e); abortEvent(e);
}), }),
google.maps.event.addListener(this.getMap(), MOUSEMOVE, (e) => { google.maps.event.addListener(
this.getMap(),
MOUSEMOVE,
(e: google.maps.MapMouseEvent) => {
if (this.isMouseDownOnLabel && this.getDraggable()) { if (this.isMouseDownOnLabel && this.getDraggable()) {
if (this.isDraggingLabel) { if (this.isDraggingLabel) {
// Adjust for offset // Adjust for offset
@ -239,13 +242,18 @@ export class MarkerWithLabel extends MarkerSafe {
}); });
} }
} }
}), }
),
google.maps.event.addListener(this, DRAGSTART, () => { google.maps.event.addListener(this, DRAGSTART, () => {
this.label.zIndex = 1000000; this.label.zIndex = 1000000;
}), }),
google.maps.event.addListener(this, DRAG, ({ latLng }) => { google.maps.event.addListener(
this,
DRAG,
({ latLng }: google.maps.MapMouseEvent) => {
this.setPosition(latLng); this.setPosition(latLng);
}), }
),
google.maps.event.addListener(this, DRAGEND, () => { google.maps.event.addListener(this, DRAGEND, () => {
this.label.zIndex = this.getZIndex(); this.label.zIndex = this.getZIndex();
this.label.draw(); this.label.draw();

1
tsconfig.json

@ -7,7 +7,6 @@
"sourceMap": true, "sourceMap": true,
"esModuleInterop": true, "esModuleInterop": true,
"lib": ["DOM", "ESNext"], "lib": ["DOM", "ESNext"],
"types": ["googlemaps", "jest"],
"target": "ES6", "target": "ES6",
"moduleResolution": "node" "moduleResolution": "node"
}, },

Loading…
Cancel
Save