I’m working on refactoring a project into a React project, and I’m getting some of my old script to work with states, which is fun. But I’m having trouble with a weather radar map. Following the instructions here: Create interactive web maps /Créer des cartes web interactives - MSC Open Data / Données ouvertes du SMC I’m using the Leaflet service, because I couldn’t get anything to show up with OpenLayers.
I have tried running one or the other first by deferring, but in each case it says something is not defined. I’m not sure where to put each of the scripts provided.
At first I had the head script in the head of index.js and the body script in App.js, but I don’t know if this is correct, and it was showing ‘L is not defined’. I tried putting both scripts in the head with similar results, and when they were reversed I got something like ‘couldn’t find map container’.
I couldn’t find help by googling. What’s standard practice for including scripts in a react project?