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

buildTileUrlTemplate in config.js as an async function #373

Open
randyberos opened this issue Sep 28, 2023 · 3 comments
Open

buildTileUrlTemplate in config.js as an async function #373

randyberos opened this issue Sep 28, 2023 · 3 comments
Labels

Comments

@randyberos
Copy link

We are using a Titiler server for rendering the COG image in the map. To have a better visual of the tiled image, we need to provide the rescale value of the COG image to the Titiler server. We are currently querying the percent_2 and percent_98 of the band statistics using the /cog/statistics of Titiler. Querying the statistics of the COG image requires the buildTileUrlTemplate to be asynchronous. This causes an error because stac-layer is not expecting an async buildTileUrlTemplate function. Below is the snippet of the error.

Is it possible for the buildTileUrlTemplate to expect an async function?

error:

[stac-layer] caught the following error while trying to add a tile layer: TypeError: str.replace is not a function
@DanielJDufour
Copy link
Collaborator

Hi, @randyberos . Great suggestion. On first read, I think this should be possible. Would you be interested in submitting a PR to https://github.com/stac-utils/stac-layer
?

@m-mohr
Copy link
Collaborator

m-mohr commented Sep 28, 2023

This would also need to be implemented in ol-stac, which we'll migrate to.

Also important to note is that this may break existing configs and needs a big warning in the changelog!

@randyberos
Copy link
Author

Hello @DanielJDufour. I created a pull request for this issue. Thanks.

@m-mohr m-mohr changed the title Is it possible for buildTileUrlTemplate in config.js to be an async function buildTileUrlTemplate in config.js as an async function Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants