Skip to content

Commit

Permalink
The zillow way, using only transforms for positioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
radiantstatic committed Oct 3, 2024
1 parent 723a760 commit 9ede0a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ export function createCustomMarkerClass(api: typeof google.maps): ICustomMarkerC
transformY = "-50%";
}

this.element.style.left = point.x + (this.opts.offsetX || 0) + "px";
this.element.style.top = point.y + (this.opts.offsetY || 0) + "px";
const xPos = point.x + (this.opts.offsetX || 0) + "px";
const yPos = point.y + (this.opts.offsetY || 0) + "px";
// eslint-disable-next-line prettier/prettier
this.element.style.transform = `translateX(${transformX}) translateY(${transformY})`;
this.element.style.transform = `translateX(${transformX}) translateX(${xPos}) translateY(${transformY}) translateY(${yPos})`;

if (this.opts.zIndex) {
this.element.style.zIndex = this.opts.zIndex.toString();
Expand Down

0 comments on commit 9ede0a3

Please sign in to comment.