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

147
Views
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
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!