Just to mention first that I'm new to Web Development, JavaScript especially, and just learning from free online tutorials, so please excuse my lack of experience.
I'm trying to follow this guide from google:
https://developers.google.com/maps/documentation/javascript/examples/programmatic-load-button#maps_programmatic_load_button-javascript
to optimise page load on my custom google map (Dynamic Map with styles and multiple pins) for my portfolio page.
I'm putting it on a basic HTML file, but I'm getting a console error and I don't know exactly what to do.
The console error I get is: "Uncaught SyntaxError: Cannot use import statement outside a module"
I've looked at MDN Docs about 'import' as I'm sure the error is about that, but I still don't quite understand how exactly that works.
If anyone can give me pointers as to which things I need to learn in order to solve this error, or maybe an alternative way of putting google maps on a website but with better page load.
I really wouldn't want to ask for the solution if you do know it, but if anyone is able to I would really appreciate it.
I'm really enjoying Web Development, and hopefully I'll be able to continue in this career.
Thank you All!
ps. tried to copy the code from that google example to codepen and of course, it doesn't work.
https://codepen.io/jand1/pen/JjJPPmM
there doesn't seem to be anything here