Skip to content Skip to sidebar Skip to footer

How Do I Change The Marker Of Mapbox With Directionsjs? It Shows A And B Markers

How do I change the Mapbox marker (when using directionjs)? It shows A and B markers. I tried editing the marker but lose directions. var x= L.marker([51.508245, -0.087700], {

Solution 1:

Try looking at their examples on how to do different marker styles. For an image, check out this example, specifically at this code:

myLayer.on('layeradd', function(e) {
  var marker = e.layer,
      feature = marker.feature;
  marker.setIcon(L.icon(feature.properties.icon));
});
myLayer.setGeoJSON(geojson);

This is going into the GeoJSON properties and using the icon value under feature.properties to figure out how it should be styled.


Post a Comment for "How Do I Change The Marker Of Mapbox With Directionsjs? It Shows A And B Markers"