The route is created using the HERE Routing API. This API returns a flexible polyline.
This is an example:
The size of the flexible polyline depends on the length of the route. This flexible polyline corresponds to a route of 550 metres. For a route of 725 km, the flexible polyline is 71 001 characters long.
To display the route on a map, I need to transform a flexible polyline into two lists of GPS coordinates:
What do you want to do with the array of points that you are sending from JS to Bubble? The answer will help determine how to represent the data.
For example, if they are only used to draw on the map, then there is no need to send them to Bubble.
Fixing your test app …
var flexiblePolylineData = H.util.flexiblePolyline.decode(Input Polyline’s value);
// need quotes around the string parameter
var flexiblePolylineData = H.util.flexiblePolyline.decode("Input Polyline’s value");
// change Bubble_fn to bubble_fn
// change getLatLngArray to getLatLngAltArray
Change custom state to store list of numbers
In the example above, I have tried to display three lists: the first for GPS coordinates (Lat Lng Alt), the second for latitudes and the third for longitudes. But all three lists are completed with the GPS coordinates values.
I can’t see what I’m missing. What do you think?
Here are some captures of my app (I’m sorry I can’t share the link to the app).
There were some bugs in the older version of Toolbox plugin, so sorry!! To get the fixes to multi output lists, update the plugin to the latest version.
I notice your list of numbers is displaying a comma as the decimal point, i.e. 52,8886
This is fine so long as you keep the numbers in number form. But if sending the number as text to for example an API or plugin that takes a number in a text form, take care to format to text with a period for the decimal, for example 52.8886