Replace Google Map API

Hi,

I actually coding social network, but the script use Google Maps and i would like to replace with OpenStreetMap.
This is the code :

<div class="message-type-map event-map"><img src="https://maps.googleapis.com/maps/api/staticmap?center='.$value.'&zoom=13&size=700x150&maptype=roadmap&markers=color:red%7C'.$value.'&sensor=false&scale=2&visual_refresh=true" referrerpolicy="no-referrer"></div>

How i can replace it with OpenStreetMap ?

Thank you very much,
Best regards.

You should probably read this:

https://wiki.openstreetmap.org/wiki/Deploying_your_own_Slippy_Map