loam: Unable to use Loam in React

Hello hi i have react app i need to load .tif file in it that was my requirement after goggling i got loam npm package ,and i got working example in typescript here is linkand repo link i tried to clone same code logic in react, facing loam library error

import loam from "loam" `function App() { require(‘loam/lib/loam-worker.js’); require(‘gdal-js/gdal.js’); require(‘gdal-js/gdal.wasm’); require(‘gdal-js/gdal.data’); useEffect(()=>{ loam.initialize(“/”)

},[]) const ReadFile = (e) => { const files = e.target.files loam.open(files).then((dataset)=>{ console.log(dataset,“d”) }).catch((er)=>{ console.log(er,“er”) }) } return ` above the simple code i have tried and throws error i have added screenshot this is about gdal i guess Screenshot 2023-07-21 114015 and second error is about loam.open Screenshot 2023-07-21 114127 where did i went wrong can you please tell how can i integrate loam in my project i have
react v17+ “loam”: “^1.2.0”, “gdal-js”: “^2.2.0”,

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16

Most upvoted comments

yeh sure !

Great, glad you got it working! Is it all right if I close this issue?