79517808

Date: 2025-03-18 14:41:00
Score: 1
Natty:
Report link

I would recommend you to use basic marker and refactor the function in order to instantiate it with L.marker :

this.routingControl = L.Routing.control({
    waypoints: [
        L.latLng(pickup.location.latitude, pickup.location.longitude),
        L.latLng(dropOff.location.latitude, dropOff.location.longitude),
    ],
    routeWhileDragging: true,
    createMarker: (i: number, waypoint: L.Routing.Waypoint, n: number) => {
        return L.marker(waypoint.latLng, {
            icon: this.createIcon(i.toString()), // Custom icon if needed
        });
    }
}).addTo(this.mapAdmin);

You can check this documentation to prevent any syntax error : https://leafletjs.com/reference.html#marker

Reasons:
  • Blacklisted phrase (1): this document
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: BubbleWrap1631