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

Stable endpoint for ZXY format #50

Closed
andersonaddo opened this issue Jan 3, 2025 · 3 comments
Closed

Stable endpoint for ZXY format #50

andersonaddo opened this issue Jan 3, 2025 · 3 comments

Comments

@andersonaddo
Copy link

Hello!
Thanks for making this - this is great!
I'm trying to integrate this into openlayers - I've noticed that you've answered a question (#17) about this, but that method won't work for me (and I assume for many others).

I think a better approach would be something like this, which relies on a common API pattern for map tile endpoints that looks like this:
https://tile.openstreetmap.org/{z}/{x}/{y}.png

I can tell from #18 that openfreemap does seem to support this (for .pbf and not .png).

The problem is that the URL is not stable.
It looks like this (from #18):
https://tiles.openfreemap.org/planet/[revision]pt/{z}/{x}/{y}.pbf
where [revision] seems to change with every update of the map.

That means there's no ZXY endpoint we can reference that's stable.
Could we have some type of stable endpoint that follows the ZXY please? I think it would help a lot of folks, since a lot of mapping software rely on that format.

@hyperknot
Copy link
Owner

Actually, I've set up a wildcard for that, so you can do:

https://tiles.openfreemap.org/planet/any_text_here/9/277/168.pbf

But can you explain why it wouldn't work? The developer of OpenLayers personally gave me that snippet. If it doesn't work, I recommend you to open an issue in OpenLayers. I mean this "stable" URL will work with OpenFreeMap, but it's lucky that OpenFreeMap supports wildcards, it's quite rare actually.

@andersonaddo
Copy link
Author

The long and short of it is that you can use ol-mapbox-style, like the developer suggested, but the performance can be quite slow sometimes.

For the benefit of other developers who end up here, this has been discussed here:
openlayers/openlayers#10883
openlayers/openlayers#7549

There are some experimental solutions that OpenLayers is working on to fix this, but using them in thier current state is a little annoying without the XYZ format.

Experimental Solution 1: OffscreenCanvas
Implemented here: openlayers/openlayers#10828
Example here: https://openlayers.org/en/latest/examples/offscreen-canvas.html

Experimental Solution 2: WebGLVectorTileLayerRenderer
Implemented here: openlayers/openlayers#14445
Example here: https://openlayers.org/en/latest/examples/webgl-vector-tiles.html

@hyperknot
Copy link
Owner

Thank you for the detailed answer. Can you make a variation of that snippet which is performant and uses these URLs?
If so, I'd use that for the official samples.

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

No branches or pull requests

2 participants