0

I have a problem.

I'm trying to get a panoramic image using Google Street View.

However, the request return value of the panorama of Google Street View is Json.

This is the return value

{
    "copyright" : "© Руслан К",
    "date" : "2016-05",
    "location" : {
        "lat" : 48.8578126,
        "lng" : 2.2952229
     },
    "pano_id" : "CAoSLEFGMVFpcE81ZzI0OW9qU3lGeFVkV0kwLVJVZGwyNVl6c2FWVnJOYnJySmt4",
    "status" : "OK"
}

I am going to use the panorama id value in Unity. And I wrote the following.

string json = "https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=eiffel%20tower,%20paris,%20france&fov=110&pitch=38&key= *********";

JsonData jsonplayer = JsonMapper.ToObject (json);
panoLocation = jsonplayer["pano_id"].ToString ();

There's a problem here

JsonException: Invalid character 'h' in input string
LitJson.Lexer.NextToken ()
LitJson.JsonReader.ReadToken ()
LitJson.JsonReader.Read ()

I'd like to know how to make a call.

SamSic
  • 347
  • 1
  • 4
  • 15
  • Generate class from your json from [here](http://json2csharp.com/) then use the duplicate to convert the json into object. – Programmer Nov 14 '17 at 07:23
  • Your _string json_ isn't json. It's an url. You need to make a request and deserialize the response. BTW: I don't believe this is a duplicate. Your issue is not with deserializing. – Palle Due Nov 14 '17 at 11:25

0 Answers0