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

158
Vistas
aquí los mapas de la API de la flota no funcionan. ¿Cómo puedo obtener la ruta alternativa en lugar de un error?

Estoy tratando de obtener el costo del peaje de una ruta y la mayoría de las veces me da un error. Creo que es la altura, pero anteriormente, la ruta eligió otra ruta, pero ahora arroja este error en lugar de mostrar una ruta alternativa.

No se pudo llegar al punto de paso 1 (iniciar enlaces... problemas: acceso ilegal, altura.

estoy usando esto:

 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 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