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

Map has sub-pixel white grid-like image border in Chrome #95

Open
lmytime opened this issue Nov 20, 2024 · 0 comments · May be fixed by #96
Open

Map has sub-pixel white grid-like image border in Chrome #95

lmytime opened this issue Nov 20, 2024 · 0 comments · May be fixed by #96

Comments

@lmytime
Copy link
Contributor

lmytime commented Nov 20, 2024

As the image attached below, there are some sub-pixel white grid-like image borders when running FitsMap using Chrome.
image

This could be caused by the floating point rendering inaccuracies when calculating the image position and then rendering it on the screen. I try checking the source code and find this can be resolved by forcing an integer pixel of translate3d CSS attribute for mapPane.

<div class="leaflet-pane leaflet-map-pane" style="transform: translate3d(XXXpx, YYYpx, 0px);">......</div>

So I write a new scirpt, to call it after zoomend and moveend, to force the XXX, YYY to be integer. Then in Chrome, there will be no sub-pixel grid-like white image border.

For those users, who have made their map directory already, they may directly import the new integerTranslate.js file in the index.js file and un-comment the final two lines within for event callback. Then the white grid issues can be resolved in Chrome and do not need to rebuild the map.

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 a pull request may close this issue.

1 participant