Replies: 1 comment
|
@ishiland Thank you for the suggestions and setting the GeoLens' CORS for GeoLibre's origins. I would greatly apprciate a PR for this. Thank you. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi @giswqs, following on from geolens-io/geolens#665, two more things from reading the catalog browser plugin (#1377). The tile-token refresh handling in it is more careful than I expected.
1. Private rasters: transformRequest might get you there
map.setTransformRequest()attaches arbitrary headers per request, including on raster sources. We use it in production for exactly this:Two things I checked first. A preflight from
https://web.geolibre.appfor/raster-tiles/{id}/tiles/{z}/{x}/{y}.pngwithX-Api-Keyreturns 200 against our demo, so cross-origin isn't the blocker. And GeoLibre callstransformRequestnowhere today, so a plugin installing one won't clobber the host (though it's last-writer-wins if two ever want it).Untested: maplibre v5's header handling on raster sources in your build. Ours is same-origin with a bearer token, so treat this as a lead rather than a guarantee.
You're right that we should return a signed raster template like we do for vector tiles. I've opened geolens-io/geolens#688 for it; I'd rather fix that properly than leave you on a workaround.
2. datasets.geolibre.app advertises an internal origin
Setting
PUBLIC_BASE_URLfixesself,nextandroot. Probably why the client rebases hrefs instead of following them.tauri://localhostalso doesn't look allowlisted in that instance'sCORS_ALLOWED_ORIGINS, which the desktop build needs.I've set our demo's CORS up for GeoLibre's origins, so
demo.getgeolens.comworks as a server URL now too.Happy to send a PR for the raster change if that's easier than me describing it.
All reactions