4 ms·
Seeing canvas used always makes me sad. Why can’t maps use SVG? If there are blockers for that, I’d rather see the web resolve those. canvas is a black box for
by felixfbecker 5y ago
Seeing canvas used always makes me sad. Why can’t maps use SVG? If there are blockers for that, I’d rather see the web resolve those. canvas is a black box for screen readers, crawlers, the semantic web. You end up reimplementing a DOM anyway for accessibility, or not, if you don’t care about accessibility, which sucks.
- mhoad 5y agoI guess it would be fair to ask if canvas can eventually become something to meet those challenges. Not by itself obviously but when you consider things like Flutter built on top of it. It’s not there yet obviously but I could totally see a path in the future where it handles all those use cases just fine and do so with better performance.
- no_circuit 5y agoSVG is XML which can have security issues due to parsing. And to top it off SVG has a script tag itself. Basically a XSS vector.
- kaba0 5y agoHTML also has a script tag, hell js has an eval! Should we stop using those as well?
- zdragnar 5y agoI've been part of an implementation of a global map done in SVG. Only path data that was sent down was national borders. We had to do many multiple levels because the volume of data to get the paths drawn accurately was both too big and too slow until you zoomed in a bit and could start loading individual countries, then individual regions. Rendering rasterized tiles from a tile server onto a canvas means that, on the client, performance is identical regardless of zoom level. Basically, we went with SVG because only drawing the borders looked cool, and we could fake some clever zoom animations, and we couldn't afford to purchase custom tile data and run a tile server. As for interactive bits, those are frequently done with DOM nodes positioned over the map. Maps make for a pretty crap user experience for screen readers, so if you really wanted to make the information accessible, you're better off putting it in a separate interface. That, and I can honestly say I have yet to see a map that would make sense to have a crawler attempt to index.