Skip to content Skip to sidebar Skip to footer

Google Maps Api Json Can't Read Html_instructions

I'm having trouble reading the html_instructions from the Google Maps Api json response, I suspect it's largely my lack of familiarity with dealing with Json objects but I can't se

Solution 1:

It seems when you use URL to get direction JSON, you get an html_instructions as a property of step, but using JS API's you get instructions as property of step.

Solution 2:

Could you see what happens if you put alert("instruction: " + step.html_instruction);?

I've had lots of trouble getting JSON to work as I wanted it to whilst using google maps api before - it was a case of trying lots of different things that shouldn't make a difference until one did...

Solution 3:

i got the answer, it not html_instructions it instructions. change var instruction = step.html_instructions; // == undefined ?

to var instruction = step.instructions; it work perfectly on me, i don't know why 'html_instructions' became 'instructions'

Post a Comment for "Google Maps Api Json Can't Read Html_instructions"