[Geojson] JSON.parse: unexpected character

Tim Schaub tschaub at opengeo.org
Wed Jul 11 09:18:41 PDT 2012


Your CRS member looks suspect (see
http://geojson.org/geojson-spec.html#named-crs), but that's not
causing the Firebug issue.

It would probably be easier to see the output JSON to determine what
is invalid.  You can run it through http://jsonlint.com/ yourself to
ensure that it is valid.

Also, it looks like the extra decoding of the GeoJSON you get back
from PostGIS is unnecessary (for the geometry member).  I'd guess you
could just use the string directly there (line 130).

Tim

On Wed, Jul 11, 2012 at 5:53 AM, Pedro Costa <pedrocostaarma at sapo.pt> wrote:
> Hello,
>
> This is my first mail to this list.
>
> I have a php script that have to return to client a geojson layer but it
> gives me this error in firebug:
>
> JSON.parse: unexpected character (screen shot attached)
>
>
> the php code is that:
>
> http://pastebin.com/tSCv5cnT
>
>
> Can somebody help me with the error?
>
> thanks
>
>
>
>
>
> _______________________________________________
> Geojson mailing list
> Geojson at lists.geojson.org
> http://lists.geojson.org/listinfo.cgi/geojson-geojson.org
>



-- 
Tim Schaub
OpenGeo http://opengeo.org/
Expert service straight from the developers.



More information about the GeoJSON mailing list