-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
New image tile source #14262
New image tile source #14262
Conversation
📦 Preview the website for this branch here: https://deploy-preview-14262--ol-site.netlify.app/. |
6a67cce
to
4580fcb
Compare
Thanks for your work on this, @tschaub. I'll be glad to review this, but please be patient. In the process of reviewing, I'd like to play around with the new |
No rush, @ahocevar. I would also like to do the same. One significant difference is that the data tile source doesn’t cache tiles. So this will mean adding a cache to the canvas renderer. |
7cbbfa9
to
9ca61b1
Compare
8f2176e
to
94f50e4
Compare
I've squashed these changes in order to make it easier to deal with the conflicts. New pull request #15568. |
This adds a new
ImageTile
source that extends theDataSource
as a convenience for working with image tiles. This is part 2 in the plan mentioned in #14258.The simplest example of its use looks like this:
The source is purely a convenience for creating an image loader given a URL. The
url
option can be a single URL template, an array of templates, or a function that returns a URL. The resulting loader returns a promise that creates an image, sets itssrc
, and resolves when the image loads. For more complex image loading scenarios, the source can be passed aloader
option.When a data tile is disposed, we now dispatch an abort event on an abort controller's signal. The GeoTIFF source shows how the abort signal can be passed to fetch.
There is probably more to do to support all the functionality of the current image tile stuff, but I think this makes for a simpler foundation than what we have currently. If we continue with this, we could eventually remove things like:
ol/source/UrlTile.js
ol/source/TileImage.js
ol/source/XYZ.js
ol/ImageTile.js
ol/tileurlfunction.js
Still todo: