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

118
Vistas
mapsjs-core.js:27 Uncaught TypeError: Cannot read properties of undefined (reading '0')

I need help

I work with the here map api I try to display the contours around a city and I have this as an error

const shape = res.response.isoline[0].component[0].shape.map(z => z.split(','));

here is the complete piece of code

const requestIsolineShape = options => { const params = { 'mode': fastest;${options.mode};traffic:enabled, 'start': geo!${options.center.lat},${options.center.lng}, 'range': options.range, 'rangetype': options.rangeType, 'departure': ${options.date}T${options.time}:00, };

return new Promise((resolve, reject) => { router.calculateIsoline( params, res => { const shape = res.response.isoline[0].component[0].shape.map(z => z.split(',')); resolve( shape ); }, err => reject(err) ); }); } ;

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Please double check in console(Network tab) of browser which parameters are sent to Routing isoline service and check the response.

It seems are you using Routing API v7.2 then please play with playground on https://refclient.ext.here.com/ - click there on "New Tab +"

Better solution if you switch to new version 8 of Routing API and use this service which direct integrated to JS API: https://developer.here.com/documentation/maps/3.1.30.7/api_reference/H.service.RoutingService8.html#calculateIsoline

Example:

let routingParams = {
 'routingMode': 'fast',
 'transportMode': 'car',
 'origin':'52.5,13.4',
 'range[type]': 'time',
 'range[values]': '900',
};

// Define a callback function to process the routing response
let onResult = function(result) {
  if (result.isolines.length) {
    result.isolines[0].polygons.forEach((polygon) => {
        // Create a linestring to use as a point source for the isoline
        const linestring = H.geo.LineString.fromFlexiblePolyline(polygon.outer);

        // Create a polygon and a marker representing the isoline
        const isolinePolygon = new H.map.Polygon(linestring, {
          style: { strokeColor: 'blue', lineWidth: 3 }
        });

        // Create a marker for the start point
        const isolineCenter = new H.map.Marker(result.departure.place.location);

        // Add the polygon and marker to the map
        map.addObjects([isolinePolygon, isolineCenter]);

        // Center and zoom the map so that the whole isoline polygon is
        // in the viewport
        map.getViewModel().setLookAtData({bounds: isolinePolygon.getBoundingBox()});
    });
  }
};

// Assumption: the platform is instantiated.
// Get an instance of the routing service
let router = platform.getRoutingService(null, 8);

// Call the Isoline Routing API to calculate an isoline
router.calculateIsoline(
  routingParams,
  onResult,
  console.error
);

Playground for v8: https://demo.routing.ext.here.com/

about 4 years ago · Juan Pablo Isaza Denunciar
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