I have some custom polyline on OSM with this code(我在OSM上使用此代码有一些自定义折线)
var polyline1 = [
[44.772142, 17.208980],
[44.774753, 17.207644],
[44.773964, 17.199587],
[44.770823, 17.199207],
[44.771399, 17.195699],
];
for (var i = 0; i < polyline1.length; i++) {
var polyline = L.polyline(polyline1, {
color: 'red'
}).addTo(map);;
}
I need markers with popup on all this coordinates, this code cannot work with other:(我需要在所有这些坐标上带有弹出标记,此代码无法与其他代码一起使用:)
for (var i = 0; i < polyline1.length; i++) {
var marker = L.marker([polyline1[i][1],polyline1[i][2]])
.bindPopup(polyline1[i][0])
.addTo(map);
}
Is there any solution for this?(有什么解决办法吗?)
ask by goran_bl translate from so