Conversation
|
|
osmtogeojson hasn't been updated in a few years. Worth forking maybe? |
|
Hey Adam! Weird, I don't think that I've made any modifications that would case that problem - maybe the Figma sandbox changed? A fork seems reasonable - I've tried to make an osmtogeojson successor of sorts in the past but burned out of it… just fixing a few tiny things on the other hand should be fine. |
| "rbush": "^3.0.1" | ||
| } | ||
| }, | ||
| "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" |
There was a problem hiding this comment.
This project is using npm (there's a pnpm-lock)
|
Thanks Tom! Appreciate your work on this and hoping to get to use it.
Possibly! I can imagine they've locked down the sandbox a bunch. It's a bummer there are still a million hacky ways to load third-party js, so it might be that a fork is the best fix. Would you prefer to own in under your account, the placemark org, or under my account? I'm fine with anything (and to your point it might be easier to start with a small fork before going more holistic) |
|
Just to note, even after this fix I'm still seeing timeout issues except on really high zoom levels. When I did get it to load it was only able to add the attribution text element. And then I had to put this particular yak-shave aside to work on something else I'm happy to make the changes but wanted to know if there's something I'm not seeing before investing too much time in this |
|
If you mean high as in low numbers, that's going to be mostly a core principle of the system: how this plugin works is that it requests raw data from OpenStreetMap and renders it from scratch. At zooms 0-6 for example, if you're requesting Basically the idea is partly that this approach gives proper geometries and data that you wouldn't get if you had a tiled or raster representation, but the flipside is that it does have that raw data. I think it'd make sense to selectively load roads at country-level zooms, or maybe a different dataset entirely. You can see this principle with OpenStreetMap's editors too - iD doesn't let you edit zoomed out to a country because it'd be a tremendous amount of data. There are ways out, like loading only high-level highways and dropping other features at those zoom levels, or -- much higher time investment -- having a simplified dataset that this could load from. |
|
Yeah on high zoom levels (i.e. street level) I was able to get the request to complete but nothing rendered - and then I gave up. On low zoom levels (city and below) it timed out. I'd love to take another crack at this, or try to wire it into Noodles.gl for export to Figma somehow. What you say makes sense, and I wonder how difficult it would be to add some zoom-based filtering (or to use the mapbox style spec to determine which to render). |
|
Oddly I can't replicate the crash you're seeing, using the latest version of Figma and the latest version of the plugin. |
I was getting a few issues with osmtogeojson on plugin load.
The issue was that osmtogeojson version 3.0.0-beta.5 bundles a version of lodash that requires
window.__core-js_shared__, which cannot be set in Figma's restrictive sandbox environment (you can't define properties on window / root). I initially tried to change the banner in the build script but fundamentally I wasn't able to modify the environment.I've downgraded the package to version 2.2.12, which is a stable release that doesn't have this dependency issue.
Changes made: