dimfeld / svelte-maplibre

Svelte bindings for the MapLibre mapping library
https://svelte-maplibre.vercel.app
MIT License
283 stars 34 forks source link

Allow using mapbox styles & api key #84

Closed pafech closed 8 months ago

pafech commented 8 months ago

Hi team

Thank you for this project! I would like to use mapbox styles instead of maptiler styles for maps built with svelte-maplibre.

dimfeld commented 8 months ago

Yeah, there's no problem with that. It should just work however it's done with normal maplibre.

pafech commented 8 months ago

Maybe then, the mapbox json links changed recently because when using "mapbox://..." as value for the style parameter, maplibre rejects the protocol while the earlier mapbox json url's don't work for me, anymore (json response is {message: "not found"} even for copy pasted urls from mapbox studio. I cannot provide an example since an auth token is involved. Can you provide a working example that is not the colored countries demo tiles?

dimfeld commented 8 months ago

I'm actually not sure what is the correct way to do it either. I did find https://github.com/maplibre/maplibre-gl-js/discussions/1226#discussioncomment-2695633 when looking around for possible solutions, but haven't tried it as I don't have a MapBox account right now.

pafech commented 8 months ago

I found that I would require some processing step to use my mapbox style in maplibre. But re-creating the style in maptiler was much easier and the combination works out of the box, so I close this issue since the link by @dimfeld is relevant and we don't need two tickets adressing the same issue.