Is Leaflet 100% free?

if you go to doc example , you will see :

var mymap = L.map('mapid').setView([51.505, -0.09], 13);

L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
    maxZoom: 18,
    attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, ' +
        '<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
        'Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
    id: 'mapbox.streets'

Which means that the tiles are supplied by mapbox.

  • 1
    *Which means that in this example the tiles are supplied by Mapbox.
    – peeebeee
    Jul 12, 2018 at 8:27

1 Answer 1


Leaflet is free ($) and open, with a minimal requirement of keeping the license should you redistribute it.

Leaflet is a library that lets you display - and more - data. It is not a data provider.

Mapbox, OSM and others are data providers/distributors and have their own restrictions / attribution requirements.

So to answer your question, yes, Leaflet is free. Mapbox describe their free/paid offers here.

  • 11
    To add to this answer; You are not obligated to use MapBox layers in a Leaflet Map. you can use any provider or make your own which follow the XYZ standard. Here is a plugin which shows how you can add a wide variety of layers: leaflet-extras.github.io/leaflet-providers/preview Jul 10, 2018 at 3:49
  • As Devdatta Tengshe has mentioned before, Leaflet uses so called the de facto XYZ Standard, which obeys following scheme: 'http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'. Mostafa, you can find more information in Leaflet documentation.
    – Taras
    Jul 10, 2018 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.