Leaflet是一个开源的地图JavaScript库,它由UNiversal Mind的Vladimir Agafonkin创建的。我们将在一个应用程序中使用这个封装组件。该应用程序给我们展示了一个地图并提供了一个可以移动到地图中指定位置的按钮。

示例代码:

// create a map in the "map" div, set the vIEw to a given plACE and zoom
var map = L.map('map').setView([51.505, -0.09], 13);

// add an OpenStreetMap tile Layer
L.tileLayer('HTTP://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    attribution: '© OpenStreetMap contribuTors'
}).addTo(map);

// add a marker in the given location, attach some popup content to it and open the popup
L.marker([51.5, -0.09]).addTo(map)
    .BINDPopup('A pretty CSS3 popup. 
 Easily customizable.')
    .openPopup();

 

Leaflet 1.3.1 发布 ,移动友好型交互式 JS 地图库
Leaflet 是一个领先的移动友好型交互式 JavaScript 地图库,具备开发人员所需的所有映射功能。它遵循简单、高性能和高可用性的设计思想,可在所有主流桌面和移动平台上高效运行。Leaflet 1.3.1 是一个小的 bug 修复版本:Fix L.TileLayerregression, which caused incorrect tile URLs下载地址:&

发布于 2018-01-21 00:19:12 | 69 次阅读


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务