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

New image tile source #15568

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tschaub
Copy link
Member

@tschaub tschaub commented Feb 19, 2024

This is a new version of the changes in #14262. I needed to squash the commits to deal with all the conflicts in the past couple years.

This adds a new ol/source/ImageTile.js module that is intended to replace the following:

  • ol/source/UrlTile.js
  • ol/source/TileImage.js
  • ol/source/XYZ.js
  • ol/ImageTile.js
  • ol/tileurlfunction.js

The new source accepts a url option that can be a single URL template, an array of URL templates, or a function that returns a URL. The resulting loader returns a promise that creates an image, sets its src, and resolves when the image loads. For more complex image loading scenarios, the source can be passed a loader option.

Since we have some breaking changes already merged in, I thought it could make sense to deprecate a few things and merge this in.

When we are ready to remove ol/source/TileImage.js, we can update the the 9 sources that extend TileImage to instead extend the ImageTile source. This will be a breaking change since some of the options no longer make sense (tileLoadFunction, urls, cacheSize).

Copy link

📦 Preview the website for this branch here: https://deploy-preview-15568--ol-site.netlify.app/.

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 this pull request may close these issues.

None yet

1 participant