Open aidanlister opened 5 years ago
@aidanlister does your data pass muster with a GeoJSON linter tool? Mapboxgl-jupyter does assume the input data is a valid JSON object, Python dictionary, or DataFrame.
@akacarlyann it's not serialising the data properly when writing it to a file ... it's nothing to do with the input (e.g. an apostrophe in property
shouldn't crash the script).
Think I've found the bug. Can anyone explain why this line exists? (Paging @perrygeo)
This is done when building the iframe, after (valid) geojson and html is produced.
The effect is to mangle the geojson in the html.
Property strings which were in the form:
{ ... 'properties': {'address': "someone's place"}}
are converted to being wraped by single quotes:
{ ... 'properties': {'address': 'someone's place'}}
breaking the json, javascript, and map.
If you pass a GeoJSON dict with single apostrophee's in it, the notebook fails to render the map eg: