0

Is it possible to display numbers near waypoints on map? I create multiple routes in loop and passing waypoints via array. Routes get painted with Leaflet Routing Machine. I want to show number of waypoint near it on map. Here's my code

for(var i = 0; i < data.length; i++){
   var waypoints = [];
   for(var j = 0; j < data[i].length; j++){
       fs.push(L.latLng(coords[data[i][j]][0], coords[data[i][j]][1]));
   }
   if (fs.length > 2){
   L.Routing.control({
           waypoints:waypoints,
           lineOptions:{styles:[{color: colorArray[i]}]},
           show: false,
       }).addTo(map);
   }
}

data is array that contain orders of points to visit, coords contain coordinates of these points. By iterating through these 2 loops I create several routes. Is it possible to add something to L.Routing.control and display number of the point near it's marker? What can I use for it if it's not possible just with leaflet routing machine

  • Before you expect help to new questions it would be great to have a look at answers to old questions and at least comment on them: gis.stackexchange.com/questions/324016/… – TomazicM May 30 at 18:43
  • Sorry, I totally forgot about that question. There is total mess in my head now. Will check it tomorrow – indeedme May 30 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.