LeafLet官方教程 Overview 概览

       前一阵子翻译了一篇Leaflet的官方教程,好像阅读量还不错,继续翻译几篇,或许对大家学习Leaflet能有所帮助吧。Leaflet简洁易用,涵盖了大部分常用的地图功能,即集成了H5的部分优秀特性,又尝试兼容IE7等老版本浏览器。对于开发GISweb应用以及希望通过阅读源码加深GIS知识的开发人员来说,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 是 一款领先的移动端友好的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 以及简洁、易读的源码。

运行效果参见:https://leafletjs.com/

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:

这里我们通过Id为‘map’的div创建了一个地图,并添加了切片图层,之后添加了一个marker,带有一个包含文本的气泡弹窗。

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

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

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文档开始。如果遇到问题,可以查看一下 常见问题解答。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值