LeafLet官方教程 Overview 概览



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 是 一款领先的移动端友好的JavaScript地图开发包。其JS文件仅有大约38KB,涵盖了绝大多数开发人员所需的地图功能。

Leaflet is designed with simplicityperformance 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.

Leaflet的设计注重简洁、性能及可用性。它在所有主流桌面端及移动平台都能有效运行,有着众多的扩展插件,有着漂亮,易用,文档良好的API 以及简洁、易读的源码。


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: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'

L.marker([51.5, -0.09]).addTo(map)
    .bindPopup('A pretty CSS3 popup.<br> Easily customizable.')

Learn more with the quick start guide, check out other tutorials, or head straight to the API documentation. If you have any questions, take a look at the FAQ first.

可以通过 快速入门 学习进一步学习,学习更多教程,或者直接从API文档开始。如果遇到问题,可以查看一下 常见问题解答。


You may also like...