Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

285
Vistas
UserIcon cannot understand what's the right paths to start the simulation

how to pass getLatLng() on runSimulation correctly, I've tried many ways, but not getting what I want. It's working when I'm not dragging my marker, but when I drag them and run Simulation, it's giving me errors

function runSimulation() {

    console.log("starting simulation");

    initializeUserMarker(routes[0].marker);

    const seconds = 60;
    const numSteps = 20;

    let pointsObj = {
        i: 0,
    };

    setInterval(() => step(pointsObj), (seconds / numSteps) * 1000);

}

--

function initializeUserMarker(marker) {
    const UserIcon = L.Icon.extend({
        options: {
            iconSize: [38, 95],
            shadowSize: [0, 0],
            iconAnchor: [22, 94],
            shadowAnchor: [4, 62],
            popupAnchor: [-3, -76],
        },
    });

    // user icon
    var userIcon = new UserIcon({
        iconUrl: "./assets/images/sport-car.png",
        shadowUrl:
            "http://leafletjs.com/examples/custom-icons/leaf-shadow.png",
    });

    // add icon to map
    userMarker = {
        "id": atomicCounter,
        "marker": L.marker(marker.getLatLng(), {icon: userIcon}).addTo(map)
    };

}

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda