PHP Classes

JSON parser error

Recommend this page to a friend!

      Map Builder  >  All threads  >  JSON parser error  >  (Un) Subscribe thread alerts  
Subject:JSON parser error
Summary:error "Unable to get coordinates. JSON parser error."
Messages:3
Author:jcdweb
Date:2015-02-24 21:47:10
 

  1. JSON parser error   Reply   Report abuse  
Picture of jcdweb jcdweb - 2015-02-24 21:47:10
Hi !
Thank you for this very well class !
I have a problem with this message :
"Unable to get coordinates. JSON parser error."

I tried with curl option, and it's the same...
your example 2 have the same error without changing from my part.

How can I solve this problem ?

thanks for advance

  2. Re: JSON parser error   Reply   Report abuse  
Picture of Vagharshak Tozalakyan Vagharshak Tozalakyan - 2015-12-19 14:28:07 - In reply to message 1 from jcdweb
Just handle MapBuilderException to perform any action you want...
Also, in case the sockets were blocked for you, try to use CURL as fetch method.

try {
$pos = $map->getLatLng('Eiffel Tower, Paris', MapBuilder::URL_FETCH_METHOD_CURL);
} catch (MapBuilderException $ex) {
// do something here instead die()
}

  3. Re: JSON parser error   Reply   Report abuse  
Picture of Luis Arturo López Vergara Luis Arturo López Vergara - 2016-11-04 00:54:00 - In reply to message 2 from Vagharshak Tozalakyan
Hi, I see that it´s a great PHP Class. But also I have the same problem in a localhosta enviroment, I try used:

try {
$pos = $map->getLatLng('Eiffel Tower, Paris', MapBuilder::URL_FETCH_METHOD_CURL);
} catch (MapBuilderException $ex) {
//die($ex->getMessage());
}

But I get

Notice: Undefined variable: pos in

Thanks, for your support.