Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants