HERE-MAPS Altitude Information of Route in javascript

98 Views Asked by At

I am trying to get the gradient information of the calculated route from here maps. According to the documentation I need to add:

returnElevation = True

to cause "all shapes inside routing response to consist of 3 values instead of 2"

this was done here:

jsonAttributes: 1,
        linkAttributes: 'sh,sl,ds', 
        routeAttributes: 'waypoints,shape,boundingBox',
        legAttributes: 'boundingBox,shape',
        maneuverAttributes: 'po,sh,rn,sp,rs,sa,sq',

        returnElevation=true, 

        representation: 'turnByTurn',

later I receive the data with this:

var geo = links.shape[0].split(",");
                latitudes.push(parseFloat(geo[0]));
                longitudes.push(parseFloat(geo[1]));
                altitude.push(parseFloat(geo[2]));

For some reason, this approach does not work, any Idea what I might be doing wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

Try replacing returnElevation=true with returnElevation:true, i think returnElevation=true will work directly in REST API request however javascript needs it with a ":"