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

Add .pbf support for custom layers #255

Open
rafal0p opened this issue Sep 17, 2023 · 2 comments
Open

Add .pbf support for custom layers #255

rafal0p opened this issue Sep 17, 2023 · 2 comments

Comments

@rafal0p
Copy link

rafal0p commented Sep 17, 2023

Custom layers is an awesome feature, but currently it supports only sources that are returning {z}/{y}/{x}.png. There are some servers that return {z}/{y}/{x}.pbf.

It seems that .pbf is just a wrapper over .osm that serializes it as protobuf as described here.

Do I understand correctly that what needs to be done is:

  1. deserialize pbf to osm
  2. render osm as png

How hard it could be? Is any of these features supported by leaflet? If not - are you fine with bringing in yet another dependency?

@vcoppe
Copy link
Contributor

vcoppe commented Jun 28, 2024

Thank you for your suggestion, I have re-implemented the website from scratch and you can now add custom vector layers.
For now this is done by giving the URL of the Mapbox style JSON, let me know if you had something else in mind.
You can check out the future website here: https://gpx.studio/gpx.studio/ and provide feedback on this new repository: https://github.com/gpxstudio/gpx.studio.

@rafal0p
Copy link
Author

rafal0p commented Jun 29, 2024

Maybe I should start with why I thought about such feature.

gpxstudio is the best route planner I've used. And I tried like... all of them. What I lack is integration with Squadrats. I put a draft PR of some approach here, but my initial idea, as described above, was different.

Peeking in "Network" tab while browsing map on Squadrats proves that there are a lot of queries to somedomain.com/somepath/{z}/{y}/{x}.pbf. My hunch is - they are returning these precious, precious squares.

I just tried to create a Custom Layer out of such link in new version, but it doesn't work. Authentication is fine, since some of these calls, made from https://gpx.studio/gpx.studio do return HTTP 200. So the work is to be done someplace else.

Any tips on how to approach debugging it?

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