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

Poi icon scaling #178

Merged
merged 2 commits into from
Sep 22, 2023
Merged

Poi icon scaling #178

merged 2 commits into from
Sep 22, 2023

Conversation

n1kPLV
Copy link
Contributor

@n1kPLV n1kPLV commented Sep 22, 2023

Automatically make POI icons smaller if the map is zoomed out. This isn't the cleanest possible solution, but it works.

if (poiIcon instanceof HTMLElement) {
// set the height and width using inline styles.
// this will probably make this component much more fragile than it needs to be...
poiIcon.style.width = poiIcon.style.height = `${poiIconSideLength}rem`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

React does not recommend to dynamically inject a style-tag as this could impact performance. Therefore this is using inline-styles.

@n1kPLV n1kPLV merged commit 011195b into development Sep 22, 2023
1 check passed
@n1kPLV n1kPLV deleted the poi_icon_scaling branch September 26, 2023 14:16
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.

1 participant