I am looking for a solution to change the Mapbox marker icons when using DirectionJS. Currently, it displays A and B markers.
After attempting to edit the marker, I encountered issues with losing directions.
var x= L.marker([51.508245, -0.087700], {
icon: L.mapbox.marker.icon({
'marker-size': 'large',
'marker-icon': 'monument',
'marker-color': '#fa0'
})
}).addTo(map);
// Setting the origin and destination for the direction and making a call to the routing service
directions.setOrigin(L.latLng(x));
directions.setDestination(L.latLng(51.508112, -0.075949));
directions.query();
var directionsLayer = L.mapbox.directions.layer(directions).addTo(map);
var directionsRoutesControl = L.mapbox.directions.routesControl('routes', directions)
.addTo(map);
var directionsLayer = L.mapbox.directions.layer(directions, {readonly: true}).addTo(map);
The above code is what I attempted, but it caused issues with the directions. I am seeking a method to change the icons of both A and B markers.
For reference, here is the JSFiddle link: https://jsfiddle.net/x48qrca8/1/