Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

284
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!