Topic: OpenRouteService doesn't work

When I try to use OpenRouteServiceExample.cs
It gives me an error:

HTTP/1.1 401 Unauthorized
UnityEngine.Debug:Log (object)
InfinityCode.OnlineMapsExamples.OpenRouteServiceExample:OnRequestComplete (string) (at Assets/Infinity Code/Online maps/Examples (API usage)/OpenRouteServiceExample.cs:47)
OnlineMapsTextWebService:OnRequestComplete (OnlineMapsWWW) (at Assets/Infinity Code/Online maps/Scripts/WebServices/Base/OnlineMapsTextWebService.cs:69)
OnlineMapsWWW:Finish () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:373)
OnlineMapsWWW/<WaitResponse>d__61:MoveNext () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:526)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

Exception: Could not find token at index 0
OnlineMapsJSON.NextTokenCore () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:289)
OnlineMapsJSON.LookAhead () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:178)
OnlineMapsJSON.ParseValueDirect () (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:628)
OnlineMapsJSON.ParseDirect (System.String json) (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:311)
OnlineMapsJSON.Deserialize[T] (System.String json) (at Assets/Infinity Code/Online maps/Scripts/JSON/OnlineMapsJSON.cs:37)
OnlineMapsOpenRouteServiceDirections.GetResults (System.String response) (at Assets/Infinity Code/Online maps/Scripts/WebServices/OnlineMapsOpenRouteServiceDirections.cs:101)
InfinityCode.OnlineMapsExamples.OpenRouteServiceExample.OnRequestComplete (System.String response) (at Assets/Infinity Code/Online maps/Examples (API usage)/OpenRouteServiceExample.cs:49)
OnlineMapsTextWebService.OnRequestComplete (OnlineMapsWWW www) (at Assets/Infinity Code/Online maps/Scripts/WebServices/Base/OnlineMapsTextWebService.cs:69)
OnlineMapsWWW.Finish () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:373)
OnlineMapsWWW+<WaitResponse>d__61.MoveNext () (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsWWW.cs:526)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <f7237cf7abef49bfbb552d7eb076e422>:0)

Re: OpenRouteService doesn't work

Hello.

HTTP/1.1 401 Unauthorised means that you have not specified your API key for Open Route Service, or you have specified an incorrect one.

Kind Regards,
Infinity Code Team.

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

Re: OpenRouteService doesn't work

I've added that to Open Route Service for a Key Manager

Re: OpenRouteService doesn't work

OK, I've got it now - it needs to be added to OnlineMapsOpenRouteServiceDirections.Params

Re: OpenRouteService doesn't work

Just checked the source code, and this should also take the key from Key Manager if it is not present in Params.

Kind Regards,
Infinity Code Team.

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