Hacker News new | ask | show | jobs
by mourner 2382 days ago
Leaflet author here! Just wanted to note that if you haven't looked into OpenLayers in a few years, you absolutely should — it's astonishing how much it progressed: from something that I was so frustrated with that it prompted me to write Leaflet in the first place (11 years ago) to a modern, fast, well-engineered and lovingly maintained library.

It's especially great when you're doing complex GIS stuff and need a ton of features and formats supported out of the box. As for other libraries, I'd recommend Leaflet for simple maps, and Mapbox GL for rich, highly interactive apps that benefit from vector rendering tech (I'm biased since I contributed to both), but it's great to have OpenLayers in the mix — there's a library for anyone's needs, cross-inspiration moves all three forward, and the mapping software landscape in general is greater than it has ever been.

5 comments

Thanks for creating Leaflet and Mapbox GL!

Do you have any specific examples of "complex GIS stuff" (Uses OpenLayers) or a "highly interactive app" (Uses MapBox GL)?

Are there any big feature gaps from leaflet->mapbox-gl that developers should consider when choosing a mapping library?

Note: I didn't create Mapbox GL, I'm just a part of the core team: https://github.com/mapbox/mapbox-gl-js/graphs/contributors

Don't have any particular OpenLayers examples in mind at the moment but it's very heavily used in government, enterprise and academics — sectors that often need advanced projections, use various obscure formats / protocols and prefer all the features to be packed in one product and maintained consistently by one team.

For Mapbox, here's a showcase https://www.mapbox.com/showcase. It especially shines in apps that need to render hundreds of thousands of features at once, maximum customization in how the map looks and feels, updating map appearance dynamically in real time, or some cool animations.

In terms of features, Leaflet has a huge plugin community and there's a plugin for pretty much any feature since it has been around for 8 years, although their quality varies (the core is top-notch though). Mapbox GL will need to catch up on that front certainly, but on the other hand, there are things that are simply not possible with raster-based mapping libraries — things like making any feature you see interactive, changing the map appearance in real time, rendering millions of features (with high perf viz features like clustering, heatmaps, advanced labeling etc.), and general smoothness of user experience (smooth zoom transitions, labels adjusting to rotation and pitch, etc.).

To answer your question: Leaflet.draw is superior to mapbox-gl-draw. mapbox-gl-draw is very lightly maintained and is not as full featured as Leaflet.draw. mapbox-gl-draw sounds like it may also be no longer maintained by Mapbox in the future either - refer to the recent GitHub issue on the repos that hints at this.

There are mapbox-gl-draw plugins to make it comparable to Leaflet.draw but these are features IMO that mapbox-gl-draw probably should have had in the first place.

So, as someone who works with mapbox-gl-js a lot, that is something I see as a gap.

What are the biggest features gaps you think are missing from Leaflet.draw -> gl-draw? definitely hear you on the "very lightly maintained" front, but I may be interested in submitting some PRs to gl-draw that mirror Leaflet.draw functionality if there's specific functionality folks are looking for
For complex GIS stuff in OpenLayers, you can do stuff like connect to a GeoServer instance and edit features with a ready made protocol like WFS-T. I have been involved in making these kind of tools for enterprises, like editing address points and routing paths in the browser, with transactions and edit sets and things like that.

When I was working with this stuff, Leaflet was more "view only" and not so much editing. This was back in the "have to support IE6" days. I remember trying Leaflet for a simple project, but gave up since I could not set a bounding box for panning (the map was only supposed to show a limited area of the world), while OpenLayers seemed had every API feature one could wish. Although more bloated, less polished :)

Thank you for building leaflet. It (and scrapy) are how I wound up finding the house I live in now - a quirky, dirt cheap cottage I'd never have taken note of without the tools to filter and visualize a whole country's listings.
You wouldn't happen to have the tools to still do that, would you?
I used them to make gaffologist.com if you happen to be in Ireland.
I don't, but well done all the same.
What country and how did you get their listings?
Ireland (helps that it's small!) And Scrapy
Thank you so much for all the work you put into creating and maintaining Leaflet. It’s pretty remarkable how much time and energy you (and others, of course) put into making something so complex so intuitive.
I'm gonna hop on the bandwagon and thank you as well. My senior project was built with Leaflet.
hey thanks for building leaflet