OpenStreetMap marker

Hi - I have a below code. I am trying to add a map marker using OpenStreetMap with leaflet. I am not sure if I can write the below marker code without google.maps and use openStreetmap for the below code. I want to avoid using google maps because I am not going to buy Google API key and wanted to use something free to create a map with a marker as I am just learning to create a map project. `f

unction  createMarker(latlng, name, address, index) {`
`    var html = "<b>" + name + "</b> <br/>" + address;`
`    var marker = new google.maps.Marker({`
`      map: map,`
`      position: latlng`
`    });`

the above code gave error, Uncaught ReferenceError: google is not defined
. then I defined to rectify that error. right now, the error is gone, but in the output, i dont see any marker in map and I get warning message asGoogle Maps JavaScript API warning: NoApiKeys. please suggest and direct me to go right to solve this one.

I am moving your thread to a more appropriate subforum. Please do not post in #support if you don’t need any help about the platform itself.

1 Like

Hi, I apologize, I am new to this forum. I am not sure which subforum my thread is moved. I thought Javascript is under web development so I posted it here.

you didn’t post in #curriculum-help:javascript (even if usually that subforum is about the curriculum challenges), you posted in #support

ok, but could you please let me know the link of my post that you moved to curriculum javascript. I tried searching for my post in this forum, but I am not able to see it in javascript forum. Thanks for the help.

It is not in the JavaScript subforum, it is in the Web Development subforum - as you can see by looking at the tag at the top of your post. :slightly_smiling_face: