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

Remove ol/style/Icon's imgSize property #15059

Merged
merged 1 commit into from Aug 30, 2023
Merged

Conversation

ahocevar
Copy link
Member

@ahocevar ahocevar commented Aug 29, 2023

This pull request removes the imgSize property and its flat style icon-img-size counterpart, changing the loading sequence so they are no longer needed.

The image is now loaded using the simple ol/Image.load() function instead of the more involved listenImage() one, because the way listenImage decodes the image was only guaranteed to provide the decoded image for a single render frame, which does not bring a real performance benefit. We could also use ol/Image.decode(), but that would make SVG images, which are frequently used as icons, blurry when scaled or on retina displays.

@github-actions
Copy link

📦 Preview the website for this branch here: https://deploy-preview-15059--ol-site.netlify.app/.

@ahocevar ahocevar force-pushed the image-size branch 5 times, most recently from 7585d1c to 1d68afc Compare August 29, 2023 20:11
@ahocevar ahocevar marked this pull request as ready for review August 29, 2023 20:18
@ahocevar ahocevar changed the title Remove ol/style/Icon's imgSize property and decode icon images Remove ol/style/Icon's imgSize propert Aug 29, 2023
@ahocevar ahocevar changed the title Remove ol/style/Icon's imgSize propert Remove ol/style/Icon's imgSize property Aug 29, 2023
src/ol/style/Icon.js Outdated Show resolved Hide resolved
src/ol/style/IconImage.js Outdated Show resolved Hide resolved
Copy link
Contributor

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Tested the changes on the webgl style and it works great, thanks!

@ahocevar ahocevar merged commit 594cd6b into openlayers:main Aug 30, 2023
8 checks passed
@ahocevar ahocevar deleted the image-size branch August 30, 2023 19:58
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.

None yet

3 participants