Google Directions Json Error

Discussion in 'iOS Programming' started by igorladessa, Dec 19, 2012.

  1. macrumors newbie

    Joined:
    Dec 10, 2012
    #1
    I'm trying to get the directions using google directions but I'm getting this error :

    Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading character (41)\

    Here is the Json
    Code:
    loadDirections('Avenida Paulista', 'Rua Augusta', { 'locale': 'en', travelMode: G_TRAVEL_MODE_WALKING, avoidHighways: false, getPolyline: true, getSteps: true, preserveViewport: false})
    Whats is wrong? Whats Unrecognised leading character (41) mean?
     
  2. Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Doesn't look like you are using valid JSON.

    At first guess, I would suspect your single-quote usage; strings are wrapped in double-quotes. But it could be something else as well.

    Is this JSON you're sending to Google or something you're getting back?
     
  3. macrumors 68000

    waterskier2007

    Joined:
    Jun 19, 2007
    Location:
    White Lake, MI
    #3
    I like to use http://jsonlint.com/ to check if I have valid JSON or not. Just copy and paste your string in there, press validate, and voila
     

Share This Page