Closed raulallende2025 closed 5 years ago
Hi. only show first and last markers on my map
L.Routing.control({ collapsible: true, collapseBtnClass: 'ods-icon-route', waypoints, lineOptions: { styles: [{ color: waypoints[0].color, opacity: 1, weight: 3 }] }, createMarker: function (i, waypoint, n) { if (i === 0) { const marker = L.marker(waypoint.latLng, { draggable: false, icon: L.divIcon({ className: '', html: <span style="color: ${waypoint.color}; font-weight: bold" class="ods-icon-home ods-mt-5 ods-mr-5"></span> }) }) return marker } else if (i === n - 1) { const marker = L.marker(waypoint.latLng, { draggable: false, icon: L.divIcon({ className: '', html: <div style="background: ${waypoint.color}; width: 15px; height: 15px; border-radius: 50%"/> }) }) return marker } else { const marker = L.marker(waypoint.latLng, { draggable: false, icon: L.divIcon({ className: '', html: <div style="background: ${waypoint.color}; width: 10px; height: 10px; border-radius: 50%"/> }) }) return marker.bindTooltip(waypoint.tooltip).openTooltip() } } }).addTo(this.$refs.myMap.mapObject)
<span style="color: ${waypoint.color}; font-weight: bold" class="ods-icon-home ods-mt-5 ods-mr-5"></span>
<div style="background: ${waypoint.color}; width: 15px; height: 15px; border-radius: 50%"/>
<div style="background: ${waypoint.color}; width: 10px; height: 10px; border-radius: 50%"/>
Hi. only show first and last markers on my map
L.Routing.control({ collapsible: true, collapseBtnClass: 'ods-icon-route', waypoints, lineOptions: { styles: [{ color: waypoints[0].color, opacity: 1, weight: 3 }] }, createMarker: function (i, waypoint, n) { if (i === 0) { const marker = L.marker(waypoint.latLng, { draggable: false, icon: L.divIcon({ className: '', html:
<span style="color: ${waypoint.color}; font-weight: bold" class="ods-icon-home ods-mt-5 ods-mr-5"></span>
}) }) return marker } else if (i === n - 1) { const marker = L.marker(waypoint.latLng, { draggable: false, icon: L.divIcon({ className: '', html:<div style="background: ${waypoint.color}; width: 15px; height: 15px; border-radius: 50%"/>
}) }) return marker } else { const marker = L.marker(waypoint.latLng, { draggable: false, icon: L.divIcon({ className: '', html:<div style="background: ${waypoint.color}; width: 10px; height: 10px; border-radius: 50%"/>
}) }) return marker.bindTooltip(waypoint.tooltip).openTooltip() } } }).addTo(this.$refs.myMap.mapObject)