var somePoints = [];
for (var rowIndex in rows) {
somePoints.push(L.latLng(rows[rowIndex].Lat, rows[rowIndex].Lon));
}
var pl = L.polyline(somePoints);
pl.addTo(map);
var decorator = L.polylineDecorator(pl, {
patterns: [
{offset: 0, repeat: 50, symbol: L.Symbol.arrowHead({pixelSize: 8, polygon: false, pathOptions: {stroke: true}})}
]
}).addTo(map);
答案 0 :(得分:0)
您在html文件中导入了polylinedecorator脚本,
<script src="../dist/leaflet.polylineDecorator.js"></script>
听起来很愚蠢,但由于这个错误我多次挠头。