将弹出窗口添加到传单路由机航路点标记
Adding popups to leaflet routing machine waypoint markers
route = L.Routing.control({
waypoints: test
}).addTo(map);
我正在使用传单路由机。 test是一个L.latlng(float, float)的数组。我想向每个单独的航路点标记添加一个带有消息的弹出窗口。知道我该怎么做吗?
试试这个
L.Routing.control({
createMarker: function(waypointIndex, waypoint, numberOfWaypoints) {
return L.marker(wp.latLng)
.bindPopup('Hello');
},
...
}
route = L.Routing.control({
waypoints: test
}).addTo(map);
我正在使用传单路由机。 test是一个L.latlng(float, float)的数组。我想向每个单独的航路点标记添加一个带有消息的弹出窗口。知道我该怎么做吗?
试试这个
L.Routing.control({
createMarker: function(waypointIndex, waypoint, numberOfWaypoints) {
return L.marker(wp.latLng)
.bindPopup('Hello');
},
...
}