Hi all,
I'm new to both React and Flask so sorry if this is a simple problem, but basically, I have two inputs (starting/ending locations) that get passed to the Flask backend that goes through an algorithm and then exports the Google Map route as a .html; I can input the start/end locations and create the new route, it just doesn't update in real-time as I have to refresh the page to see the results.
In my App.js I have a simple iframe to embed the results as
<iframe id="Google-Map" src={"./map.html"} width="75%" height="500vh"></iframe>
How would I be able to allow it to refresh in real-time?
I've tried the following
import Map from './map.html';
function App(){
...
<iframe id="Google-Map" src={"./map.html"} width="75%" height="500vh"></iframe>
}
But I get the following error:
ERROR in ./src/map.html 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <html>
| <head>
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
@ ./src/App.js 7:0-30
@ ./src/index.js 6:0-24 10:33-36
webpack 5.65.0 compiled with 1 error and 1 warning in 66 ms
Keep your html file in a public place, not under the src folder. Because somehow the files under the src folder are not visible.
You can edit your iframe line like this:
<iframe id="Google-Map" src="../map.html" width="75%" height="500vh"></iframe>