参考:https://www.cnblogs.com/vichang/p/9438870.html

leaflet-antvPath官网:https://github.com/rubenspgcavalcante/leaflet-ant-path

leaflet-antvPath官网2:https://rubenspgcavalcante.github.io/leaflet-ant-path/

示例:

<html>

<head>
<meta charset="UTF-8">
<!-- <link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" /> -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<link rel="stylesheet" href="./dist/leaflet.css">
<script src="./dist/leaflet.js"></script>
<script src="./dist/leaflet-ant-path.js"></script>
<!-- <script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script> -->
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=1.4.14&key=781070f0aec19a13b3e2615a0c131d4a"></script>
<style>
body {
margin: 0px;
} #heading {
text-align: center;
padding: 20px;
background: #333;
color: #CCC;
} a {
color: #3388ff;
} #map {
position: absolute;
height: 100%;
width: 100%;
background-color: #333;
} .leaflet-canvas-layer {
opacity: 0.55;
}
</style>
</head> <body>
<div id="map"></div>
</body>
<script>
//------------------------------------------------------------------------ var map = L.map('map', {
center: [31.95789128, 120.64626101],
zoom: 11,
maxzoom: 18,
minzoom: 1,
zoomControl: false, // 是否默认缩放控件添加到地图
editable: true, // 用于测绘
});
L.tileLayer('http://mt3.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&s=Galile&x={x}&y={y}&z={z}', {
attribution: '<a href="#">google leaflet</a>',
maxZoom: 18,
}).addTo(map);

// ----------------地图标记点位---------------------
// L.marker([31.95789128, 120.64626101]).addTo(map)
// .bindPopup('info')
// .openPopup();
// -----------------地图标记点位--------------------------
  //--------------------------------------------------------------------------------------------- let arrs = [
[31.30, 120.58], // 苏州市
[31.32, 120.63], // 平江区
[31.30, 120.63], // 沧浪区
[31.95789128, 120.64626101],
[31.30, 120.75], // 虎丘区
];


//---------------------高德地图--------------------------
// var polygon = L.polygon(arrs, { // color: 'green', // fillColor: '#f03', // fillOpacity: 0.5 // }).addTo(map); 

// var map = new AMap.Map('map', {
// zoom: 11,//级别
// center: [120.64626101, 31.95789128],//中心点坐标
// viewMode: '3D'//使用3D视图
// });

//---------------------高德地图-------------------------- //---------------------leaflet-antvPath--------------------------
var antPath = L.polyline.antPath;
var path = antPath(arrs, {
"paused": false,   //暂停 初始化状态
"reverse": false,  //方向反转
"delay": 3000,    //延迟,数值越大效果越缓慢
"dashArray": [10, 20], //间隔样式
"weight": 5,    //线宽
"opacity": 0.5,  //透明度
"color": "#0000FF", //颜色
"pulseColor": "#FFFFFF"  //块颜色
});
path.addTo(map);
//---------------------leaflet-antvPath-------------------------- </script> </html>

leaflet antvPath示例的更多相关文章

  1. leaflet入门(一)示例

    代码示例: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ...

  2. Leaflet学习笔记-基础内容

    为什么选择Leaflet 开源,且代码仅有 31 KB,但它具有开发人员开发在线地图的大部分功能(80%的功能) 是不是比arcgis要小很多呢 官网:http://leafletjs.com/ 劣势 ...

  3. Leaflet API翻译

    转自: http://jsrookie.iteye.com/blog/2318972(上) http://jsrookie.iteye.com/blog/2318973(下) L.Map API各种类 ...

  4. leaflet入门(五)API翻译(下)

    L.PointConstructor(函数构造器)Properties(属性)Methods(方法) L.BoundsConstructor(函数构造器)Properties(属性)Methods(方 ...

  5. leaflet入门(四)API翻译(上)

    L.Map L.Marker L.Popup L.Map API各种类中的核心部分,用来在页面中创建地图并操纵地图. Constructor(构造器) 通过div元素和带有地图选项的描述的文字对象来实 ...

  6. Leaflet API 翻译(二)

    摘自:http://www.ithao123.cn/content-824673.html L.Point 显示以像素为单位的点的x,y坐标. 所以接受点对象的leaflet方法和选项都也接受他们简单 ...

  7. leaflet视频监控播放(附源码下载)

    前言 leaflet 入门开发系列环境知识点了解: leaflet api文档介绍,详细介绍 leaflet 每个类的函数以及属性等等 leaflet 在线例子 leaflet 插件,leaflet ...

  8. leaflet的入门开发(一)

    2016年9月27日—1.0leaflet,最快的,最稳定和严谨的leaflet,终于出来了! leaflet是领先的开源JavaScript库为移动设备设计的互动地图.重33 KB的JS,所有映射大 ...

  9. leaflet的入门开发

    2016年9月27日—1.0leaflet,最快的,最稳定和严谨的leaflet,终于出来了! leaflet是领先的开源JavaScript库为移动设备设计的互动地图.重33 KB的JS,所有映射大 ...

随机推荐

  1. 「CF446C」 DZY Loves Fibonacci Numbers

    「CF446C」 DZY Loves Fibonacci Numbers 这里提供一种优美的根号分治做法. 首先,我们考虑一种不太一样的暴力.对于一个区间加斐波那契数的操作 \([a,b]\),以及一 ...

  2. HTML表单__表单元素属性

    看完"HTML表单__表单元素"那一节的同学会发现,同是input标签,type属性值不一样的时候,input类型完全不一样.type就是input的一个属性,除type之外,还有 ...

  3. yoyogo v1.7.6 增强程序优雅退出和K8s Readiness检查

    YoyoGo (Go语言框架)一个简单.轻量.快速.基于依赖注入的微服务框架( web .grpc ),支持Nacos/Consoul/Etcd/Eureka/k8s /Apollo等 . 本次更新增 ...

  4. ES6 Class类

    在ES6中,class (类)作为对象的模板被引入,可以通过 class 关键字定义类.class 的本质是 function.它可以看作一个语法糖,让对象原型的写法更加清晰.更像面向对象编程的语法类 ...

  5. 【codeforces1058】Vasya and Golden Ticket 枚举+暴力+模拟

    #点击传送 题目描述 Recently Vasya found a golden ticket - a sequence which consists of nn digits a1a2-ana1a2 ...

  6. 第十三篇 -- 关于C++不支持int

    如果是exe的程序的话,DWORD是非法字符,所以需要添加头文件"windows.h"

  7. macOS下将可执行文件索引位置增添到PATH中

    一.shell中可执行文件的两种执行方式 (1)绝对路径 比如,打开电脑上安装的python3,使用绝对路径方式打开为: /usr/local/bin/python3 (2)使用PATH 将pytho ...

  8. 深入刨析tomcat 之---第3篇 HTTP/1.1 长连接的实现原理

    writedby 张艳涛 长连接是HTTP/1.1的特征之一,1.1出现的原因是因为一个客户请求一个网页,这是一个http请求,这个网页中如果有图片,那么也会变为一个http请求,对于java客户端, ...

  9. LinkedHashMap 与 LRUcache

    LRU 缓存介绍 我们平时总会有一个电话本记录所有朋友的电话,但是,如果有朋友经常联系,那些朋友的电话号码不用翻电话本我们也能记住,但是,如果长时间没有联系了,要再次联系那位朋友的时候,我们又不得不求 ...

  10. 【阿菜用工具】利用 Web3.js 在 ganache 上部署以及调用智能合约

    合约部署 要部署的合约 pragma solidity ^0.4.23; contract test { uint256 value; function setValue(uint256 _value ...