Analysing Leaflet

Leaflet

Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. Weighing just about 38 KB of JS, it has all the mapping features most developers ever need.

Leaflet is designed with simplicity, performance and usability in mind. It works efficiently across all major desktop and mobile platforms, can be extended with lots of plugins, has a beautiful, easy to use and well-documented API and a simple, readable source code that is a joy to contribute to.

Here we create a map in the ‘map’ div, add tiles of our choice, and then add a marker with some text in a popup:

var map = L.map(‘map’).setView([51.505, -0.09], 13); L.tileLayer(‘https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png’, {    attribution: ‘© <a href=“https://www.openstreetmap.org/copyright”>OpenStreetMap</a> contributors’ }).addTo(map); L.marker([51.5, -0.09]).addTo(map)    .bindPopup(‘A pretty CSS3 popup.<br> Easily customizable.’)    .openPopup();

Leave a Reply

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