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

layer jumps position when moving map #27

Open
crawld opened this issue Sep 24, 2021 · 3 comments
Open

layer jumps position when moving map #27

crawld opened this issue Sep 24, 2021 · 3 comments

Comments

@crawld
Copy link

crawld commented Sep 24, 2021

On firefox and safari, when the map is moved (pan), the layer jumps on the map. You can see this with the demo site:

https://danwild.github.io/leaflet-geotiff-2/

In _reset(), L.DomUtil.setPosition() moves the layer to the wrong place, then setting this._image.src in _drawImage() moves it back.

Seems ok on chrome desktop but not chrome ipad.

@Mforcen
Copy link

Mforcen commented Oct 27, 2021

I think that the problem is the way that these browsers manage the styles update. They are supposedly to update styles when javascript execution is finished, but the styles are updated when the line of code is executed, so it flickers.
A double-buffer approach could be used to avoid this, but I think that it would be faster only to create an image with the full ndvi render and plot it with css.

@hoetmaaiers
Copy link

Can this be solved with the current build or is inner-work needed?

@Mforcen
Copy link

Mforcen commented Dec 9, 2021

AFAIK, changes should be done in the javascript engine, telling them not to process the change during the script execution.
If I come up with some workaround, I will post it in here.

P.D.: This could be solved also by rendering the whole image and transforming it using CSS. I have a POC in my fork of this repo, under the direct-render branch.

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

No branches or pull requests

3 participants