1

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'
}).addTo(mymap);

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 '18 at 8:27
13

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.

  • 10
    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 – Devdatta Tengshe Jul 10 '18 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 '18 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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