pigeon-maps icon indicating copy to clipboard operation
pigeon-maps copied to clipboard

Blurry map in Chrome

Open zdila opened this issue 4 years ago • 3 comments

Map is blurry in Chrome as it uses fractional value in transform: translate(...) as sub-pixel transofmation. Rounding could probably help.

FF: image

Chrome: image

zdila avatar Sep 17 '19 10:09 zdila

@zdila , reading what you wrote in #68 ("I have also fixed #71 there."), was the issue what you wrote here about rounding? If so, perhaps it would make sense to already implement the rounding inside latLngToPixel, as potential plugins using this function to get their coordinates might then be off by a pixel or half when rendering themselves, leading to janky behaviour...?

I'm not expecting a PR, just putting this comment out here to not forget about this in the future... :)

mariusandra avatar Dec 04 '19 21:12 mariusandra

I have put the rounding here: https://github.com/FreemapSlovakia/freemap-v3-react/blob/f494782a2accaa83028030415b22fdeeec75ec86/src/pigeon-maps/index.tsx#L1631

It was just a quick patch and probably putting it to latLngToPixel would be more suitable as you mention. So far I haven't studied the code to that detail :-)

BTW the problem was not only with blurring but also one could sometimes see sub-pixel lines between tiles.

Thanks.

zdila avatar Dec 05 '19 09:12 zdila

Stumbled upon this as well. Some fix would be very nice since Chrome/Blink is major browser/engine and it really doesn't look very good. (Not sure how can I use latLngToPixel for map directly.)

DavidSvetlik avatar Mar 02 '20 20:03 DavidSvetlik