
Leaflet – A JavaScript library for mobile-friendly interactive maps - simon04
http://leafletjs.com/2018/01/15/leaflet-1.3.0.html
======
NelsonMinar
Great news, Leaflet is the standard for open source web maps. This release
looks to have a lot of nice quality of life improvements.

I've been a little worried about Leaflet's future vs. Mapbox GL JS. That's
also an excellent open source map library, but is based entirely on new
technology (vector maps and GL) and favors using Mapbox's paid services. I
think Leaflet has a long life ahead for folks who want something simpler,
something that can easily composite raster data from many sources.

~~~
trynewideas
I switched a project over from Leaflet to Mapbox GL JS for the better-
integrated vector tile support and better mobile rendering performance. Raster
tiles still have value, but I wouldn't call vector tiles "new"; they're mature
enough that they should start phasing raster tiles out, especially for
projects that need a wide range of zoom levels, tight bandwidth requirements,
or a lot of flexible, overlapping, and/or dynamic layers.

Thanks to tools like Maputnik, tippecanoe, and TileServer GL, I also had no
problems using Mapbox GL and vector tiles without once touching a Mapbox
service.

I still use Leaflet for most raster and simple vector maps simply because it
is light and modular enough that I can get what I want, but the open source
tools are there to reap the good stuff from Mapbox GL while avoiding the
proprietary bits of Mapbox.

~~~
NelsonMinar
I'd love to see a writeup of using Mapbox GL without Mapbox services. I know
it's possible in theory but it seems fairly awkward. Particularly interested
if there are any map services you can easily use, free or paid, rather than
standing up a vector tile server of your own.

~~~
executive
Not awkward at all: [https://openmaptiles.org/](https://openmaptiles.org/)

------
rhcom2
Someone made a nice wrapper for react I've been using with good success.

[https://github.com/PaulLeCam/react-
leaflet](https://github.com/PaulLeCam/react-leaflet)

~~~
k__
Didn't have a good experience with this kind of React wrappers, I used a
Leaflet wrapper for a few years.

They always lack behind and try to force the React lifecycle and composition
onto the library. Often this leads to leaking abstractions, which get uglier
and uglier with time. Updating is also not a charm.

I stopped using them and simply build one component as facade, then use props
as interfaces to the lib while letting the lib do its thing the way it wants
behind that component.

~~~
smrq
Not to discount your experience, which is pretty consistent with my own, but
what you've just described is writing your own wrapper component.

I think there's something to be said for doing it yourself, particularly when
the available options make you have to care about their internals anyway. But
perhaps some of that effort might be put towards making a better open-source
wrapper.

~~~
mhink
I've worked a little bit with libraries like this (react-mapbox-gl) and I
think the point GP is making is more like this:

    
    
        <3P.Wrapper>
          <3P.Foo>
            <3P.Bar
              subcomponent={props}
            />
          </3P.Foo>
          { someCondition ?
            <3P.Quux
              onCrunch={doQuack}{
            />
          }
        </3P.Wrapper>
    

where mounting and unmounting those child components interacts with the
wrapped API. Contrast that with

    
    
        <3P.BasicWrapper
          useFoo
          useBar
          useQuux={someCondition}
          onQuuxCrunch={doQuack}
        />
    

which is less suitable for generic use, but easy enough to write (and modify
later) that you probably don't need a highly-generic wrapper.

------
davito88
Folium is a nice python wrapper for Leaflet: [https://github.com/python-
visualization/folium](https://github.com/python-visualization/folium)

~~~
cuchoi
Folium is amazing. It makes it relatively easy to make a map like this one:
[http://fernandoi.cl/mapascomunales/primarias/primarias.html](http://fernandoi.cl/mapascomunales/primarias/primarias.html)

~~~
brailsafe
Do you have any supplementary materials, such as a tutorial or git repo to go
along with it? I've been using the d3.geo cli for something similar.

~~~
cuchoi
I do not have any specific recommendations, aside from this guide to start:
[https://blog.dominodatalab.com/creating-interactive-crime-
ma...](https://blog.dominodatalab.com/creating-interactive-crime-maps-with-
folium/)

------
trynewideas
I was curious why Leaflet, which has been around a while, popped up today.
Looks like it's because 1.3.0 is out, but as far as I can tell it's a bugfix
release. The most exciting new feature (to me, at least) is iterating over
layers in a LayerGroup with eachLayer, which is neat but hardly
groundbreaking.

Am I missing something? I love Leaflet, but I thought it was already one of
the standards for maps on the web.

------
expertentipp
One of the most efficient, snappy, and lightweight frameworks for 2D maps with
overlays and simple vector drawing capabilities. Clear and simple API. Keep
doing great job!

------
giancarlostoro
Really great library, I had to use Bing Maps v8 API and it was not the best
mapping library, the documentation is not very impressive, and it's just not
as feature heavy as I'd hoped and the features get confusing really quickly.

We wound up using Leaflet to handle everything else but the imagery is all
from Bing Maps instead. I've run into edge cases I've had to figure out with
Leaflet, but at least the JS ecosystem is big enough to where you can always
find generic solutions that work with the existing mapping library.

------
mikerg87
Is [http://openlayers.org/](http://openlayers.org/) the jQuery of web mapping
now ?

~~~
lucideer
leaflet and open layers have different use-cases.

This is a massive oversimplification, but roughly, one way of thinking of it
is that leaflet is more suited to consumer-facing web maps and openlayers is
more appropriate for heavy gis workloads; e.g. a web app for visualising
business locations worldwide vs a web app for manipulating SHP data and EPSG
projections.

That's not to say Leaflet can't be used for the latter -- e.g. in combination
with some other tools like turf -- but OL is being developed with this kind of
stuff on mind.

------
kaishiro
We recently launched a project that relies heavily on leaflet for generating
custom, interactive maps from CMS data and once we got the hang of it it was
such a breeze to work with. Really enjoyed it and got the wheels spinning on
other pet projects that could utilize it.

------
buovjaga
Fun fact: LibreOffice Online uses Leaflet for tile rendering.

~~~
thinkingemote
It's also used in GTA video game for the map browsing.

~~~
mynewtb
Can you share more information on that?

------
parski
When I was still in school I used Leaflet for a product and I remember being
really impressed by it then. This must have been around 2013. I scripted huge
AutoCAD exports with AutoLISP and sliced them up with ImageMagick to make
custom zoomable maps of schools and hospitals. They would be annotated with
BIM data and used for utility inspections. I'm glad to see it's still alive
and kicking!

------
ravenstine
Leaflet has been a pleasure to work with. I recently used it to build animated
wildfire maps, such as this one of the Thomas Fire in California.
[https://firetracker.scpr.org/thomas-fire-santa-
barbara-2017](https://firetracker.scpr.org/thomas-fire-santa-barbara-2017)

------
NKosmatos
One more vote for Leaflet. Just started using it for one of my side projects
(my long term get rich plan) and it’s super easy to create custom maps exactly
how you want them. There are also many plugins allowing you to further enhance
the functionality. Now, if only I could find some extra spare time to work on
it...

------
kyriakos
great library. been using it in some GIS projects I am involved in. glad to
see development continues.

------
zbennett10
I love Leaflet. We are currently using it for some applications at my work.
It's super simple and easy to extend

