Closed PaulieScanlon closed 2 years ago
@PaulieScanlon thanks for reaching out.
I can't speak much to the React part since this is just ThreeJs geometry module, but, I think you may have an issue on this line:
const geometry = new GeoJsonGeometry(geoJson) // new THREE.GeoJsonGeometry(geoJson) throws an error
Assuming your geoJson
variable is a FeatureCollection
straight from the file, you need to create a GeoJsonGeometry
from each of the feature's geometry. You can see this done in the example's code:
https://github.com/vasturiano/three-geojson-geometry/blob/8e748b8ecaacd8add441f91bd360ab0f9f64ea4f/example/countries/index.html#L32-L37
Let me know if that addresses your issue or if you're experiencing any more difficulties.
Hey! Lovely stuff! I'll dig in to that tomorrow and let you know how I get on. Thanks so much for the reply!
Hey @vasturiano it's all working great, thanks for the top tip. It took me a while to work out how to React Three Fibre this all but it's working a treat.
Just one small issue regarding SSR... i've opened another issue but am happy to create a PR if it's something you agree with.
Thanks again!!
Hey, great lib, i've tried to hand crank a
geoJson
globe and it was really hard.I was wondering if you could give me a little assistance with loading some
geoJson
. I'd also like to create a PR once i have this working with some code snippets for how to use with React and perhaps even React Three Fibre in case other run into the same confusion i have.Here's where i'm at, no errors but the "land" doesn't load.
This gives me a response similar to the below:
... which i'm trying to return a bit like this
Is there anything you can see that i'm doing wrong. Just trying to work out if it's the
geoJson
source i'm trying to load which i got from here: http://geojson.xyz/ or the way i'm using React Three FibreThanks in advance!