LeafletJS: a JavaScript library for interactive maps
71–80 of 91 posts
Re: LeafletJS: a JavaScript library for interactive maps
#72Re: LeafletJS: a JavaScript library for interactive maps
#73Re: LeafletJS: a JavaScript library for interactive maps
#74I'm the original author of Leaflet, ask me anything! Very happy every time I see it shared on the HN frontpage. If you're curious about the story behind Leaflet and how and why it was born 10 years ago, here's a short 13-minute presentation on this: https://youtu.be/NLbyHffKQuU
Can you please share your thoughts on advantages and disadvantages of using WebGL vs just "" elements (like on Leaflet homepage) to render tiled photos that require deep zoom.
I checked how some photo zoom solutions are made. For example, Google Photos uses tiled img elements, while online photo viewer in Apple iCloud used webgl to render. And I'm not sure what's best and why.
Re: LeafletJS: a JavaScript library for interactive maps
#75One thing question that I have. If I want to use an image as a source of my tiles. Should I split the image into chunks to load them when user moves the map around? Or is there any other way to do that? Are there any tools that would help split an image into those chunks?
Re: LeafletJS: a JavaScript library for interactive maps
#76I’ve used Leaflet a ton and love it. But I recently tried using it with a vector-based render method (as opposed to the rastered tiles Leaflet uses by default) and couldn’t find anything that worked anywhere near as easily and simply as Leaflet’s standard rendering. I don’t blame the Leaflet folks for this really, rendering map data locally via WebGL is not a simple task. But it’s been depressing to see folks like Ma…
I'm the original author of Leaflet and also (as of last 8 years) core developer of Mapbox GL JS. Not pursuing vector rendering in Leaflet is intentional — it's designed to be extremely small, simple and lightweight. Vector map rendering is so incredibly difficult to do right that it's pretty much impossible without many years of team effort by top engineers and millions in investment.
Re: LeafletJS: a JavaScript library for interactive maps
#77My only wish is that I want to generate my own raster tiles, but I've seen that planet.osm now is 1.4TB, although the .PBF is only about 60GB.
I wish I could generate tiles of areas I want, but it seems the software requirements are pretty big, I'd rather use spatialite than postGIS, and I have no idea how to generate those tiles. There are a lot of GIS softwares, and most of them are pretty heavy, not to mention there are a lot of different formats which bloats everything.
Re: LeafletJS: a JavaScript library for interactive maps
#78Leaflet is fantastic. One of the more interesting use cases I've seen for it is the Guild Wars 2 wiki. They use it heavily to display the game map for regions, areas of interests etc. It's quite impressive, and very useful as a player! https://wiki.guildwars2.com/wiki/Kryta#Interactive_Map
Re: LeafletJS: a JavaScript library for interactive maps
#79Earlier quoted context omitted.
I'm the original author of Leaflet and also (as of last 8 years) core developer of Mapbox GL JS. Not pursuing vector rendering in Leaflet is intentional — it's designed to be extremely small, simple and lightweight. Vector map rendering is so incredibly difficult to do right that it's pretty much impossible without many years of team effort by top engineers and millions in investment.
can you elaborate on what the biggest challenges are? to a naïve bystander is hard to understand why it would be so hard.
Rendering vector data on the browser with the level of detalization necessary for modern cartography (hundreds of thousands of points in a single view) is not possible with the usual technologies like Canvas & SVG. The only option is WebGL, which is basically a very efficient way to draw triangles. You have to implement all the logic of turning all the data into triangles (tessellating lines, breaking down polygons, implementing anti-aliasing, figuring out collision detection between labels) from scratch, reimplementing difficult computer graphics algorithms from decades ago. This is a MASSIVE amount of work, and hard to do in a performant way.
Moreover, client-side vector rendering has even more complexity than server-side technologies like Mapnik, because you can't just render something once — you have to do it in real time, 60 frames per second, considering context, making fluid animations when zooming, panning and loading data, etc.
You can learn more details about this in my presentation on vector maps e.g. here: https://youtu.be/v-V8SS14R48