Mapbox

hello,

i am currently trying t import the mapbox assets in a Unity 3D project. I am following the instructions on the mapbox site, but although it looksa rather easy, i am having trouble. there are 4 errors showing :

  • Assets/Mapbox/Unity/Utilities/HTTPRequest.cs(79,25): error CS1502: The best overloaded method match for `Mapbox.Platform.Response.FromWebResponse(Mapbox.Platform.IAsyncRequest, System.Net.HttpWebResponse, System.Exception)’ has some invalid arguments
  • Assets/Mapbox/Unity/Utilities/HTTPRequest.cs(79,47): error CS1503: Argument #2' cannot convert UnityEngine.Networking.UnityWebRequest’ expression to type `System.Net.HttpWebResponse’
  • Assets/Mapbox/Unity/Utilities/HTTPRequest.cs(83,25): error CS1502: The best overloaded method match for `Mapbox.Platform.Response.FromWebResponse(Mapbox.Platform.IAsyncRequest, System.Net.HttpWebResponse, System.Exception)’ has some invalid arguments
  • Assets/Mapbox/Unity/Utilities/HTTPRequest.cs(83,47): error CS1503: Argument #2' cannot convert UnityEngine.Networking.UnityWebRequest’ expression to type `System.Net.HttpWebResponse’

Does anyone have experience on mapbox/unity ?
Any type of help would be extremely useful.

thanks HP

I had the same problem and fixed it by adding “UNITY” to the ScriptingDefineSymbols in the Player Settings.

Then in Reponse.cs where it says:

if (apiResponse.isNetworkError) {

I used

if (apiResponse.isError) {

thank you! I updated to unity 2017.2 and it worked as explained in the mapbox website.

Thanks fo the response.

HP