Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

245
Visualizações
Is there a way to rotate the marker to align with the road using leaflet in one map?

I am trying to align my vehicle in the direction of the road using one map but can't seem to figure out how. a) I cant figure out a way to get the direction to head inorder to rotate the marker

    displayMarkers(info: { location: number[]; name: string; plate: string; }){
    var greenIcon = L.icon({
      iconUrl: '/assets/images/truck-top.png',
      iconSize:     [40, 30], // size of the icon
      shadowSize:   [50, 64], // size of the shadow
      iconAnchor:   [20, 20], // point of the icon which will correspond to marker's location
      shadowAnchor: [4, 62],  // the same for the shadow
      popupAnchor:  [-3, -26] // point from which the popup should open relative to the iconAnchor
  });

    var loc = info['location']

    //console.log([location[0],location[1]]);
    var DriverName =info['name']
    var plateNo= info['plate']

    //add the popUp HTML
    var customPopup = `
    <p style="margin-bottom:10px"><b>PlateNumber: ${plateNo} </b></p> 
    <p style="margin:0px"><b>Trucker name: ${DriverName}</b></p>
    <hr style="width:100%", size="1", color=black>  
    <p style="color:red;margin:0px">Dispalys if any alert raised in vehicle</p>
    `;
  

  // specify popup options 
  var customOptions =
    {
    'maxWidth': '400',
    'width': '200',
    'className' : 'popupCustom'
    }
    
    //! add the marker and attach popup
    const marker= L.marker([loc[0],loc[1]],{icon: greenIcon}).addTo(this.map);
    marker.bindPopup(customPopup)
   
   }

This is my marker function and The map image

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda