jeffreykemp / jk64-plugin-reportmap

Report Google Map APEX Plugin
https://jeffreykemp.github.io/jk64-plugin-reportmap/
MIT License
42 stars 16 forks source link

Error: SyntaxError: Unexpected token { in JSON #121

Closed jeffreykemp closed 4 years ago

jeffreykemp commented 4 years ago

Have a map with a pin-based visualisation. Query provides Lat/Long data in string form (e.g. varchar2).

At runtime, for some or all data sets, the map shows the error message Error: SyntaxError: Unexpected token { in JSON at position ...

Examining the Network monitor shows the wwv_flow.ajax call response includes the error ORA-20000: Unable to convert data to lat or long \u0022...data...\u0022 (including the original string that could not be converted to numeric).

jeffreykemp commented 4 years ago

Workaround: convert the Lat and Long columns to numbers in the query, e.g.

select to_number(lat), to_number(lng), name, id from mytable;
jeffreykemp commented 4 years ago

Note to self: need to try to get the error message to be correctly embedded into the JSON without tripping up the JSON parser on the client, when prior data had already been successfully sent.