osm2vectortiles / mapbox-gl-styles

Example of using Mapbox GL JS with osm2vectortiles
Other
20 stars 13 forks source link

Information about svg and sprite file confusion #2

Open manuelroth opened 8 years ago

manuelroth commented 8 years ago
manuelroth commented 8 years ago

Generating the sprites myself with this tool is not necessary. I just created the style in mapbox studio and then looked for the url where the sprite gets fetched in the network tab.

bildschirmfoto 2016-05-13 um 18 58 20

muesliq commented 7 years ago

Could you help me understand SVGs vs sprites?

In this repo there is one PNG sprite per style, plus the according JSON file. It used to be like this in the original Mapbox styles repo as well.

However today they only seem to use one SVGs per icon, no sprite anymore. (They still speak of "spritesheets" however.) Also exporting a style from Mapbox Studio gives you many SVGs and no sprite.

Are sprites still needed? Do I need to convert SVGs to sprites? Or does GL JS or Tileserver GL do the job?

muesliq commented 7 years ago

(Or should I convert SVGs to sprites the way you show in your screenshot?)

manuelroth commented 7 years ago

Hi @muesliq, from my understanding Mapbox GL JS still doesn't render the SVG's directly. In Mapbox Studio they still serve the sprite.json and sprite.png file. I would recommend you opening Mapbox Studio create a style of your choice and look for the sprite-requests in the network tab as shown above. This is probably the easiest way to get them.

klokan commented 7 years ago

@muesliq see README.md at https://github.com/klokantech/osm2vectortiles-gl-styles for instructions how to convert the original resources to required derivates.

We may probably migrate the styles to a one repo per style while implementing the ideas described at: https://github.com/klokantech/gl-style-package-spec

muesliq commented 7 years ago

Thanks guys! You are the best, as always.

muesliq commented 7 years ago

@klokan Instead of one repo per style I'd rather use one directory per style within one repo, with fonts in one extra directory outside of the style directories, for cross-style usage.

klokan commented 7 years ago

This prevents a possibility to choose which style you want to download for offline use (as .zip) into a mobile application or which style you want to deploy in a tileserver - please this discussion on the repo above.