js input上传单文件_让我们使用传单js将交互式地图添加到网站

js input上传单文件

I’m working on a new project that requires lots of maps. When it comes to maps it has to be simple and comprehensive. Adding maps to a website is not very hard but making them interactive, lightweight and mobile-friendly is kinda difficult. That’s when Leaflet.Js comes to the rescue. So what is this Leaflet thing and why is it so special? Let me explain.

我正在一个需要很多地图的新项目中。 当涉及到地图时,它必须简单而全面。 将地图添加到网站并不难,但要使其具有交互性,轻巧性和移动友好性,则有点困难。 那就是Leaflet.Js进行救援的时候。 那么,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库,用于移动友好的交互式地图。 它仅重约38 KB的JS,具有大多数开发人员所需的所有映射功能。

In addition, 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.

此外,单张设计与简单性,性能可用性的初衷。 它可以在所有主要的台式机和移动平台上高效运行,可以通过许多插件进行扩展,并具有美观,易于使用和文档完善的API

When it comes to leaflet plugins, It’s so easy to use and very reliable. I used a few plugins already. Scale factor, fullscreen, easybutton, zoom are few of them. It made my work easier. Here’s an example map with markers, popups.

当涉及传单插件时,它是如此易于使用且非常可靠。 我已经使用了一些插件。 比例因子,全屏,快捷按钮,缩放比例很少。 它使我的工作更加轻松。 这是带有标记,弹出窗口的示例地图。

Image for post
example map
范例地图

It’s easy to create a map using Leaflet, Here’s the code for the above map.

使用Leaflet创建地图很容易,这是上面地图的代码。

Now all you have to do is create a div element with an id named map.

现在,您要做的就是创建一个ID为map的div元素。

<div id='map'></div> Just like this.

<div id='map'></div>就像这样。

It’s that easy! I hope you learned something about this map plugin and make sure to go through the documentation before using this. See you in the next one. Peace! ✌️

就这么简单! 我希望您了解了有关此地图插件的知识,并确保在使用前先阅读文档 。 下一个见。 和平! ✌️

翻译自: https://medium.com/javascript-in-plain-english/lets-add-interactive-maps-to-websites-using-leaflet-js-93f548b32263

js input上传单文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值