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

DynamicMapLayer clears old image when you move map #1124

Open
ogix opened this issue Sep 4, 2018 · 7 comments
Open

DynamicMapLayer clears old image when you move map #1124

ogix opened this issue Sep 4, 2018 · 7 comments

Comments

@ogix
Copy link
Contributor

ogix commented Sep 4, 2018

  • Browser and version:

All

  • Version of Leaflet (L.version):

1.3.4

  • Version of esri Leaflet (L.esri.VERSION):

2.2.3

Steps to reproduce the error:

  1. Create a dynamicMapLayer
  2. Wait until layer is loaded
  3. Move map outside of layer bounds
  4. Return map to same position again

What happens is the loaded layer image gone. You have to wait again until image is loaded.

I was expecting the layer image to stay in the same way as with WMS layer.

@jgravois
Copy link
Contributor

jgravois commented Sep 4, 2018

it's near impossible to pan the map to exactly the same location. that said, I guess technically we could wait to remove the old image until after the next one is retrieved.

the relevant code is here if anyone is interested:
https://github.com/Esri/esri-leaflet/blob/master/src/Layers/RasterLayer.js#L48

@ogix
Copy link
Contributor Author

ogix commented Sep 4, 2018

Maybe it is possible to make this layer extend from leaflet tileLayer and make it work in the same way as wms layer does?

@tomwayson
Copy link
Member

I don't think it would make sense to extend from tileLayer. DynamicMapLayer is not based on tiles. I fetches one image created dynamically on the server (as opposed to many cached tiles) for each pan/zoom.

Do you see the behavior you expect when working with any other type of non-tiled layer?

@jgravois
Copy link
Contributor

jgravois commented Sep 5, 2018

WMS is a dynamic service type too. Leaflet likely just uses a grid to cache requests.

https://github.com/Leaflet/Leaflet/blob/master/src/layer/tile/TileLayer.WMS.js

I'd be interested in seeing a PR and evaluating the result for dynamicMapLayer if anyone is interested in tackling it. it doesn't look like it'd take much code.

@jwasilgeo
Copy link
Contributor

@jgravois @ogix was this fixed already, following the first non-tiling approach mentioned above?

wait to remove the old image until after the next one is retrieved

The order of operations seems good to me now that I'm going back and stepping through RasterLayer.js and what it extends from.

@jgravois
Copy link
Contributor

was this fixed already, following the first non-tiling approach mentioned above?

nope. no work has been done here.

@jwasilgeo jwasilgeo removed their assignment Oct 3, 2019
@jwasilgeo
Copy link
Contributor

Alright, we've confirmed that the DynamicMapLayer does function as expected by design now, and will leave this open as a potential enhancement with the idea suggested here: #1124 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants