Mapbox GL and Leaflet 2.0 Alpha Comparison

A few years ago, I had a project where I had to create a simple web map with some data that I had created. At the time, I debated whether to use MapBox GL, MapBox JS (which uses Leaflet in the background), or just Leaflet. This post on Stack Overflow helped sway my decision to use MapBox GL. MapBox GL uses Web GL to render vector tiles, which results in a faster, smoother display. I also like the style of the Mapbox basemaps. I completed the project and was happy with the results.

Recently, I had to create another web map with some home-grown data. I re-used a lot of the code that I had created for the earlier one, and was, again, happy with the results.

But then I saw that Leaflet has released a 2.0 Alpha version, and I was curious to try it. So I decided to create the same map using Leaflet and compare the two. The result is here: https://shamangeo.dev/mapbox-leaflet/, with both maps side-by-side on the same page.

What do you think? Which do like better?

I’m pretty sure Leaflet 2.0 doesn’t use Web GL, as there’s no <canvas> element in the DOM. Still, you can create pretty, fully-functional web maps. I still like the look and feel of the Mapbox one better, but either are good options.

Full source code is here: https://github.com/bjs339/mapbox-leaflet-comparison

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top