百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

Leaflet.toolbar

> 编程语言
开源

适用于 Leaflet 地图的灵活、可扩展的工具栏。

197 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

适用于 Leaflet 地图的灵活、可扩展的工具栏。

Leaflet.Toolbar

Leaflet.Toolbar provides flexible, extensible toolbar interfaces for Leaflet maps.

Examples

View examples for control-style and popup-style toolbars using Leaflet.draw, as well as a minimal example. NOTE: If you want to use this library with Leaflet.draw, you should use the toolbars provided with leaflet-draw-toolbar.

Usage

Include Leaflet.Toolbar in your JavaScript project using npm install leaflet-toolbar.

You can then include Leaflet.Toolbar in your web application by adding the following HTML tags (paths below are relative to your project's root):

Leaflet.Toolbar exports two toolbar styles that can be used out of the box: a popup-style toolbar, and a control-style toolbar. To instantiate a control-style toolbar and add it to the map, use:

javascript
new L.Toolbar2.Control({
	actions: [MyAction1, MyAction2, ...]
}).addTo(map);

For more information, see the API Reference and Building custom toolbars on the wiki.

Contributing

Contributors are welcomed!

Once you've cloned this repo, you'll need to run npm install in the project root to install the development dependencies using npm.

Leaflet.Toolbar uses grunt to run development and build tasks. You'll need to have the grunt command line interface installed: npm install -g grunt-cli. Once you've done this, running grunt without any arguments in the project root will watch the project source and lint, test, and build whenever the source files are modified. Additional tasks that may be useful for development are specified in the Gruntfile.

Testing

Run the test suite using npm test.

Documentation and Examples

The examples in the gh-pages branch can be updated using Grunt: grunt gh-pages. This will create a new commit and push that commit to your gh-pages branch on GitHub. If you'd like to simply preview the gh-pages branch, you can run grunt gh-pages --gh-pages-push false.

Contributors are encouraged to open pull requests early to facilitate discussion about proposed changes!

Please follow the Leaflet contribution guide.

Thanks

Thanks to @jacobtoye for the excellent Leaflet.draw library which was the inspiration for Leaflet.Toolbar. And, of course, thanks to @mourner for a fantastic open-source mapping library.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言