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

[style] Add custom cluster icons and adjust zoom on cluster clicks #76

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

ethan-tam33
Copy link
Contributor

@ethan-tam33 ethan-tam33 commented Nov 17, 2024

What's new in this PR

Description

  • used .addListener within clusterer object in AddMarkers.tsx to set the zoom value if the number of markers in the cluster are 2 (the only cases where the markers go beyond the screen when the cluster is clicked)
  • minimized zooming effect on cluster click
  • added the SVG of the custom cluster icons from Josh's Figma (but had to add a few lines since Figma hardcoded the "33" value for some reason)
  • created a renderer object that adds the custom icon for each cluster
  • changed marker and cluster icon size to be smaller

Screenshots

Screenshot 2024-11-16 at 4 55 15 PM

Screenshot 2024-11-17 at 7 17 27 PM

How to review

  • review AddMarkers.tsx

Next steps

  • better understand if it's possible to eliminate zooming animation on cluster click

Relevant links

Online sources

Related PRs

CC: @itsliterallymonique

@ethan-tam33 ethan-tam33 linked an issue Nov 17, 2024 that may be closed by this pull request
Copy link
Collaborator

@itsliterallymonique itsliterallymonique left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can change the SVG clustering width from pixes to rem (check my in-code comment) that would be amazing. If not -- go ahead and squash and merge!


export const ClusterIcon = ({ count }: { count: number }) => (
<svg
width="64"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change these width and height from image to rem? I believe you can write it as like "3rem" and it should work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if it's not possible, that's fine -- go ahead and squash and merge!

@ethan-tam33 ethan-tam33 merged commit d44b435 into main Nov 18, 2024
2 checks passed
@ethan-tam33 ethan-tam33 deleted the cluster-style-fixes branch November 18, 2024 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[chore] Marker Clustering Styling + Fixes
2 participants