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

160
Visualizações
here maps fleet api not working, How i can get the alternative route intead of an error?

im triying to get the toll cost from a route and its giving me the most of the times an error. I think its the height but previusly, the route chosed other route but now, throws this error instead of show an alternative route.

Couldn't reach way point 1 (start links.......issues: illegal access, height.

im using this:

  var vehicleTypeToll;
  
 
  switch(varRoute.vehicle_type){
    case "car": vehicleTypeToll=2;
      break;
    case "truck": vehicleTypeToll=3;
      break;

  }
  
  if(varRoute.vehicle_type=='car'){
    toll_height=1.5+'m';
    toll_width=1.5+'m';
  }else{
    toll_height=varRoute.height/1000 +'m';
    toll_width=varRoute.width/1000 +'m';
  }

  let api ='fleet.ls.hereapi.com/2/calculateroute.json&app_id=***&app_code=***',
  apiKey = '***',
  waypoint0 = param_origen,
  waypointDestino = param_destino,
  
  mode = 'fastest;'+varRoute.vehicle_type+';',
  representation ='linkPaging',
  
  tollVehicleType = vehicleTypeToll,
  rollups ='tollsys,country,total',
  
  height = toll_height,
  width = toll_width,
  total_weight= varRoute.total_weight/1000+'t',
  total_length = varRoute.total_length/1000+'m',
  routeattributes= 'sh,sm',
  currency= 'EUR',
  
 //&vehicle_type=${vehicle_type}&total_weight=${total_weight}&total_lenght=${total_lenght}&width=${width}&height=${height}   
  url = `https://${api}?apiKey=${apiKey}&currency=${currency}&height=${height}&width=${width}&alternatives=0&total_weight=${total_weight}&total_length=${total_length}&routeAttributes=${routeattributes}&mode=${mode}&representation=${representation}&tollVehicleType=${tollVehicleType}&rollups=${rollups}&waypoint0=${waypoint0};`;
 
  //param_puntos_intermedios es un string en el cual se van concatenando coordenadas separadas por | (lat,long|lat,long), asi conseguír un array de puntos.


  
  var waypoints=param_puntos_intermedios.split('|');
  
  if(param_puntos_intermedios===''){
    url +='&waypoint1='+waypointDestino+';';

  }else{
  
    for(i=0;i<waypoints.length;i++){
      url += '&waypoint'+(i+1)+'='+waypoints[i]+';';
    }
   
    url +='&waypoint'+(waypoints.length+1)+'='+waypointDestino+';';
  }
  //Aqui se hace la llamada a la api de fleet, donde se obtiene los peajes por los que pasa.
 
  fetch(url)
      .then(response => response.json())
      .then(response => {
          console.log(response);
          console.log(height);
          set_vfp_route_tollcost(response.response.route[0].cost.totalCost);
          
      
      }, error => {
          console.error(error);
      });
     ```

Idk what is happening, Thanks in advance.
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