HNHacker News
TopNewBestAskShowJobs

mourner

1,732 karma · joined July 10, 2011

Engineer at Mapbox, creator of Leaflet, open source enthusiast, algorithms geek, speaker, musician (Obiymy Doschu), baker, father of twin girls, Ukrainian. agafonkin.com
submissionscomments
mourner··on Reimagining projections for the interactive maps era
This was my favorite part too! I think we should start a tradition of adding those to every devlog.
mourner··on Reimagining projections for the interactive maps era
Unlikely — the feature is designed around vector rendering.
mourner··on Reimagining projections for the interactive maps era
Yes, but there’s a difference between a consumer app and an SDK for developers. Changing the default this drastically is a breaking change.
mourner··on Reimagining projections for the interactive maps era
Exactly — this would require reprojecting on every frame, which is too expensive, while we designed the feature to only do this once when loading a tile.
mourner··on Reimagining projections for the interactive maps era
The videos show some extreme cases of this transition, but in practice it feels pretty natural when interacting with the map. Also, we'll definitely continue tweaking it to feel better. It's nearly impossible to make it fully smooth though — projections are hard.
mourner··on Reimagining projections for the interactive maps era
While we're working on a similar feature (globe view [1]), there's a debate on whether it should be turned on by default. Apple Maps adopting it by default is a good argument in favor!

[1] https://github.com/mapbox/mapbox-gl-js/issues/10784

mourner··on Reimagining projections for the interactive maps era
Definitely something we want to explore more, although it's quite a challenge since most map data distribution systems including ours are built around Mercator tiles, which can't show anything beyond ~85 latitude degrees.
mourner··on Reimagining projections for the interactive maps era
Yes, this is on our top list of issues to fix!

https://github.com/mapbox/mapbox-gl-js/issues/11158

mourner··on Reimagining projections for the interactive maps era
Here's a live demo from our examples: https://docs.mapbox.com/mapbox-gl-js/example/projections/

We decided to go with live videos to demonstrate the concepts in motion, and because embedding WebGL vector maps on an already big page might slow it down quite a bit, but definitely something to consider more in the future.

mourner··on Reimagining projections for the interactive maps era
While we have that feature coming too, in short, there are many cases where we want to see the whole world at once. Expanded on this in a comment earlier: https://news.ycombinator.com/item?id=29541230
mourner··on Reimagining projections for the interactive maps era
Globe view (orthographic projection) is coming to GL JS too![1] It had to be implemented differently (rendering to textures and then mapping them on a 3D mesh), but it should be quite fast.

https://github.com/mapbox/mapbox-gl-js/issues/10784

mourner··on Reimagining projections for the interactive maps era
Thanks for the kind words! Good point about autoplay — the current behavior is what we get when disabling controls in Vimeo embeds; worth checking if it's possible to detect whether autoplay is off, and switch the controls on if so.
mourner··on Reimagining projections for the interactive maps era
I'm the author of the article — happy to see this upvoted, feel free to ask any questions about web maps!
mourner··on Reimagining projections for the interactive maps era
Yes, exactly! Globe view doesn't work when you want to show the whole world at once, which is useful for climate visualizations, political maps etc.

Also, many organizations, especially governments and news media, often have their own requirements and conventions when publishing maps — some practical, some purely stylistic. For example, NY Times uses Albers USA for election maps (it has that iconic curved look of state boundaries), and National Geographic uses Winkel Tripel for their world maps.

mourner··on LeafletJS: a JavaScript library for interactive maps
I haven't looked closely into all available plugins, but it seems that you can quickly find suitable options by searching for "leaflet wind" and "leaflet hexbin".
mourner··on LeafletJS: a JavaScript library for interactive maps
This depends on the scientific purpose. For most cases, I'd say yes, but I'm biased, and OpenLayers has the advantage of having all possible features baked in, if you can tolerate the complexity and bloat.
mourner··on LeafletJS: a JavaScript library for interactive maps
Thanks for the kind words, that's really nice to hear!
mourner··on LeafletJS: a JavaScript library for interactive maps
Simply `<img>` elements should be fine for most use cases. WebGL could be used if you need much more fine grained control over the rendering — e.g. custom resampling when resizing like Lanczos filter, special effects, etc. It could also be better for performance but it's not certain and depends on the use case.
mourner··on LeafletJS: a JavaScript library for interactive maps
Leaflet avoids all the complexity by relying on all the rendering done on the server, while all it has to do is load images.

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

mourner··on LeafletJS: a JavaScript library for interactive maps
This is definitely something we want to leave to plugins, since it’s technically involved, there are multiple ways to go about it with different trade-offs, and it’s not necessary for most use cases. There are multiple plugins for it though, the most recent one being Arrugator from one of Leaflet’s maintainers Ivan: https://ivan.sanchezortega.es/development/2021/03/08/introdu...
mourner··on LeafletJS: a JavaScript library for interactive maps
This should be fixed in the master version, we just didn't get our hands on making a patch release yet.
mourner··on LeafletJS: a JavaScript library for interactive maps
I'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

mourner··on LeafletJS: a JavaScript library for interactive maps
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.
mourner··on Apps Getting Worse
Remember Skype? At some point it was the default messenger of most people I know. Then it progressively got worse after being bought by Microsoft, and culminated in a "redesign" which among thousands of bugs also added Snapchat-like stories and other useless shit, and was so terrible that I plain refused to ever use it again, and most of my friends did as well.
mourner··on Maplibre: community-driven Mapbox GL fork
Or, you could help us fix the issue so that all Mapbox maps work great for you? Could you record a screencap of this issue and submit a GitHub ticket? We honestly have never seen anything like this ever reported.
mourner··on Maplibre: community-driven Mapbox GL fork
The exported styles are compatible (if you don't use newer features like terrain & fog) because Maplibre is nearly identical to GL JS v1.13, there were no rendering changes since the fork.
mourner··on Maplibre: community-driven Mapbox GL fork
Sorry, but I never stated such a thing. OpenLayers is great when you want all possible features/formats ever created baked in, and excels for certain use cases such as GIS academia, but Leaflet is still the library of choice for most raster-based maps — intentionally simple, lightweight, very easy to use, carefully designed, extremely stable, extensible and working beautifully.
mourner··on Maplibre: community-driven Mapbox GL fork
Can you please report this on our issue queue? From a cursory search, it doesn't look like anyone complained about scroll zoom on Firefox under Linux before. We'd be happy to fix this after hearing more details. https://github.com/mapbox/mapbox-gl-js/issues
mourner··on Why you can’t buy a thermapen on Amazon (2016)
As someone who got heavily into baking bread / pastry and occasionally meat during the pandemic, I can't recommend Thermapen enough — it's the ultimate cooking thermometer. Also, I live in Europe so I ordered it from the UK, and ETI's support is awesome and they ship really fast.
mourner··on A new way to make maps with OpenStreetMap
This is very nice! Happy to see a few of my libraries in the dependencies :)

Also check out https://github.com/kothic/kothic-js, an older but similar attempt at making a full-fledged map renderer using 2D Canvas. It has a pretty good label rendering in particular which you might find useful.

← PreviousPage 3 of 7Next →