Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(renderer): fix marker position #667

Merged
merged 1 commit into from
Jun 6, 2023
Merged

fix(renderer): fix marker position #667

merged 1 commit into from
Jun 6, 2023

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Jun 6, 2023

The PR fixes #643 for both advanced and legacy markers

Before:
image

After:
image

You can see that the center of the group cluster is now correctly positioned at the average of pin tips.

More changes:

The code now uses the same SVG for both legacy and advanced markers.
Labels were a big perf hit with legacy markers as it was causing a call to getClientBoundingRect.
Perf for legacy markers should be significantly improved.

I removed the whitespaces in the SVG literal. Because we don't want to pay the size + the extra parser time for them. Small diff but why not (readability is still ok I think).

<circle cx="120" cy="120" opacity=".6" r="70" />
<circle cx="120" cy="120" opacity=".3" r="90" />
<circle cx="120" cy="120" opacity=".2" r="110" />
<text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${count}</text>

Check warning

Code scanning / CodeQL

Unsafe HTML constructed from library input

This HTML construction which depends on [library input](1) might later allow [cross-site scripting](2). This HTML construction which depends on [library input](3) might later allow [cross-site scripting](2).
@amuramoto amuramoto merged commit fbb8fa8 into googlemaps:main Jun 6, 2023
github-actions bot pushed a commit that referenced this pull request Jun 6, 2023
googlemaps-bot pushed a commit that referenced this pull request Jun 6, 2023
### [2.2.2](v2.2.1...v2.2.2) (2023-06-06)

### Bug Fixes

* **renderer:** fix marker position ([#667](#667)) ([fbb8fa8](fbb8fa8))

### Code Refactoring

* misc minor cleanup ([#657](#657)) ([31cc4f6](31cc4f6))

### Miscellaneous Chores

* **deps-dev:** bump @rollup/plugin-node-resolve from 15.0.2 to 15.1.0 ([#662](#662)) ([6a90770](6a90770))
* **deps-dev:** bump @typescript-eslint/eslint-plugin ([#664](#664)) ([5089ca9](5089ca9))
* **deps-dev:** bump @typescript-eslint/parser from 5.59.8 to 5.59.9 ([#665](#665)) ([57d761c](57d761c))
* **deps-dev:** bump eslint from 8.41.0 to 8.42.0 ([#666](#666)) ([248b081](248b081))
* **deps-dev:** bump typedoc from 0.24.7 to 0.24.8 ([#663](#663)) ([f52e44d](f52e44d))
* Update release.yml ([7b9503e](7b9503e))
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 2.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DefaultRenderer] Advanced markers cluster position
3 participants