动画
一个提供动态闪烁点的 Leaflet 插件。支持 Leaflet0.7.0 以上版本,兼容现代浏览器。
引入插件 L.Icon.Pulse.js 包括两种方式:
下载 L.Icon.Pulse.js
1.进入 github 下载 L.Icon.Pulse.js,下载地址为:
https://github.com/mapshakers/leaflet-icon-pulse
2.<script>标签与<link>标签引入:
<script src="L.Icon.Pulse.js"></script>
<link rel="stylesheet" href="L.Icon.Pulse.css"/>
直接通过cdn引入
<script src="http://iclient.supermap.io/libs/leaflet/plugins/leaflet-icon-pulse/L.Icon.Pulse.js"></script>
<link rel="stylesheet" href="//iclient.supermap.io/libs/leaflet/plugins/leaflet-icon-pulse/L.Icon.Pulse.css"/>
//遍历result数组所有的要素点,转换坐标信息,添加动画Icon
var features = [{type: "Feature", coordinates :: [11395368.55482056, 2707397.005707026], id: 113},
{type: "Feature", coordinates :: [11395368.55482056, 2707397.005707026], id: 120}]
features.map(function (feature) {
var latLng = L.CRS.EPSG3857.unproject(L.point(feature.coordinates));
markers.push(L.marker(latLng,{icon: pulseIcon}));
});
//将动画标识添加到地图上
resultLayer = L.featureGroup(markers).addTo(map);