English
Open in Telegram

Thread wonder if there could be a good middle ground, where you render the things to a vector image format like SVG, instead of…

4 messages · –
L
wonder if there could be a good middle ground, where you render the things to a vector image format like SVG, instead of dumb PNGs that indeed multiply for every possible language or set of features you want to toggle on and off
  1. I
    That’s basically what MVT is though (and soon MLT). It’s just an efficient binary format. Renderers like MapLibre GL JS use hardware acceleration where available, which means most phones are quite performant. Desktops and laptops it kinda depends on whether you have a discrete graphics card. On my laptop for example there is basically no energy impact. On my desktop, I can hear fans go up… but that’s also true of many websites with crappy JS too, so… 🖕
    1. L
      how come it's so much heavier than a normal SVG then? Maybe that it needs to be parsed in JS instead of in native code that the browser invokes when it is asked to render an <img src=x.svg>?
      1. I
        I guess I’d have to see something resembling a fair comparison. I’m not sure I’ve ever seen an SVG with as much detail as a typical map tile. > Maybe that it needs to be parsed in JS instead of in native code I would be pretty surprised if the parsing dominates any slowness you’re seeing. JS actually gets fairly fast with JIT (what every web browser does). The majority of the work is in rendering graphics, and those are all passed off to native APIs. WebGL is just passing off to hardware. The fact that I don’t see any slowness suggest that it’s a question of GPU, not CPU. A typical map tile render does a lot more than a typical SVG so it’s hard to make an apples-to-apples comparison. Map tiles need to support a range of zoom levels, need label placement rules in case of collisions, etc… I don’t think SVG can even do this. Vector maps also (typically, but not always; I think OpenLayers is an exception) have a different text rendering path. Map labels are usually given “halos” to make them more readable, and may have different scales or other transforms. This is a different (GPU as well) path but it’s also super efficient on most hardware (after you load the textures, it all happens on-GPU). Doing this in regular font rendering stacks is clunky and significantly less efficient than the SDF technique they borrowed from the game industry. I’m quite sure these aren’t the cause of any preformance differences you’ve seen, but I bring them up to show why SVG is typically not a suitable format for electronic maps.
OOpenStreetMap DevOpenStreetMap Dev@OpenStreetMapDev · group
351members1writing in 30 days
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count