GeoJSON and performance #1227
Replies: 2 comments 2 replies
-
Hey @creativiii 👋 thanks for checking out Generally perf in I took a quick shot at updating your sandbox. It's still messy/not perfect (in particular the zoom minimap and something is wonky when you zoom in really far), but it's signficantly better. Generally the approach I think you need to employ is applying the zoom transform not to the projection itself (which forces a complete re-render of the map), but on a parent element like |
Beta Was this translation helpful? Give feedback.
-
Thank you @williaster this was a huge help for perf in my map. Maybe the current example for preset geo should show this optimization? |
Beta Was this translation helpful? Give feedback.
-
I'm currently trying to render an interactive map. I started from the official examples but have found myself stuck on how to improve performance.
Link to codesandbox
I've tried to simplify the GeoJSON data as much as possible, but haven't seen a lot of performance improvements.
While the problem is obviously the amount of data, the map only starts performing well again once the whole
Mercator
component is removed, rather than removing when the coordinates aremap
ped.Is it possible to have this running at a decent framerate or should I give up on it?
Thank you for the library!
EDIT: d3 suggested using the library
simplify-geojson
to simplify my output, but the outputted object looks just as big as the original despite the map being less precise so I'm not entirely sure if my topology is actually being simplified correctly.Beta Was this translation helpful? Give feedback.
All reactions