Open Street Map should connect to the data from my database, how?


I am very inexperienced with coding. I know it’s a bit amateurish, but I’m trying to use ChatGPT to write my codes and explain them to me.
I need an open street map on my site that will create the pins I have in my wix database. I have already managed to create a map thanks to Leaflet. Now I don’t know how to feed my map with the data from my database. ChatGPT suggested me a solution in which I should create a .js (see screenshot).

Then on the page where I want the map to be displayed, I should create an HTML element that connects to my .js file. That sounded logical so far. But at the line

I have problems. I suspect the phad is wrong. but I don’t know how to find out the correct phad from my created .js file.

How do i find out the correct phad?
If my whole procedure is wrong: how to proceed instead if i want to connect my map with data from my database?

Thank you for any suggestions on how to solve this.

Hello! The code as you have it isn’t going to work and chat GPT can be fairly inaccurate for building in velo wihtout providing it alot of context, but I have some tutorials that should help you understand.

Here is a video that will show you how to set up a leaflet map in a wix site:

From there you can follow the leaflet docs as needed to add features to your map.

The HTML element is a drag/drop feature you need to add to your page first and then place the code inside. It is rendered as an iframe

Finally, if yuo need to pass data pack and forth to your page, see the API documentation for mor einformation there on how to send messages back and forth:$w/htmlcomponent