heremaps / harp.gl

3D web map rendering engine written in TypeScript using three.js
Apache License 2.0
1.29k stars 197 forks source link

MapView: Failed to connect to geojson: Error during worker initialization #2278

Closed belopot closed 3 years ago

belopot commented 3 years ago

Hi,

I got the issue GeoJsonDataSource doesn't connect to mapView. I'm using harp.gl - 0.26.0 and react app. My code to add geoJson is following as:

image

This is the error
image

Please let me know how to fix the issue

Thank you

nzjony commented 3 years ago

@belopot , thanks for the issue.

Can you please share your geoJson so I can try locally?

belopot commented 3 years ago

Thank you. Here you go https://drive.google.com/file/d/1apQRPO1DFMB4dx4ewC7haVT-4EdFJRA8/view?usp=sharing

belopot commented 3 years ago

I shared the project (React app) https://drive.google.com/file/d/1hGWuuXxXfaMOHHebvflBXFqFAqEPAT9g/view?usp=sharing

nzjony commented 3 years ago
Screenshot 2021-08-16 at 12 35 05

This seems to be the problem... however you have explicitly set the decoder, so I don't know why it is requesting the decoder.bundle.js, will take a further look.

Consider to look at: https://github.com/slaylines/harp.gl-react-example in the mean time.

nzjony commented 3 years ago

Hmm, your GeoJsonDataProvider seems to need the web worker, because it needs to tile the geojson, see: https://github.com/heremaps/harp.gl/blob/79554faa5d650357068c951e022f386314e38de7/@here/harp-vectortile-datasource/lib/GeoJsonDataProvider.ts#L65

Which explains why it tries to request the decoder.bundle.js, see the other react harp.gl app.

belopot commented 3 years ago

Thank you @nzjony

This issue was resolved by the harp.gl-react-example

nzjony commented 3 years ago

Ok, I'll close this issue then, but feel free to open it again if you need to.