Open dmaglio opened 3 years ago
@dmaglio, you need to use the L.Routing.Plan, plan has the createMarker function.
const plan = new L.Routing.Plan(waypoints, {
createMarker: (i, wp, nWps) => {
return L.marker(wp.latLng).bindPopup('Message');
},
});
const control = L.Routing.control({
show: false,
waypoints,
routeWhileDragging: false,
plan,
addWaypoints: false,
}).addTo(map);
Hello, please what could I do if I want to hide markers ?
@BrayceFepa This is a more or less unrelated problem, so please open a new issue next time. Doing so helps me to keep track of what is currently not working and needs to be addressed.
That being said, what you could do is take the code above and modify the createMarker
function to return an invisible marker by setting its opacity to 0 and making it non-interactive
createMarker: (i, wp, nWps) => {
return L.marker(wp.latLng, { interactive: false, opacity: 0 });
},
I would like to use the CreateMarker function but it is not available within L.Routing.Control This is my code and under the VSCODE error message
i use leaflet-routing-machine v.3.2.12