simonw / datasette-leaflet-geojson

Datasette plugin that replaces any GeoJSON column values with a Leaflet map.
19 stars 8 forks source link

Really large polygons fail to display #12

Closed simonw closed 4 years ago

simonw commented 4 years ago

e.g. https://calands.datasettes.com/calands/superunits_with_maps?_search=golden

calands__superunits_with_maps__29_rows_where_where_search_matches__golden__sorted_by_rowid
simonw commented 4 years ago

Here's the reason:

https://github.com/simonw/datasette-leaflet-geojson/blob/fb288f6a5ee22ed277039cfab4b33dda19744c42/datasette_leaflet_geojson/static/datasette-leaflet-geojson.js#L23-L26

It turns out there's a length limit on firstChild.nodeValue! https://www.quirksmode.org/dom/tests/textnodesize.html

See also https://stackoverflow.com/questions/4411229/size-limit-to-javascript-node-nodevalue-field

simonw commented 4 years ago

Fixed in the demo: https://calands.datasettes.com/calands/superunits_with_maps?_search=golden