1 (edited by Appearia 2022-04-11 13:51:27)

Topic: No support for HereAPI V8, cant make a new account with 7.2 API.

HereAPI doesn't offer new support for V7.2.

I tried making an account today and saw that the account only offers support for V8.
While I can change the string request to fit the changes of V8,
it gets caught on the xml document loader.

The xml string is correct is correct for 7.2 but not for V8.
is there any workarounds I can use in the meantime?

Catch error:

[File: OnlineMapsXML.CS]
Can not load XML from string:
{"routes":[{"id":"e9293701-ed67-47ed-8440-8f24a4d5c485","sections":[{"id":"ee099a17-1a08-48a1-ac17-5a9617d35d20","type":"pedestrian","departure":{"time":"2022-04-11T16:47:34+03:00","place":{"type":"place","location":{"lat":31.77554,"lng":35.23109},"originalLocation":{"lat":31.77552,"lng":35.2311199}}},"arrival":{"time":"2022-04-11T16:51:27+03:00","place":{"type":"place","location":{"lat":31.7741539,"lng":35.2317627},"originalLocation":{"lat":31.7741699,"lng":35.23176}}},"summary":{"duration":233,"length":232,"baseDuration":233},"polyline":"BGoztz8Bk3qmjCnQ3D_JTrJT3DTrOnBvCAvHUnGUAwCwCkXA8B3N8BvCU_EUkCiR","transport":{"mode":"pedestrian"}}]}]}

Re: No support for HereAPI V8, cant make a new account with 7.2 API.

Hello.

Thank you for reporting this.
I will try to add v8 support soon.
It will take some time. I think it will be ready next week.

If you need it urgently, then you can parse the response directly as JSON (it's not XML).
Example:

using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace InfinityCode.OnlineMapsSupport
{
    public class TestParseHere8 : MonoBehaviour
    {
        private void Start()
        {
            // Response
            string v = @"{""routes"":[{""id"":""e9293701-ed67-47ed-8440-8f24a4d5c485"",""sections"":[{""id"":""ee099a17-1a08-48a1-ac17-5a9617d35d20"",""type"":""pedestrian"",""departure"":{""time"":""2022-04-11T16:47:34+03:00"",""place"":{""type"":""place"",""location"":{""lat"":31.77554,""lng"":35.23109},""originalLocation"":{""lat"":31.77552,""lng"":35.2311199}}},""arrival"":{""time"":""2022-04-11T16:51:27+03:00"",""place"":{""type"":""place"",""location"":{""lat"":31.7741539,""lng"":35.2317627},""originalLocation"":{""lat"":31.7741699,""lng"":35.23176}}},""summary"":{""duration"":233,""length"":232,""baseDuration"":233},""polyline"":""BGoztz8Bk3qmjCnQ3D_JTrJT3DTrOnBvCAvHUnGUAwCwCkXA8B3N8BvCU_EUkCiR"",""transport"":{""mode"":""pedestrian""}}]}]}";

            // Parse json string
            OnlineMapsJSONItem json = OnlineMapsJSON.Parse(v);

            // Get a first section
            OnlineMapsJSONItem firstRoute = json["routes/0/sections/0"];

            // Get a polyline string
            string polyline = firstRoute.V<string>("polyline");
            Debug.Log(polyline);

            // Decode string
            // Important: This is not the correct method for HERE's polyline string and will return the wrong result.
            // HERE uses its own algorithm, the decoder for which you can find here:
            // https://github.com/heremaps/flexible-polyline
            List<OnlineMapsVector2d> points = OnlineMapsUtils.DecodePolylinePointsD(polyline);

            // Draw a line
            OnlineMapsDrawingLine line = new OnlineMapsDrawingLine(points, Color.red, 3);
            OnlineMapsDrawingElementManager.AddItem(line);

            // Get a center point and zoom for polyline
            Vector2 center;
            int zoom;
            OnlineMapsUtils.GetCenterPointAndZoom(points.Select(p => new Vector2((float)p.x, (float)p.y)).ToArray(), out center, out zoom);

            // Set a center and zoom to the map
            OnlineMaps.instance.SetPositionAndZoom(center.x, center.y, zoom);

            // Redraw the map
            OnlineMaps.instance.Redraw();

        }
    }
}
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: No support for HereAPI V8, cant make a new account with 7.2 API.

Thank you.

Re: No support for HereAPI V8, cant make a new account with 7.2 API.

I am highly interested in here specifically as a provider. Could you please elaborate more on this Test class? Or can you confirm that a fix is about to come?

Re: No support for HereAPI V8, cant make a new account with 7.2 API.

Hello.

Implementation of classes for HERE Routing API v8 is complete and will be included in the next release.
If anyone wants to get a patch before release, please send me an email (support@infinity-code.com).

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.